Log in

View Full Version : Script wont chop down tree again



zluo
04-18-2012, 11:28 PM
I have made myself a script and it is able to chop down a tree and firemake on the spot for a Runescape Private Server. However it only chops down the tree once and then stops. I have no idea what I am doing wrong. Help me out please.
program WCandFM;
{$i SRL/SRL.simba}

var
x,y:Integer;

const
TreeColour = 22664;
TreeColourTolerance = 3;
StumpColour = 4489384;
StumpColourTolerance = 10;
TreeX1 = 0
TreeY1 = 0
TreeX2 = 515
TreeY2 = 337


procedure AntiBan;
begin
Case Random (20) of
1: Begin SleepAndMoveMouse(5000 + Random(750)); End;
2: Begin RandomRClick; End;
3: Begin PickUpMouse; End;
4: Begin MissMouse(100,100); End;
5: Begin RandomRClick; End;
6: Begin PickUpMouse; End;
7: Begin RandomMovement; End;
8: Begin BoredHuman; End;
9: Begin RandomRClick; End;
End;
end;

procedure ChopTree;
begin
repeat
if FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance) then //finds tree and chops it down
begin
writeln('Found tree and chopping it down.');
Mouse (x ,y ,0 , 0, True);
end;
repeat
Wait(RandomRange(1000, 2000));
AntiBan;
Until (FindColorSpiralTolerance(x, y, StumpColour, TreeX1, TreeY1, TreeX2, TreeY2, StumpColourTolerance) or (FindColorSpiralTolerance (x, y, 3029313, 653, 438, 669, 449, 20)) = False) //detects stump or inventory full so it can chop down the tree again, however it doesnt
until not(FindColorSpiralTolerance(x, y, 3029313, 653, 438, 669, 449, 20)); //detects full inventory
Writeln('Full inventory, starting to firemake.');
end;

Procedure Firemake;
begin
repeat
Mouse(706, 444, 10, 10, True);
wait (200+Random(100));
Mouse(663, 444, 10, 10, True);
wait (1600+Random(100));
until (FindColorSpiralTolerance (x, y, 3029313, 653, 438, 669, 449, 20));
Writeln('Finished lighting all the logs, finding tree.');
end;

procedure main;
begin
repeat
ChopTree;
Firemake;
until(false);
end;

begin
ClearDebug;
SetUpSrl;
ActivateClient;
main;
end.

Google
04-18-2012, 11:31 PM
begin
ClearDebug;
SetUpSrl;
ActivateClient;
Repeat
main;
Until(False)
end.

Sorry that was right -.- try that.

NKN
04-19-2012, 01:32 AM
Don't use
Until(False)
Turn False to AllPlayersInactive
And for this line,
until not(FindColorSpiralTolerance(x, y, 3029313, 653, 438, 669, 449, 20)); //detects full inventory

How does that detect logs in inventory, wouldn't it be better to do:

Until(InvCount = 28);

It's detecting the full inventory early, so it's saying it's done, I think.
Add a repeat look at the end, by the way.

nickrules
04-19-2012, 02:05 AM
wouldn't it be better to do:

Until(InvCount = 28);

or just until(invfull)

But this was (likely) your problem. Or an infinite loop (hadn't actually checked for that :P). Use more writeln()s to help find errors!

zluo
04-19-2012, 02:19 AM
i think the problem is actually that it doesnt detect the stump and so it does not go forth with the script. however it can detect full inventory and it will start the firemaking procedure. is there a reason that it WONT detect the stump?

Bobby Boo
04-19-2012, 02:44 AM
why do you need antiban in a private server?

zluo
04-19-2012, 03:08 AM
why do you need antiban in a private server?

practise :D and you can never be too sure

zluo
04-19-2012, 04:12 AM
oh and guys i cant use (invfull) ive already tried it, so i have to do something like
until (findcolourtolerance..(empty inventory colour)) = false

NKN
04-20-2012, 04:04 PM
Zulo, you're inventory has to be open for InvFull to work.

Try InvFull or InvCount = 28