
Originally Posted by
nickrules
Add more debuging to your picking functions and mainloop. See if you can figure out where something is going wrong.
Here is what I did to check whats going wrong:
Code:
program New1;
{$i srl/srl.simba}
{$i sps/sps.simba}
//{$DEFINE SMART}
//{$IFDEF SMART}
//{$i srl/srl/misc/paintsmart.simba}
//{$ENDIF}
Procedure DeclarePlayers;
begin
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;
Players[0].Name:='';
Players[0].Pass:='';
Players[0].Active:=True;
end;
function InvFull22: Boolean //Copy-Paste from the srl folder
begin
Result := (InvCount = 28);
end;
procedure PickBanana;
Var
x, y : Integer;
TPA : TPointArray;
I : Integer;
begin
if not FindColorsSpiralTolerance(MSCX,MSCY,TPA, 1503736, MSX1, MSY1, MSX2, MSY2, 100) then
begin
Writeln('didnt find a color');
Exit;
end;
for I := 0 to High(TPA) do
begin
x := TPA[I].x;
y := TPA[I].y;
MMouse(x, y, 3, 3);
wait(300);
if IsUpText('ick') then
begin
Wait(100 + Random(150));
GetMousePos(x, y);
wait(200);
Mouse(x, y, 1, 1, True);
Wait(500 + Random(250));
Break;
end;
end;
end;
procedure MainLoop;
begin
repeat
Writeln(' find a color');
PickBanana;
Writeln('didnt find a color1');
until (InvFull22);
Writeln('didnt find a color2');
end;
begin
//{$IFDEF SMART}
// Smart_Server := 0;
// Smart_Members := True;
// Smart_Signed := True;
// Smart_SuperDetail := False;
//{$ENDIF}
SetUpSRL();
ActivateClient();
DeclarePlayers();
LoginPlayer();
repeat
Wait(1000)
until(RsReady());
MainLoop;
end.
And here is the result in the debug after running the code:
Code:
Compiled successfully in 734 ms.
SRL Compiled in 0 msec
Current player: xxx
find a color
didnt find a color1
Successfully executed.
The meaning is that it runs only one time and doesn't make the loop.
But I don't know why. 
edit: It works in SMART but not in the brwoser