PDA

View Full Version : Making a Woodcutter!



Torrent of Flame
03-24-2008, 11:33 AM
O-U-T-D-A-T-E-D-!



Hello! Im Torrent, You may recognise me for my work on updating older Tutorials, more recently my one on the PowerMiner update, which is why some of those words found in the PowerMiner tutorial will be found here, as they are 100% relevant!

Well, Im here now to create one on Woodcutting, I already have a Chopping and Banking Tutorial out there, and this will show you how to take into account the fact you have to walk to the bank, and walk back to the willows.

The original guide by The_Rs_Monkey is found here: http://www.villavu.com/forum/showthread.php?t=16602

If you like this Tutorial, please, Spread the Word, Rep Me, or Rank The Thread!!

Thanks In Advance.

Anyway...

Welcome to the Updated Guide to Making a Woodcutter!

This tutorial will include:
- Walking
- Banking
- Cutting
- Switching Players
- FailSafes
- Main Looping
- The basic part of using BankPins!
- Constants and Variables
- The Necessity of Descriptions!


To Start we should name the the program that we are going to use, calling it something significant to the program you are going to make:

program MyFirstWoodCutter;


Then you HAVE to include this part, as it controls everything that we need to use in this script (FindObjCustom, etc.), aswell as Including WoodCutting.scar (Incase we need find axe, find ent, etc. which we wont in this tutorial, but its always a good thing to have)


{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}

The we include our constants. Constants are basically what they say they are, something that is ALWAYS the same, like RockColours, TreeColours, SMART Worlds, etc.


const
//-->Loads<--\\

Loads = 10; //How many loads per player before switching

//--->SRL ID<---\\
YourSRLId = '';
YourSRLPassword ='';

//--->Pin - Make same for ALL chars. If no Pin, leave blank<---\\
YourPin = '';

These are our constants, note that we have a description above them, telling our script user what the constant is for, and giving more information next to them if needed. We see that we have Loads, SRLId's and Bank Pins. I will cover all of these later.


Then we have to declare our variables, not variables again explain themselves, something that is a variable, can constantly change. The variables in this case are the x and the y, the co-ordinates on the game screen. It is an "integer" as they are co-ordinates, which are numerical. Tries will be explained later.

var x, y, LoadsNum, LoadsNum2: integer;

Then we have to declare our variables, not variables again explain themselves, something that is a variable, can constantly change. The variables in this case are the x and the y, the co-ordinates on the game screen. It is an "integer" as they are co-ordinates, which are numerical. LoadsNum and LoadsNum2 are integers aswell, but these will be explained later on.

Then we have our first procedure. I will explain the procedure after we see the overview.

{-------------------------------------------------------
Player Setup
--------------------------------------------------------}

procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0

Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'erna';
Players[0].Active := True;

end;

{----------------------------Do Not Edit Below This----------------------------}

Procedure DeclarePlayers tells us the name of the procedure that we are using. Begin starts the procedure [Every "Begin" has an "End", Every "Repeat" has an "Until" and Every "If" has a "Then" - Follow this and it should stop "Idenfitifer Expected ]. How Many Players means how many players we are going to use, and Current player tells us which player to start with. Username, Password are pretty basic, but the Nickname HAS to be 3-4 letters of non-capital or without a space of your Username, like mine is. The Active = True tells us if the player is to be run in the script or not. Note again the description, it tells us that we should set up our players here, and then not edit below the next line. We would put our variables under here to be safe, but I introduced them earlier just to be with the constants. In our final script you will see the variables under the "Do Not Edit..." part.

Now we have our AntiBan and AntiRandoms, but again Im not going to go into details about them, as I have written a Tutorial about them found here: http://www.villavu.com/forum/showthread.php?t=27515

Procedure AntiRandoms;
begin
If(FindFight)then
RunAway('N', True,1,15000);
FindNormalRandoms;
FindLamp('Woodcutting');
end;

And our AntiBan:

procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill('Woodcutting', False);
3: RandomMovement;
4: BoredHuman;
5: AlmostLogout;
6: DoEmote(400 +Random(90));
end;
end;

Now onto our actual WoodCutting procedure. This part will be merged with an explanation of Fail Safes:

//---------------------------------ChopTree-----------------------------------\\

procedure ChopTree;
var CuttingTime: integer;
Tries: integer;
begin
MarkTime(CuttingTime);
MakeCompass('S');
repeat
if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7)) then
begin
Mouse(x,y,0,0,false);
if(IsUpText('Chop'))then
Wait(5000 + (random(150)));
ChooseOption('hop')
AntiBan;
if (not (FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Willow Logs not found. Switching Players..');
Logout;
NextPlayer(False);
Exit;
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
end;

Now this part looks very daunting. But we can break it down bit by bit.

We have the description at the top, this is for you more than anyone else, so when you need to find your procedure to do some editing, you can find it alot easier!

We name our procedure, like always.

We then declare two unique variables, as in, they are only used in this procedure, so I dont need to declare them at the top as Global Variables [Right word?]

var CuttingTime: integer;
Tries: integer;

These will be explained later on.

begin
MarkTime(CuttingTime);
MakeCompass('S');

We begin the procedure, as always, and it Marks the time that the script starts to cut. It makes the compass face South (Needs to in my script..)but you could make it face Notrh, or whatever, or even just take it out.

repeat
if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7)) then
begin
Mouse(x,y,0,0,false);
if(IsUpText('Chop'))then
Wait(5000 + (random(150)));
ChooseOption('hop')
AntiBan;

Repeat, it repeats the procedure as a whole. If it finds an object called 'Willow' with those 3 colours, and with a tolerance of 7. If it does find it it will move over it, and it the 'Chop' is up in the corner of the screen, it will wait 5-5.15 seconds, and chops it. It will then AntiBan whilst you are chopping.

if (not (FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
Writeln ('Willow Logs not found. Switching Players..');
Logout;
NextPlayer(False);
end;

This is our First Failsafe! If it doesnt find the object willow, it waits 0.2 seconds, and adds 1 to the integer Tries. If it tries 50 times then it will write that statement in our debug box, and logout, moving onto the next player but leaving the player inactive, so it will not run this character again. It then ends the part of the procedure.

Then our Final bit. I bet your like? Cutting Time? HUH?

Lets explain it now.

until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
end;

So, the until part goes with the repeat at the start of the procedure. It will repeat this procedure until it has a Full Inventory, or until it Finds that our Integer "Cutting Time" is about 140-150 minutes. (A bit long I know but you never know how long it could take to get a full inventory?)

Now we move onto our Walk to bank procedure.

//----------------------Walking from Willows to Bank--------------------------\\
procedure WalkToBank;
begin
if (not(LoggedIn)) then
Exit;
SymbolAccuracy:= 0.2;
MakeCompass('N');
if (FindSymbol(x, y, 'bank')) then
begin
Mouse(x, y, 2, 2, true);
FFlag(0);
Writeln('Got to bank');
end;
end;

Well, we tell ourselves what our procedure is in the description, and name the procedure. A failsafe first, if we are not logged in, we will exit the script. It gives a SymbolAccuracy of 0.2, so is very accurate. It will make the compass face North, like it has to in my script. If it finds the Bank Symbol on the X and the Y axis, and then it says "FFlag". I took this description straight from the SRL Manual:

procedure FFlag(Distance: Integer);
By: Wizzup? / WT-Fakawi.
Description:
[I]Waits until Flag is within "Distance" distance.

Seeing as my distance is "0", It waits until the Flag has disappeared, but this is useful for walking on roads as a failsafe, as you dont always wait to get to the flag all the time.

It then writes "Got To Bank" in our Debug Box, then ends the part of the procedure, and ends the procedure.

You could use RadialWalking, or anything of the sort, Failsafes with DTM's, but this is for beginners and I dont think it is necissary to get inot too much detail about those at the moment.

Now onto the banking procedure. I took this part out of my Tutorial on Chopping and banking:

procedure Banking
begin
if (InvFull) then
begin
MakeCompass('W')
Wait (300 + random(160));
OpenBankQuiet('db');
if (PinScreen) then
InPin(YourPin);
if(FindColorSpiral(x, y, 4155248, 547, 206, 734, 464))then
begin
Mouse(x, y, 4, 3, false);
ChooseOption('All');
Result := True;
if Result = True then
begin
LoadsNum := LoadsNum + 1;
LoadsNum2 := LoadsNum2 + 1;
ReportVars[1] := ReportVars[1] + 1;
SendSRLReport;
end;
end;
CloseBank;
Wait(150 + random (278));
MakeCompass('S');
end;
end;


So! Lets start.

procedure Banking
begin
if (InvFull) then

We name our procedure, as par usual. We then begin it [Man this gets harder and harder..] and then it checks if the inventory is full. If it is full...

begin
MakeCompass('W')
Wait (300 + random(160));
OpenBankQuiet('db');

...then it begins, makes the compass "West" to face the bank, (in Draynor its West..) and waits 300-460 milliseconds. IT then opens the Bank 'Quiet'. This is a procedure that is a little more laggy, but is omre human like. The 'Db' tells us what bank we are at, so it could be VWB, VEB, Go figure.

if (PinScreen) then
InPin(YourPin);
if(FindColorSpiral(x, y, 4155248, 547, 206, 734, 464))then

If the script detects a pin screen it will InPin(YourPin). The YourPin is the constant we set up at the beginning of the script. This could be something like this if we wanted to add it to the declare players:

Players[0].Integers[0] := 0000;

Then we could put the InPin(YourPin) as InPin(Players[0].Integers[0]) [I Think??]

And then if it finds the Colour of the Willow Logs (In Mine..) on the X and Y axis, in the coordinate box of the inventory, it will...

begin
Mouse(x, y, 4, 3, false);
ChooseOption('All');
Result := True;
if Result = True then
begin
LoadsNum := LoadsNum + 1;
LoadsNum2 := LoadsNum2 + 1;
ReportVars[1] := ReportVars[1] + 1;
SendSRLReport;
end;
end;
CloseBank;
Wait(150 + random (278));
MakeCompass('S');
end;
end;

...begin another part of the procedure. It moves over the Logs, and chooses the option "All" like a player would.

Now, whats that part underneath? Well this is the SRL Stats part. Im not going to go into this part, but I will link you to an indepth tutorial that looks at exactly this, by Hy71194: http://www.villavu.com/forum/showthread.php?t=27772

Now we have the LoadsNum and LoadsNum2. This will come into effect later on in the script when we start on the main loop, so we can ignore this for now.

It then ends this part, closes the Bank, waits about 0.4 seconds, and makes the compass South ready to walk back to our Draynor willows. It then ends the procedure.


Walking back to the willows..

procedure WalkToWillow;
begin
if (FindSymbol(x, y, 'fish')) then
begin
Mouse(x, y, 2, 2, true);
FFlag(0);
Writeln('Got to Willows');
end;
end;

Nice and basic :]. We name it, begin it, if it finds the fish symbol, it clicks it, it gets to the flag, makes the compass east, writes Got To Willows in the debug box and ends it. Simple as :D

NOW.... Onto our Main Loop!

Lets first setup our Script, with a little bit before our main loop, this saves on the size of our main loop.

Lets make it shall we?

procedure SetupScript;
begin
SRLId := YourSRLId;
SRLPassword:= YourSRLPassword;
SetupSRL;
ScriptID:= '687';
DeclarePlayers;
end;

Sends your SRL Id/Password, sets up SRL so that it can run faster. And The script ID is covered in Hy's tutorial on SRL Stats. We then Declare our Players and end the Setup.

Now ONTO our Main Loop..:spot:

begin
SetupScript;
repeat
WalkToWillow;
ChopTree;
AntiBan;
WalkToBank;
Banking;
if (LoadsNum2=Loads) then
begin
NextPlayer(True);
LoadsNum2 := 0;
MakeCompass('S')
Writeln('Players Switched successfully')
end;
until (false)
end.


So, a little more complicated then it seems.

begin
SetupScript;
repeat
WalkToWillow;
ChopTree;
AntiBan;
WalkToBank;
Banking;

IT begins by doing SetupScript, then Repeats the WalkToWillow, ChopTree, AntiBanning, Walking to the Bank and Banking.

if (LoadsNum2=Loads) then
begin
NextPlayer(True);
LoadsNum2 := 0;
MakeCompass('S')
Writeln('Players Switched successfully')

Now remember earlier I said that we should ignore the LoadsNum2 but for now? Well now we use it. If the LoadsNum2 = The Loads we setup to do at the constants at the start, it will begin by Logging in the Next Player, making sure that this player is True, IE, it will always repeat. It makes the LoadsNum2 = 0 again so that it doesnt logout instantly, and makes the compass south, writing in the Debug box "Players switched sucessfully'"

Now when we compile this whole script together we can finally have our FIRST Script:

{/\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
| WoodCutter Tutorial by Torrent of Flame |
| For educational use ONLY |
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\}




program MyFirstWoodCutter;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}

const
//-->Loads<--\\

Loads = 10; //How many loads per player before switching

//--->SRL ID<---\\
YourSRLId = '';
YourSRLPassword ='';

//--->Pin - Make same for ALL chars. If no Pin, leave blank<---\\
YourPin = '';

{-------------------------------------------------------
Player Setup
--------------------------------------------------------}

procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0

Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'erna';
Players[0].Active := True;

end;

{----------------------------Do Not Edit Below This----------------------------}
var x, y, LoadsNum, LoadsNum2: integer;

//-----------------------------AntiRandoms/AntiBan----------------------------\\

Procedure AntiRandoms;
begin
If(FindFight)then
RunAway('N', True,1,15000);
FindNormalRandoms;
FindLamp('Woodcutting');
end;

procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill('Woodcutting', False);
3: RandomMovement;
4: BoredHuman;
5: AlmostLogout;
6: DoEmote(400 +Random(90));
end;
end;

//---------------------------------ChopTree-----------------------------------\\

procedure ChopTree;
var CuttingTime: integer;
Tries: integer;
begin
MarkTime(CuttingTime);
MakeCompass('S');
repeat
if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
begin
Mouse(x,y,0,0,false);
if(IsUpText('Chop'))then
Wait(5000 + (random(150)));
ChooseOption('hop')
AntiBan;
if (not (FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Willow Logs not found. Switching Players..');
Logout;
NextPlayer(False);
Exit;
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
end;

//----------------------Walking from Willows to Bank--------------------------\\

procedure WalkToBank;
begin
if (not(LoggedIn)) then
Exit;
SymbolAccuracy:= 0.2;
MakeCompass('N');
if (FindSymbol(x, y, 'bank')) then
begin
Mouse(x, y, 2, 2, true);
FFlag(0);
Writeln('Got to bank');
end;
end;

//--------------------------------Banking-------------------------------------\\

procedure Banking;
begin
if (InvFull) then
begin
MakeCompass('W')
Wait (300 + random(160));
OpenBankQuiet('db');
if (PinScreen) then
InPin(YourPin);
if(FindColorSpiral(x, y, 4155248, 547, 206, 734, 464))then
begin
Mouse(x, y, 4, 3, false);
ChooseOption('All');
begin
LoadsNum := LoadsNum + 1;
LoadsNum2 := LoadsNum2 + 1;
ReportVars[1] := ReportVars[1] + 1;
SendSRLReport;
end;
end;
CloseBank;
Wait(150 + random (278));
MakeCompass('S');
end;
end;

//Willows to Bank\\

procedure WalkToWillow;
begin
if (FindSymbol(x, y, 'fish')) then
begin
Mouse(x, y, 2, 2, true);
FFlag(0);
Writeln('Got to Willows');
end;
end;

//SetupScript\\

procedure SetupScript;
begin
SRLId := YourSRLId;
SRLPassword:= YourSRLPassword;
SetupSRL;
ScriptID:= '687';
DeclarePlayers;
end;

//THE MAIN LOOPAGE!\\

begin
SetupScript;
repeat
WalkToWillow;
ChopTree;
AntiBan;
WalkToBank;
Banking;
if (LoadsNum2=Loads) then
begin
NextPlayer(True);
LoadsNum2 := 0;
MakeCompass('S')
Writeln('Players Switched successfully')
end;
until (false)
end.

Thanks to Pwnt for the Fix.

Thanks for Reading!!!

gerauchert
03-24-2008, 11:43 AM
not bad, i mostly skimmed through it but it looks pretty in depth and detailed.

Suggestions:

- those standards make my eyes hurt in certain procedures :eek:


if(Tries = 50)then
Writeln ('Willow Logs not found. Switching Players..');
Logout;
NextPlayer(True);


Whenever you want an if then statment to do more than one thing, you MUST have a begin after it. Otherwise it will always Logout no matter if there are 50 tries or not. It is fine if you only have one procedure or function after the statement, but for multiple make sure you have begins and ends.

Also you might want to make that a NextPlayer(False); as the script messed up and is probably not by the willows if it didnt find it. Through in an Exit after the NextPlayers as well.


if(Tries = 50)then
begin
Writeln ('Willow Logs not found. Switching Players..');
Logout;
NextPlayer(False);
Exit;
end;

Good tut though, keep up the good work :D

Torrent of Flame
03-24-2008, 11:51 AM
I know some of the standards are well... terrible..

But trying to write scripts in the "New Thread" box is kinda difficult.

Anyways, that way I can tell if people just copy, the standards would be the same :D

Thanks! When dyo think I'll get that SRL Tutorial Writer Award? :D

gerauchert
03-24-2008, 12:06 PM
I know some of the standards are well... terrible..

But trying to write scripts in the "New Thread" box is kinda difficult.

Anyways, that way I can tell if people just copy, the standards would be the same :D

Thanks! When dyo think I'll get that SRL Tutorial Writer Award? :D

Well, when i wrote my tut I had scar open in one window and the tutorial in the other and i just copy and paste directly from scar into the scar tags and it worked perfect for me...of course now that I look back at it my standards have been tweaked since i wrote it ;)

You can take a look at it if you want...been a long time since I got a reply :(

As for the cup, I really didnt expect to get one but Fakawi saw the tut and gave it to me. So if an admin sees your tut and likes it enough then bam you got yourself a cup :D

Torrent of Flame
03-24-2008, 12:18 PM
Woo :D

Ill keep posting tutorials =]

Ill take a look *Pity Checks*

:P

Nah im playing.


Yeah, I had SCAR open, but My WoodCutter has DDTM's and RadialWalk and more complex stuff, so I have to take some of it out and the standards get messed up..

gerauchert
03-24-2008, 12:20 PM
Ill take a look *Pity Checks*


you bastard. :p jk jk

Torrent of Flame
03-24-2008, 12:33 PM
Hahah. Fuck you :P

J/p

Pwnt by Pwnt
03-26-2008, 08:41 PM
{/\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
| WoodCutter Tutorial by Torrent of Flame |
| For educational use ONLY |
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\}




program MyFirstWoodCutter;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}

const
//-->Loads<--\\

Loads = 10; //How many loads per player before switching

//--->SRL ID<---\\
YourSRLId = '';
YourSRLPassword ='';

//--->Pin - Make same for ALL chars. If no Pin, leave blank<---\\
YourPin = '';

{-------------------------------------------------------
Player Setup
--------------------------------------------------------}

procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0

Players[0].Name := 'Username';
Players[0].Pass := 'Password';
Players[0].Nick := 'erna';
Players[0].Active := True;

end;

{----------------------------Do Not Edit Below This----------------------------}
var x, y, LoadsNum, LoadsNum2: integer;

//-----------------------------AntiRandoms/AntiBan----------------------------\\

Procedure AntiRandoms;
begin
If(FindFight)then
RunAway('N', True,1,15000);
FindNormalRandoms;
FindLamp('Woodcutting');
end;

procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill('Woodcutting', False);
3: RandomMovement;
4: BoredHuman;
5: AlmostLogout;
6: DoEmote(400 +Random(90));
end;
end;

//---------------------------------ChopTree-----------------------------------\\

procedure ChopTree;
var CuttingTime: integer;
Tries: integer;
begin
MarkTime(CuttingTime);
MakeCompass('S');
repeat
if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
begin
Mouse(x,y,0,0,false);
if(IsUpText('Chop'))then
Wait(5000 + (random(150)));
ChooseOption('hop')
AntiBan;
if (not (FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Willow Logs not found. Switching Players..');
Logout;
NextPlayer(False);
Exit;
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
end;

//----------------------Walking from Willows to Bank--------------------------\\

procedure WalkToBank;
begin
if (not(LoggedIn)) then
Exit;
SymbolAccuracy:= 0.2;
MakeCompass('N');
if (FindSymbol(x, y, 'bank')) then
begin
Mouse(x, y, 2, 2, true);
FFlag(0);
Writeln('Got to bank');
end;
end;

//--------------------------------Banking-------------------------------------\\

procedure Banking;
begin
if (InvFull) then
begin
MakeCompass('W')
Wait (300 + random(160));
OpenBankQuiet('db');
if (PinScreen) then
InPin(YourPin);
if(FindColorSpiral(x, y, 4155248, 547, 206, 734, 464))then
begin
Mouse(x, y, 4, 3, false);
ChooseOption('All');
begin
LoadsNum := LoadsNum + 1;
LoadsNum2 := LoadsNum2 + 1;
ReportVars[1] := ReportVars[1] + 1;
SendSRLReport;
end;
end;
CloseBank;
Wait(150 + random (278));
MakeCompass('S');
end;
end;

//Willows to Bank\\

procedure WalkToWillow;
begin
if (FindSymbol(x, y, 'fish')) then
begin
Mouse(x, y, 2, 2, true);
FFlag(0);
Writeln('Got to Willows');
end;
end;

//SetupScript\\

procedure SetupScript;
begin
SRLId := YourSRLId;
SRLPassword:= YourSRLPassword;
SetupSRL;
ScriptID:= '687';
DeclarePlayers;
end;

//THE MAIN LOOPAGE!\\

begin
SetupScript;
repeat
WalkToWillow;
ChopTree;
AntiBan;
WalkToBank;
Banking;
if (LoadsNum2=Loads) then
begin
NextPlayer(True);
LoadsNum2 := 0;
MakeCompass('S')
Writeln('Players Switched successfully')
end;
until (false)
end.

some things weren't working because you either forgot something (parenthesis, semi-colons, etc.) and the Result = True; thing wouldn't work so I just took it out... you can add it back in if you want

(yes, I know, this is for educational purposes, but you should at least know if a script works or not ^^)

if (InvFull) then
begin

you don't need that do you?

Torrent of Flame
03-26-2008, 08:43 PM
Ah. What do you expect? Its just a tutorial.

Im not perfect. :P

Pwnt by Pwnt
03-26-2008, 08:49 PM
;) do you have MSN?

Torrent of Flame
03-26-2008, 08:59 PM
Yeha, but Im fed up with Random adds, so Im not spreading it anymore =]

I added you anyway. Pwnt_by_pwnt...

Pwnt by Pwnt
03-26-2008, 09:07 PM
O_o how did you get my MSN? and I don't see an add..

Torrent of Flame
03-26-2008, 09:17 PM
You told me to add you.

King of the Nites
03-27-2008, 12:02 AM
I was wondering what the symbol accuracy does and how you find out what number you put there. This was a great tut. rep ++ for you! :D

faster789
03-27-2008, 01:43 AM
hmmm nice tuts u makin u on a role eh? ;) i jus noticed from wat i know...i NEVR saw an autofighting tut yet....so therz an idea but yea....w/e u wish to do..

Torrent of Flame
03-29-2008, 11:07 AM
I might look into it.

And Symbol accuracy tells SCAR how close to the image it has of the Bank Symbol it should look for.

Noob xp1
04-05-2008, 09:21 PM
Nicely done

killerxc123
04-05-2008, 10:01 PM
YES! it works!!!

Torrent of Flame
04-16-2008, 07:28 PM
Lol =P

Bump

ape
04-16-2008, 07:30 PM
Very nice tutorial. I love the clean simple code, definitely a good guide for a newbie making his own tree killer.

Torrent of Flame
04-16-2008, 07:33 PM
Wouldnt mind seeing you make one =]

The rep button is there if you feel like giving me some, its the little tick.

Note to an admin: IF he feels like it. Im not telling him too? :D

NiCbaZ
04-18-2008, 03:58 AM
your a lier when i say the post above me im like ' HAVE TO REP TOF' but then i snapped out of it lolz

anyay i read this tut a while back it tought me sybol clicking` :p


tyyy

Torrent of Flame
04-18-2008, 09:43 AM
:D I see you got Site Supporter Nicbaz ^^

NiCbaZ
04-18-2008, 09:50 AM
;) had it for like 4 months or something like that, anyway get on MSN n33b been waiting for you for 3 hours lol

Sneakyman
04-19-2008, 01:37 PM
Thanks for the tut, this will help me get some coding back ;) , almost a year ago i did that and almost know nothing anymore

jamesrex100
04-27-2008, 09:13 AM
omg wow this helped alot i finshed my script i owe u so much this is such the best now and i get how to script much better now good work keep it up!!!!

rbdkx
04-27-2008, 06:56 PM
Thank you for including so much detailed information about the function of every thing

kor
05-02-2008, 06:42 AM
hmm, great tut. i got a problem tho, i get this error: Line 15: [Error] (12847:71): 'THEN' expected in script . that line looks like this: if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7)) then

help? :P

slayerkiller13
05-04-2008, 03:11 PM
nice tut learned few things from it that i didnt know :D

Alco13
05-04-2008, 05:00 PM
read it and it looks great gona try make it later, nice amount of detail gj

perrz
05-06-2008, 01:53 PM
Nice tutorial, should get me started learning scripting, thanks alot!

P1nky
05-06-2008, 02:07 PM
lol thanks even i learned something:

loads for each player (i use to do it wrong lol).

Rep+

Griff
05-19-2008, 02:42 PM
Great tut, man! I just have 1 question.
In the Choptree procedure, there is this line here:
if FindObjCustom(x, y, ['Yew'], [2060900, 1793357, 3305062], 7) then
I understand everything except for the tolerence.(the 7) Could anyone explain that?
(I swiched around the wil,low and the colours, but that shouldnt change my question)

kor
05-20-2008, 01:19 PM
i get THEN expected if i use if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7)) then. maybe i have the wrong srl rev?

Griff
05-26-2008, 10:26 PM
I have one more question. Does the line until(InvFull) still work? Whenever I try it to work with one of my scripts, I get the error identifier expected in script. (I have my repeat and everything)

shrubie1
05-29-2008, 01:40 AM
asdasd

nickrules
06-01-2008, 11:34 PM
when i try to run it, it says this:



if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763],7))then



Line 72: [Error] (12904:70): 'THEN' expected in script

:confused: help???:confused:

Infidel00
06-02-2008, 12:33 AM
Hey thank you for the help! This tut explains a great deal and best yet, I love how it points me to locations to that will go more in depth on topics and lines used in this script.

Thanks for taking time to write this up for us beginners!

k1ng duffy
06-02-2008, 05:18 AM
Very clean tutorial. I made one for me :) I seem to be catching up to this very fast.

homeslice930
06-03-2008, 01:57 AM
YES!
a good tutorial on how to script better... it also seems really in depth so that will also help me

zrickysz
06-03-2008, 01:59 AM
nice

Sc00by22
06-07-2008, 02:07 PM
Line 58: [Error] (12837:71): 'THEN' expected in script C:\Program Files\SCAR 3.15 2\Scripts\Runescape\Woodcutter.scar

Any reason why?

Line 58 =

if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7))then

Fixed remove 1 ")" at the end, But now i have more errors, I forgot a semicolon and it doesn't say which line :D

EDIT :

Script works fine except for the fact it won't do anything, no mouse movements :(

program Woodcutter;
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}

const

Loads = 10;

YourSRLId = '';
YourSRLPassword ='';
YourPin = '';

{-------------------------------------------------------
Player Setup
--------------------------------------------------------}

procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;

end;


var x, y, LoadsNum, LoadsNum2: integer;


Procedure AntiRandoms;
begin
If(FindFight)then
RunAway('N', True,1,15000);
FindNormalRandoms;
FindLamp('Woodcutting');
end;

procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill('Woodcutting', False);
3: RandomMovement;
4: BoredHuman;
5: AlmostLogout;
6: DoEmote(400 +Random(90));
end;
end;


procedure ChopTree;
var CuttingTime: integer;
Tries: integer;
begin
MarkTime(CuttingTime);
MakeCompass('S');
repeat
if FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7) then
begin
Mouse(x,y,0,0,false);
if(IsUpText('Chop'))then
Wait(5000 + (random(150)));
ChooseOption('hop')
AntiBan;
if (not (FindObjCustom(x, y, ['Wil', 'low'], [1989969, 3760987, 2844763], 7))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 50)then
begin
Writeln ('Willow Logs not found. Switching Players..');
Logout;
NextPlayer(False);
Exit;
end;
end;
until(InvFull) or (TimeFromMark(CuttingTime) > 800000+random(60000));
end;


procedure WalkToBank;
begin
if (not(LoggedIn)) then
Exit;
SymbolAccuracy:= 0.2;
MakeCompass('N');
if (FindSymbol(x, y, 'bank')) then
begin
Mouse(x, y, 2, 2, true);
FFlag(0);
Writeln('Got to bank');
end;
end;


procedure Banking;
begin
if (InvFull) then
begin
MakeCompass('W')
Wait (300 + random(160));
OpenBankQuiet('db');
if (PinScreen) then
InPin(YourPin);
if(FindColorSpiral(x, y, 4155248, 547, 206, 734, 464))then
begin
Mouse(x, y, 4, 3, false);
ChooseOption('All');
begin
LoadsNum := LoadsNum + 1;
LoadsNum2 := LoadsNum2 + 1;
ReportVars[1] := ReportVars[1] + 1;
SendSRLReport;
end;
end;
CloseBank;
Wait(150 + random (278));
MakeCompass('S');
end;
end;


procedure WalkToWillow;
begin
if (FindSymbol(x, y, 'fish')) then
begin
Mouse(x, y, 2, 2, true);
FFlag(0);
Writeln('Got to Willows');
end;
end;


procedure SetupScript;
begin
SRLId := YourSRLId;
SRLPassword:= YourSRLPassword;
SetupSRL;
ScriptID:= '687';
DeclarePlayers;
end;


begin
SetupScript;
repeat
WalkToWillow;
ChopTree;
AntiBan;
WalkToBank;
Banking;
if (LoadsNum2=Loads) then
begin
NextPlayer(True);
LoadsNum2 := 0;
MakeCompass('S')
Writeln('Players Switched successfully')
end;
until (false)
end.

dallas574
06-10-2008, 04:11 PM
Nicely done thanks helped alot

Suhaib42
06-11-2008, 11:03 AM
how do I view intermediate tutorials????

kor
06-11-2008, 11:11 AM
how do I view intermediate tutorials????
I believe iits as simple as left clicking on the link with your mouse. Or Just make and co ordinate auto xD
Mouse(x, y, 0, 0, True); Replace the x and y with your co ordinates. LOL.
I dont know, but you might have to be a Srl Junior member? :S That would be weird though.

elobire
09-03-2008, 06:31 PM
hmm well i get this message--Line 64: [Error] (16262:4): Unknown identifier 'AlmostLogout' in script

for this line--
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill('Woodcutting', False);
3: RandomMovement;
4: BoredHuman;
5: AlmostLogout;
6: DoEmote(400 +Random(90));
end;
end;

Torrent of Flame
09-03-2008, 07:13 PM
Tut is outdated, sorry.

I dont script amymore, so my tutorial is not up to date.

spamthis
09-08-2008, 11:43 PM
I dont script amymore, so my tutorial is not up to date.

That explains a LOT! The script goes haywire when it comes time to bank. I'd fix it myself but I'll be buggered if I can figure out how to fix it. I was hoping to learn from this. :rolleyes:

Excellent tut regardless. I actually understood most of it. Would love to see an updated version of this. nudge nudge wink wink

This is a long slow process getting up to speed on scripting lol.

spamthis
09-08-2008, 11:45 PM
I'm gonna start from scratch based on this tut and see if I can come up with a simple script that will cut the oak next to draynor and bank it. (That should a riot)

Now if I could just figure out what colors I'm supposed to use...

Minkino
09-28-2008, 03:04 AM
Can someone point me a tut that actually works, because I'm just starting and I need a script as my base but I want to make it.

droppeD:)
01-07-2009, 02:13 AM
thnks, this helped alot

Smarter Child
01-09-2009, 12:06 AM
:p Hmm nice ...

procedure Banking;
begin
if (InvFull) then
begin
MakeCompass('W')
Wait (300 + random(160));
OpenBankQuiet('db');

Since this is for nubs you wouldn't need to change compass if u used...

OpenBank('db', true, true)

Simply changes angle and compass in one line....just a suggestion for newbies there is no need to update tut. etc.

Leather Cock~ = SmarterChild~:fiery: :spot:

Jmanx
01-14-2009, 03:25 AM
Seems like a nice tut.... i always get lost following all these scripting tuts, so might as well not even read.

Good job.

Wootmankeh
01-18-2009, 11:59 AM
Line 64: [Error] (16445:4): Unknown identifier 'AlmostLogout, could anyone help me?

Torrent of Flame
01-18-2009, 12:03 PM
It says on the front page this is outdated. Learn how to read.