SRL Archive - First Scripts

Edgville WoodCutter 0.0.1


Zerghunter3000

2009-10-17 12:24:42

Version 0.0.3 is out! Way better than 0.0.2 of course!

Features:
AntiBan
Drops Willow Logs
Cuts Continueously.
Can Sometimes Find its Way Back if it Strays a Little.
Will Log out after a while if a Random has happened.
Weak AutoResponder.
BoringTalk.
Report.


Bugs/Problems:
May Cut a Regular Tree Once in Awhile (Will not mess up Script)
The mouse may go around the screen like crazy. ( Just restart script )
You may come back to it, and your logged out, with the mouse going crazy. (This means the mouse has froze up or messed up and you were logged out.)
Can not do Randoms. (You may want to check on it occasionally.)

Future Updates:
Will not cut Regular Trees.
Will let you "Personlize" it or Edit it a little.
Better AutoResponder.
Fix it up to be Neater even more.


Credits:
Thanks to Mario97000 for getting me started.
Thanks to Coh3n for helping me with all my problems.

Please Rate on 1-5 if you will, and report any bugs or problems, and please comment. Thanks.
Any Spam and unwanted replies will be warned.
And Post your Reports! ;)

Chopped 324 logs.
~~~~~~~~~~~~~~~~~~~~~
|Total Chopped: 324. |
|Total Loads: 12. |
|Total Experience: 21876. |
~~~~~~~~~~~~~~~~~~~~~

Zerghunter3000

2009-10-17 12:27:34

Problem with uplaoding script: Now Fixed.

Coh3n

2009-10-17 12:29:48

You left you pass in your script, I changed it and PM'd you.

Zerghunter3000

2009-10-17 12:30:49

kk thx

Zerghunter3000

2009-10-17 12:35:49

Fixed

Coh3n

2009-10-17 12:44:33

Here are my seggestions, their commented in the script. I also fixed your standards, looks much better now.
            /////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\
//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\
////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\
/////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
/////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//////////////////////Edgville WoodCutter.scar\\\\\\\\\\\\\\\\\\\\\\
////////////////////////////Version 0.0.1\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////By: Zerghunter3000\\\\\\\\\\\\\\\\\\\\\\\\\\\
//////////////////////////Thanks To: Mario97000\\\\\\\\\\\\\\\\\\\\\\\\\\\
/////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Program WoodCutter;
{.include srl/srl.scar}

var I: Integer;
////////////////////////////////////////////////////////////////////////////
procedure Declareplayers;
begin
HowmanyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Writeln('Logging in...');
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
end;

////////////////////////////////////////////////////////////////////////////

procedure AntiBan;
begin
if not LoggedIn then Exit;

FindNormalRandoms;
case Random(40) of // You did Antiban too much, something like Random(40) is much better. :)
0: begin
Writeln('Commencing WoodCutting Skill Check...');
HoverSkill('woodcutting',false);
Wait(2453 + Random(432));
end;

1: begin
Writeln ('Commencing mouse Pick up...');
PickUpMouse;
end;

2: begin
Writeln('Commencing Turns : N, S ,N')
MakeCompass('N');
Wait(341 + Random(124));
Makecompass('S');
Wait(124 + Random(131));
MakeCompass('N');
FindNormalRandoms;
end;

3: begin
Writeln('Commencing Turns : E, W ,S')
MakeCompass('E');
Wait(100 + Random(133));
Makecompass('W');
Wait(50 + Random(133));
MakeCompass('S');
FindNormalRandoms;
end;

4: begin
Writeln('Commencing Turns : S, E ,N')
MakeCompass('S');
Wait(854 + Random(244));
Makecompass('E');
Wait(674 + Random(367));
MakeCompass('N');
FindNormalRandoms;
end;
end;
end;

procedure ChopTree;
var
x, y: Integer;
begin
repeat
MakeCompass('N');
FindNormalRandoms;
if FindObj(x, y, 'hop', 2575932, 35) then
begin // You forgot a begin..end nest here.
Writeln('Found Tree...');
Mouse(x, y, 0, 0, False);
Writeln('Cutting Down Tree');
Chooseoption('hop');
end; // And here.
repeat
Wait(1200 + Random(250));
AntiBan;
until not IsUpText('illow') or InvFull;
until(InvFull);

if InvFull then // This is just an extra check. :)
Writeln('Inventory Full.');
Wait(1000 + Random(120));
Writeln('Emptying Inventory...');
SetupSRL; // Why do you have this here? It's not needed.
for I := 2 to 28 do
DropItem(I);
ChopTree; // Also here, it's not needed. I'm guessing that's there by accident.
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
repeat // Without this loop, it will only do one load.
ChopTree;
until(AllPlayersInactive);
end.

Pretty good for a first script, keep up the good work and you'll be a master scripter in no time. :) Check out my tutorial in the scripting help section if you want to learn more. :D

Coh3n

Zerghunter3000

2009-10-17 12:50:23

Okay, well umm I do have a Q though,

MakeCompass('N');
FindNormalRandoms;
if FindObj(x, y, 'hop', 2575932, 35) then
begin // You forgot a begin..end nest here.
Writeln('Found Tree...');
Mouse(x, y, 0, 0, False);
Writeln('Cutting Down Tree');
Chooseoption('hop');
end; // And here.
Umm where it says if findobj etc. is there anyway to make it so it says if findobj. (object)
then do this: etc.
else
do this.

as in, if it cant find obj/color, it searches for a new and dif color i input

Coh3n

2009-10-17 12:54:16

From: Zerghunter3000
Okay, well umm I do have a Q though,

MakeCompass('N');
FindNormalRandoms;
if FindObj(x, y, 'hop', 2575932, 35) then
begin // You forgot a begin..end nest here.
Writeln('Found Tree...');
Mouse(x, y, 0, 0, False);
Writeln('Cutting Down Tree');
Chooseoption('hop');
end; // And here.
Umm where it says if findobj etc. is there anyway to make it so it says if findobj. (object)
then do this: etc.
else
do this.

as in, if it cant find obj/color, it searches for a new and dif color i input


Yes! :) Simply something like this:
   if FindObj(x, y, 'hop', 2575932, 35) then
begin
Writeln('Found Tree...');
Mouse(x, y, 0, 0, False);
Writeln('Cutting Down Tree');
Chooseoption('hop');
end else // Notice the "else"
begin
if FindColorTolerance(x, y, Color, MSX1, MSY1, MSX2, MSY2, 10) then
begin
// Blah, blah, blah.
end else
begin
// For another failsafe if you wish.
end;
end;

Zerghunter3000

2009-10-17 12:59:33

thx man

Zerghunter3000

2009-10-17 13:29:42

hmmm, it seems not like to work o.o here is the problem:

procedure ChopTree;
var
x, y: Integer;
begin
repeat
MakeCompass('N');
FindNormalRandoms;
if FindObj(x, y, 'hop', 2575932, 35) then
begin
Writeln('Found Tree...');
Mouse(x, y, 0, 0, False);
Writeln('Cutting Down Tree');
Chooseoption('hop');
end;
repeat
Wait(1200 + Random(250));
AntiBan;
until not IsUpText('illow') or InvFull;
until(InvFull);

if InvFull then
Writeln('Inventory Full.');
Wait(1000 + Random(120));
Writeln('Emptying Inventory...');
SetupSRL;
for I := 2 to 28 do
DropItem(I);
ChopTree;
end else
begin
repeat
MakeCompass('N');
FindNormalRandoms;
if FindObj(x, y, 'hop', 2575932, 35) then
begin
Writeln('Found Tree...');
Mouse(x, y, 0, 0, False);
Writeln('Cutting Down Tree');
Chooseoption('hop');
end;
repeat
Wait(1200 + Random(250));
AntiBan;
until not IsUpText('illow') or InvFull;
until(InvFull);

if InvFull then
Writeln('Inventory Full.');
Wait(1000 + Random(120));
Writeln('Emptying Inventory...');
SetupSRL;
for I := 2 to 28 do
DropItem(I);
ChopTree;
end else
begin
repeat
MakeCompass('N');
FindNormalRandoms;
if FindObj(x, y, 'hop', 2638150, 35) then
begin
Writeln('Found Tree...');
Mouse(x, y, 0, 0, False);
Writeln('Cutting Down Tree');
Chooseoption('hop');
end;
repeat
Wait(1200 + Random(250));
AntiBan;
until not IsUpText('illow') or InvFull;
until(InvFull);

if InvFull then
Writeln('Inventory Full.');
Wait(1000 + Random(120));
Writeln('Emptying Inventory...');
SetupSRL;
for I := 2 to 28 do
DropItem(I);
ChopTree;
end else
It says the error of:

Line 112: [Error] (20675:5): Semicolon (';') expected in script

idk where to put the semicolon, but line 112 is an

end else
that type of line

Coh3n

2009-10-17 13:55:49

The version I posted above compiles fine. Could you post your whole script please? Also, put them in scar tags instead of code tags. It just makes it easier to read. :)

The error may also be caused because you don't have anything after you end else line. If you use an "else" statement, you need a command for SCAR to execute. So, if you just want it to end, make the line "end;" instead of "end else".

stefuck

2009-10-17 13:57:14

u must put the semicolon behin end else

like this

end else;

i think;)

Coh3n

2009-10-17 13:58:45

From: stefuck
u must put the semicolon behin end else

like this

end else;

i think;)

Not quite. A semicolon is not needed after words like begin, end, else, repeat, etc.

Zerghunter3000

2009-10-17 14:17:12

Here is whole Script, oh and how do u put it in scar code anyways?

/////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\
//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\
////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\
/////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
/////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//////////////////////Edgville WoodCutter.scar\\\\\\\\\\\\\\\\\\\\\\
////////////////////////////Version 0.0.1\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
///////////////////////////By: Zerghunter3000\\\\\\\\\\\\\\\\\\\\\\\\\\\
//////////////////////////Thanks To: Mario97000\\\\\\\\\\\\\\\\\\\\\\\\\\\
/////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Program WoodCutter;
{.include srl/srl.scar}

var I: Integer;
////////////////////////////////////////////////////////////////////////////
procedure Declareplayers;
begin
HowmanyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Writeln('Logging in...');
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
end;

////////////////////////////////////////////////////////////////////////////

procedure AntiBan;
begin
if not LoggedIn then Exit;

FindNormalRandoms;
case Random(40) of
0: begin
Writeln('Commencing WoodCutting Skill Check...');
HoverSkill('woodcutting',false);
Wait(2453 + Random(432));
end;

1: begin
Writeln ('Commencing mouse Pick up...');
PickUpMouse;
end;

2: begin
Writeln('Commencing Turns : N, S ,N')
MakeCompass('N');
Wait(341 + Random(124));
Makecompass('S');
Wait(124 + Random(131));
MakeCompass('N');
FindNormalRandoms;
end;

3: begin
Writeln('Commencing Turns : E, W ,S')
MakeCompass('E');
Wait(100 + Random(133));
Makecompass('W');
Wait(50 + Random(133));
MakeCompass('S');
FindNormalRandoms;
end;

4: begin
Writeln('Commencing Turns : S, E ,N')
MakeCompass('S');
Wait(854 + Random(244));
Makecompass('E');
Wait(674 + Random(367));
MakeCompass('N');
FindNormalRandoms;
end;
end;
end;

procedure ChopTree;
var
x, y: Integer;
begin
repeat
MakeCompass('N');
FindNormalRandoms;
if FindObj(x, y, 'hop', 2575932, 35) then
begin
Writeln('Found Tree...');
Mouse(x, y, 0, 0, False);
Writeln('Cutting Down Tree');
Chooseoption('hop');
end;
repeat
Wait(1200 + Random(250));
AntiBan;
until not IsUpText('illow') or InvFull;
until(InvFull);

if InvFull then
Writeln('Inventory Full.');
Wait(1000 + Random(120));
Writeln('Emptying Inventory...');
SetupSRL;
for I := 2 to 28 do
DropItem(I);
ChopTree;
end else
begin
repeat
MakeCompass('N');
FindNormalRandoms;
if FindObj(x, y, 'hop', 2575932, 35) then
begin
Writeln('Found Tree...');
Mouse(x, y, 0, 0, False);
Writeln('Cutting Down Tree');
Chooseoption('hop');
end;
repeat
Wait(1200 + Random(250));
AntiBan;
until not IsUpText('illow') or InvFull;
until(InvFull);

if InvFull then
Writeln('Inventory Full.');
Wait(1000 + Random(120));
Writeln('Emptying Inventory...');
SetupSRL;
for I := 2 to 28 do
DropItem(I);
ChopTree;
end else
begin
repeat
MakeCompass('N');
FindNormalRandoms;
if FindObj(x, y, 'hop', 2638150, 35) then
begin
Writeln('Found Tree...');
Mouse(x, y, 0, 0, False);
Writeln('Cutting Down Tree');
Chooseoption('hop');
end;
repeat
Wait(1200 + Random(250));
AntiBan;
until not IsUpText('illow') or InvFull;
until(InvFull);

if InvFull then
Writeln('Inventory Full.');
Wait(1000 + Random(120));
Writeln('Emptying Inventory...');
SetupSRL;
for I := 2 to 28 do
DropItem(I);
ChopTree;
end else

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
repeat
ChopTree;
until(AllPlayersInactive);
end.

Coh3n

2009-10-17 14:40:43

Oh I see. The "end" in line 112 represents the end of the procedure, which means it can't have an else after it. You want to put your "end else" here:
procedure ChopTree;
var
x, y: Integer;
begin
repeat
MakeCompass('N');
FindNormalRandoms;
if FindObj(x, y, 'hop', 2575932, 35) then
begin
Writeln('Found Tree...');
Mouse(x, y, 0, 0, False);
Writeln('Cutting Down Tree');
Chooseoption('hop');
end else
begin
// Failsafe code here.
end;

Nava2

2009-10-17 14:48:35

You could use an integer array and some for loops to make your antiban shorter :)

procedure AntiBan;
var
CompassDirections: TIntegerArray;
i: Integer;
begin
if not LoggedIn then Exit;

FindNormalRandoms;
case Random(40) of
0: begin
Writeln('Commencing WoodCutting Skill Check...');
HoverSkill('woodcutting',false);
Wait(2453 + Random(432));
end;

1: begin
Writeln ('Commencing mouse Pick up...');
PickUpMouse;
end;

2..4:
begin
for i := 0 to 2 do
CompassDirection[i] := 90 * Random(4); // Get the angle to make it, 0 = N, 90 = E, etc.
Writeln('Commencing Turns: ' + IntToStr(CompassDirection[0]) + ', ' + IntToStr(CompassDirection[1]) + ', ' + IntToStr(CompassDirection[2]));
for i := 0 to 2 do
begin
MakeCompass(CompassDirection[i]);
Wait(200 + Random(100));
end;
FindNormalRandoms;
end;
end;
end;

Zerghunter3000

2009-10-17 17:37:08

umm, well wuts:

begin
// Failsafe code here.
end;
Failsafe?

Coh3n

2009-10-18 16:17:23

From: Zerghunter3000
umm, well wuts:

begin
// Failsafe code here.
end;
Failsafe?


Failsafes are extra checks just in case your first procedure didn't work. They are needed to make scripts run for hours. For example, if I check for a color using a tolerance of 5, and SCAR doesn't find the color, then I make it check for the same color with a tolerance of 10. The second color check would be a failsafe of the first, understand?

tofurocks

2009-10-19 21:38:17

Cool, I also noticed the Edgeville spot while looking for a place to powerchop on my skiller. Wouldn't it be fairly quick banking as well? Probably a job best left to reflection, regardless.
Looks like a pretty good first script :)

Zerghunter3000

2009-10-23 19:04:31

yea