Well im trying to cut a Yew tree but it keeps clicking it, why?
Also any other coments on the code would be nice
SCAR Code:
program new;
{.include SRL/SRL.scar}
Var Debug,Info:Boolean;
Procedure WriteDebug(Text:String);
Begin
If Debug Then
writeln(Text);
End;
Procedure WriteInfo(Text:String);
Begin
If Info Then
writeln(Text);
End;
//Kill = cut
//Find = is there?
Function Tree(what:string):Boolean;
Var Colour,Toll,x,y:Integer;
Begin
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.04,0.51);
Colour := 3832169 //For ease of use
Toll := 27 // ^^^^^^^^^^^^
Result := False
If FindColorSpiralTolerance(x,y,Colour,MSX1,MSY1,MSX2,MSY2,Toll) Then
Case What Of
'Kill':
Begin
MMouse(x,y,10,10);
Wait(250+Random(750));
If IsUpText('ew') Then
Begin
GetMousePos(x,y);
Result := True
If Random(45) = 12 Then
Begin
Mouse(x,y,0,0,True);
Wait(250+Random(1500));
ChooseOption('ut');
End Else
Mouse(x,y,0,0,True);
End;
End;
'Find': Result := True
End;
End;
Procedure TreeMaster;
Var I,B:Integer;
Begin
WriteDebug('Starting Tree Master');
MarkTime(B);
Repeat
If InvFull Then
Exit;
Tree('Kill')
If Tree('Find') Then
WriteDebug('Function Tree(find) is True, Must be still cutting, Going in to Loop for 10 mins Max!');
MarkTime(I);
Repeat // While cutting loop
If InvFull Then
Begin
WriteInfo('Inv is full');
Exit;
End;
If Not Tree('Find') Then
Begin
WriteDebug('Tree(find) is false, Tree is gone going to wait for new one');
WriteInfo('Tree is gone');
Break;
End;
I := TimeFromMark(I);
If (I >= 6000000) Then
WriteDebug('10 mins past, cant be cutting tree ending loop');
Until (I >= 6000000)
MarkTime(I);
Repeat //Looking loop
If Tree('Find') Then
Begin
WriteDebug('Found tree, exiting LOOP');
Break;
End;
If Not Tree('Find') Then
Wait(500+Random(700));
I := TimeFromMark(I);
If (I >= 6000000) Then
Begin
WriteDebug('Its been 10 mins looking for tree exiting');
Exit;
End;
Until(False)
B := TimeFromMark(B);
Until(B >= 54000000);
WriteDebug('Its been half an hour ending now');
End;
begin
SetupSRL;
Debug := True
Info := True
ActivateClient;
Wait(750);
Treemaster;
end.
thanks