SRL Archive - OSR Help

YoHoJo's Beginner Scripting help


mrderpable1

2013-02-24 11:52:36

I have followed his guide and looked carefully at my script but I cant see what i've done wrong. It is for his SaveTheGoldFish

Here's what Ive got so far,


My error message is "Exception: Range check error at line 20"

Thanks in advance

Gucci

2013-02-24 11:56:06

Can you post the code in simba tags

mrderpable1

2013-02-24 11:56:51

Sorry first time, ill do it now

DannyRS

2013-02-24 11:57:19

your script compiled ok for me? does it error when run?

program SaveTheFish;

procedure StartGame;
begin
MoveMouse(319, 654);
ClickMouse(319, 654, 1);
Wait(1500);
MoveMouse(477, 627);
ClickMouse(477, 627, 1);
Wait(500);
MoveMouse(426, 453);
ClickMouse(426, 453, 1);
End;


Procedure SaveGoldFish;
var
x, y:Integer;
begin
If FindColorSpiralTolerance(x, y, 172287 , 97, 256, 337, 430, (20)) or
FindColorSpiralTolerance(x, y, 556031 , 97, 256, 337, 430, 20) or
FindColorSpiralTolerance(x, y, 1204732 , 97, 256, 337, 430, 20) or
FindColorSpiralTolerance(x, y, 416254 , 97, 256, 337, 430, 20) or
FindColorSpiralTolerance(x, y, 75960 , 97, 256, 337, 430, 20) Then
Begin
MoveMouse(x, y);
HoldMouse(x, y, 1);
MoveMouse(448, 271);
ReleaseMouse(448, 271, 1);
end;
end;

begin
StartGame;
Repeat
SaveGoldfish;
until(false);
end.

mrderpable1

2013-02-24 11:59:22

It doesn't even run the first few steps, It just compiles then gives me an error on line 20.

P.S. How do I post my script like that?

DannyRS

2013-02-24 12:02:47

try this script (srl extension in Simba must be enabled):


program SaveTheFish;

{$I SRL/SRL.Simba}

procedure StartGame;
begin
MMouse(319, 654,0,0);
ClickMouse2(mouse_left);
Wait(1500);
MMouse(477, 627,0,0);
ClickMouse2(mouse_left);
Wait(500);
MMouse(426, 453,0,0);
ClickMouse2(mouse_left);
End;


Procedure SaveGoldFish;
var
x, y:Integer;
begin
If FindColorSpiralTolerance(x, y, 172287 , 97, 256, 337, 430, (20)) or
FindColorSpiralTolerance(x, y, 556031 , 97, 256, 337, 430, 20) or
FindColorSpiralTolerance(x, y, 1204732 , 97, 256, 337, 430, 20) or
FindColorSpiralTolerance(x, y, 416254 , 97, 256, 337, 430, 20) or
FindColorSpiralTolerance(x, y, 75960 , 97, 256, 337, 430, 20) Then
Begin
MMouse(x, y,0,0);
HoldMouse(x, y, 1);
MMouse(448, 271,0,0);
ReleaseMouse(448, 271, 1);
end;
end;

begin
SetupSRL;
StartGame;
Repeat
SaveGoldfish;
until(false);
end.

mrderpable1

2013-02-24 12:06:42

That looks like it will work, I just need to adjust my client coordinates. What did you change?