SRL Archive - OSR Help

SaveTheGoldFish script help


Timba

2012-03-25 00:47:21

Hi. I'm having trouble fixing a script I made (along with YoHo's tutorials, thanks btw) for a game called Save The Gold Fish:

program SaveTheGoldfish;

procedure StartGame;
begin
MoveMouse(238, 356);
ClickMouse(238, 356, 1);
Wait(400);
MoveMouse(381, 326);
ClickMouse(381, 326, 1);
Wait(200);
MoveMouse(345, 155);
ClickMouse(345, 155, 1);
end;

procedure SaveGoldfish;
var
x, y:Integer;
begin
if FindColorSpiralTolerance(x, y, 1471228 , 21, 25, 264, 224, 20) or
if FindColorSpiralTolerance(x, y, 1204732 , 21, 25, 264, 224, 20) or
if FindColorSpiralTolerance(x, y, 1003517 , 21, 25, 264, 224, 20) or
if FindColorSpiralTolerance(x, y, 869629 , 21, 25, 264, 224, 20) or then
Begin
MoveMouseMouse(x, y);
HoldMouse(x, y, 1);
MoveMouse(1111,521):
ReleaseMouse(1111, 521);
end;
end;

begin
StartGame;
repeat
SaveTheGoldfish;
until(false);
end.



But at line 20 (if FindColorSpiralTolerance(x, y, 1204732 , 21, 25, 264, 224, 20) or)

I get

[Error] (21:5): Syntax error at line 20
Compiling failed.

Can anyone tell me whats wrong?

riwu

2012-03-25 01:24:30

U dont need the "if" again after "or" and before "then":
if FindColorSpiralTolerance(x, y, 1471228 , 21, 25, 264, 224, 20) or
FindColorSpiralTolerance(x, y, 1204732 , 21, 25, 264, 224, 20) or
FindColorSpiralTolerance(x, y, 1003517 , 21, 25, 264, 224, 20) or
FindColorSpiralTolerance(x, y, 869629 , 21, 25, 264, 224, 20) then
also ur MoveMouseMouse(x, y); has a repeated typo,
and ur line26 has a ":" instead of ";",
and u need to specify ur clicktype for ReleaseMouse,
and ur "SaveTheGoldfish;" in the mainloop is not consistent with ur procedure name.
Scripting takes time and patience, script carefully and slowly as a start to avoid these errors.

also
a script I made

if iirc this is from yohojo's tutorial, pls credit him and NEVER claim some1's work as ur own, even if its a super simple script. Plagiarism is strictly prohibited here.

Glad that u r trying to learn though (unlike most other leechers)

Timba

2012-03-25 01:53:51

Thanks so much man I got it running, I also credited YoHoJo since I did take this from his vid, sorry about that.

:D