if im litterally in the middle of no where with no matching colors it will log out after 5 seconds but if it finds a matching color but not the right uptext it wont log out.
find tree function:
function FindTree: Boolean;
var
TPA, TempTPA: TPointArray;
ATPA: Array of TPointArray;
i, x, y, a, b, MinPoints, CTS: Integer;
Colors, Tolerances: TIntegerArray;
HueMods, SatMods: TExtendedArray;
TreePoint, TempPoint: TPoint;
begin
Result:= False;
Status := ('Searching for tree...');
Report;
InvLogs := CountItems('DTM', LogDTM, []);
if ((rs_GetCompassAngleDegrees < 85) or (rs_GetCompassAngleDegrees > 110)) then
MakeCompass(randomrange(85,110));
Colors := [5014947, 4359279];
Tolerances := [15, 20];
HueMods := [0.02, 0.02];
SatMods := [0.57, 0.31];
MinPoints := 15;
CTS:= GetToleranceSpeed;
SetColorToleranceSpeed(2);
for i:= 0 to High(Colors) do
begin
SetToleranceSpeed2Modifiers(Huemods[i], SatMods[i]);
FindColorsTolerance(TempTPA, Colors[i], MSX1, MSY1, MSX2, MSY2, Tolerances[i]);
AppendTPA(TPA, TempTPA);
end;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (High(TPA)> 0) then
begin
ATPA:= SplitTPA(TPA,10);
SortATPASize(ATPA,True);
for i:= 0 to High(ATPA) do
begin
if (High(ATPA[i]) < MinPoints) then
Break;
end;
if (i = 0) then
Exit;
SetArrayLength(ATPA,i);
SortATPAFromFirstPoint(ATPA,Point(MSCX,MSCY));
for i:= Low(ATPA) to Min(High(ATPA),3) do
begin
MiddleTPAEX(ATPA[i],x,y);
TreePoint:= Point(x,y);
MMouse(randomrange(x-5,x+5),randomrange(y-5,y+5),0,0);
if WaitUpTextMulti(['hop','own'],randomrange(150,600)) then
begin
if (IsUpTextMultiCustom(['hop','own'])) then
begin
HumanWait;
HumanMouseClick;
if (DidRedClick) then
begin
Result:= True;
Status:= ('Chopping tree...');
Report;
Exit;
end;
end;
end;
end;
end else
if (TimeFromMark(FindTreeTime) > 5000) then
begin
writeln('Unable to find any trees...');
LogOut;
TerminateScript;
end;
writeln('kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk');
FindTree;
end;
mainloop:
repeat
MarkTime(FindTreeTime);
FindTree;
CheckInv;
until(LogsCut = CutLogs);
private script so im not gonna post the whole code
@The Mayor i can pm it to you if this isnt enough