Procedure FindTree(SomeLetters : String; TreeColor, TreeTol, StumpColor, StumpTol : Integer);
What this procedure does is looks for the tree, if its found then it sais tree found, if its not found, it sais that tree is not found.
Note that this works perfectly only if there is ONE tree of the same type on the runescape screen.This could be for example used at varrock north-east yew since there are no more trees than the one yew there.
Here is the procedure.
SCAR Code:
Procedure FindTree(SomeLetters : String; TreeColor, TreeTol, StumpColor, StumpTol : Integer);
{FindTree('illo', 21313973, 10, 5847397, 5);}
Var
TX, TY : Integer;
SX, SY : Integer;
Found : Boolean;
Begin
If(FindObj(TX, TY, SomeLetters, TreeColor, TreeTol))And(Not(FindObj(SX, SY, 'tump', StumpColor, StumpTol)))Then
Begin
MMouse(TX, TY, 15, 15);
If(IsUpText(SomeLetters))Then
WriteLn('Tree Found.');
Found := True;
End Else
Begin
If(Not(FindObj(TX, TY, SomeLetters, TreeColor, TreeTol)))And(FindObj(SX, SY, 'tump', StumpColor, StumpTol))Then
WriteLn('Tree Not Found.');
Found := False;
End;
End;
Here is how to use the procedure.
SCAR Code:
Program Testing;
{.Include SRL/SRL.Scar}
Procedure FindTree(SomeLetters : String; TreeColor, TreeTol, StumpColor, StumpTol : Integer);
{FindTree('illo', 21313973, 10, 5847397, 5);}
Var
TX, TY : Integer;
SX, SY : Integer;
Found : Boolean;
Begin
If(FindObj(TX, TY, SomeLetters, TreeColor, TreeTol))And(Not(FindObj(SX, SY, 'tump', StumpColor, StumpTol)))Then
Begin
MMouse(TX, TY, 15, 15);
If(IsUpText(SomeLetters))Then
WriteLn('Tree Found.');
Found := True;
End Else
Begin
If(Not(FindObj(TX, TY, SomeLetters, TreeColor, TreeTol)))And(FindObj(SX, SY, 'tump', StumpColor, StumpTol))Then
WriteLn('Tree Not Found.');
Found := False;
End;
End;
Begin
SetUpSRL;
Begin
FindTree('illo', 21313973, 10, 5847397, 5);
End;
End.
Well i hope you liked it, please post comments and such. IF YOU CLAIM THIS AS YOUR OWN I PROMISE YOU, I WILL GET Y O U BANNED.