SRL Archive - OSR Help

Need help with "Or" Statements


h4x0rdafuq

2012-10-03 18:15:57

Hi, i posted this in one of my other threads in the replies but as it no longer has to do with stump detection i am making a new thread.
So basically i want to add a double until statement but one has to be an or so this is a part of my script so far:

 procedure ChopTree;
begin
repeat
if FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance) then
begin
writeln('Found Magic Tree.');
Mouse (x ,y ,0 , 0, True);
end;
repeat
until not(FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance))
writeln('Waiting for tree');
wait(3000);
until not(FindColorSpiralTolerance(x, y, 3029313, 715, 450, 725, 460, 20));
Writeln('Full inventory, Going to bank.');
end;
This basically finds the color of a magic tree's white sparkly bits (back in 2006 graphics) this then clicks the tree ONCE until it can no longer find the color of the magic tree. It waits 3000ms until it checks for it again. If the inventory is full AND the tree is down, the script will continue on to banking.

So my problem is… If i am the only person botting, and i have a full inventory… I cannot continue to bank until the tree has fallen down… so it will keep clicking the tree because it see's the color but it will never fall down because of the current inventory is full and cannot continue to woodcut.

Basically at the part where it says "until not" find the color of the tree, there also needs to be an inventory check..

I tried adding
       or (FindColorSpiralTolerance (x, y, 3029313, 715, 450, 725, 460, 20)) = False)
so that it will continue to bank after the inventory is full EVEN IF the tree is not fallen and will look like this.

procedure ChopTree;
begin
repeat
if FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance) then
begin
writeln('Found Magic Tree.');
Mouse (x ,y ,0 , 0, True);
end;
repeat
until not(FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance))
or (FindColorSpiralTolerance (x, y, 3029313, 715, 450, 725, 460, 20)) = False) //added this or but is broken
writeln('Waiting for tree');
wait(3000);
until not(FindColorSpiralTolerance(x, y, 3029313, 715, 450, 725, 460, 20));
Writeln('Full inventory, Going to bank.');
end;

only problem is, i cannot get the "or" statement to work :/ i get the error:

[Error] (28:85): Identifier expected at line 27
Compiling failed.
which is at the line where the or statement is. Please could you tell me what i am missing out here. Thank you

Lalaji

2012-10-03 19:19:07


procedure ChopTree;
begin
if not(FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance)) then
begin //did not find the tree.
repeat
writeln('waiting for tree.');
wait(3000);//this loop will wait for the tree to respawn
until(FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance);// found the tree. breaks the loop.
end else // found the TreecColor.
begin
writeln('Found Magic Tree.');
Mouse (x ,y ,0 , 0, True); //found the tree and will click it
exit;
end;
end;
end;

//this is the main loop now...
begin
repeat
ChopTree;
//you will need to add a mechanism to wait while chopping tree
// or else it will spam click the tree.
until (InvFull); //will repeat until the inv is full
//banking procedure will go here.

Try that. Did I miss any details?
Post here if you run into some more problems.

Getdropped

2012-10-03 22:52:09

From: Lalaji

procedure ChopTree;
begin
if not(FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance)) then
begin //did not find the tree.
repeat
writeln('waiting for tree.');
wait(3000);//this loop will wait for the tree to respawn
until(FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance);// found the tree. breaks the loop.
end else // found the TreecColor.
begin
writeln('Found Magic Tree.');
Mouse (x ,y ,0 , 0, True); //found the tree and will click it
exit;
end;
end;
end;

//this is the main loop now...
begin
repeat
ChopTree;
//you will need to add a mechanism to wait while chopping tree
// or else it will spam click the tree.
until (InvFull); //will repeat until the inv is full
//banking procedure will go here.

Try that. Did I miss any details?
Post here if you run into some more problems.


You should most likely add antiban in the wait for tree loop so you don't logout also the mouse function in theory should also be right after the first until so it won't repeat trying to find when it already found it once but it would still function the way you have it