I have a script here that is supposed to cut and drop yews. However, I am having a problem where the program will click one yew, then it will start clicking the inventory tab. I'm not sure what is going on. I have everything up to date. Also, IsUpText doesn't seem to be working for me.
SCAR Code:
program New;
{.include SRL/SRL.scar}
const
German = False;
var
MoreColors: TIntegerArray;
procedure DeclarePlayers;
begin
CurrentPlayer := 0;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := ''; //username
Players[0].Pass := ''; //Password
Players[0].Nick := ''; //3-4 letters of user name
Players[0].Active := True; //Player active
end;
procedure SetupColors;
begin
MoreColors := [3239009, 2384725, 467995, 1258284, 5212029, 2583904];
SetupSRL;
ActivateClient;
DeclarePlayers;
Wait(1000+random(200));
if not LoggedIn then LoginPlayer;
end;
function MMouseIsText(x, y, ranx, rany: integer; UpText:string): boolean;
begin
if not LoggedIn then Exit;
MMouse(x, y, ranx, rany);
Wait(50+random(11));
if German then
Result := IsUpText('au')
else
Result := IsUpTextMultiCustom(['ew', 'Ye', 'Yew']);
end;
function ReturnYew: TPoint;
var
MorePoints: TPointArray;
ATPA: T2DPointArray;
t, m, w, cu, time: integer;
APoint: TPoint;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(2);
MarkTime(time);
m := High(MoreColors);
for t:=0 to m do
begin
if FindColorsSpiralTolerance(MSCX, MSCY, MorePoints, MoreColors[t], MSX1, MSY1, MSX2, MSY2, 15) then
Break;
end;
ATPA := SplitTPA(MorePoints, 15);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
cu := High(ATPA);
for w:=0 to cu do
begin
Result := MiddleTPA(ATPA[0]);
Writeln('Time: '+ IntToStr(TimeFromMark(time)));
Writeln('Done');
ColorToleranceSpeed(1);
Exit;
end;
end;
procedure Cut;
var ThePoint: TPoint;
begin
repeat
if not LoggedIn then Exit;
MakeCompass('N');
ThePoint := ReturnYew;
Mouse(ThePoint.x, ThePoint.y, 6, 6, true);
Wait(4000+random(900));
until(InvFull);
end;
procedure Drop;
begin
DropAllExcept([1]);
end;
procedure MainLoop;
begin
Cut;
Drop;
end;
begin
SetupColors;
MainLoop;
end.
Thanks