SRL Archive - Help

Semicolon expeted


sm321

2012-02-24 06:01:02

I have this script so far, from YoHoJo's Scripting Tutorial #1

program SaveTheGoldfish;

procedure StartGame;
begin
MoveMouse(239, 364);
ClickMouse(239, 364, 1);
Wait(700);
MoveMouse(398,324);
ClickMouse(398, 324, 1);
Wait(700);
MoveMouse(352, 160);
ClickMouse(352, 160, 1);
End;

procedure SaveGoldfish;
var
x, y:Integer;
begin
If FindColorSpiralTolerance(x, y, 1271548, 798, 596, 530, 470, 20) or
FindColorSpiralTolerance(x, y, 1137660, 798, 596, 530, 470, 20) or
FindColorSpiralTolerance(x, y, 869629, 798, 596, 530, 470, 20) or
FindColorSpiralTolerance(x, y, 1869629, 1798, 596, 530, 470, 20) Then
begin
MoveMouse(x, y);
HoldMouse(x, y, 1)
MoveMouse(639, 292);
ReleaseMouse(639, 292, 1)
End;
end

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

And I'm getting this message "[Error] (32:1): Semicolon (';') expected at line 31
Compiling failed." and I have absolutely no idea why.

masterBB

2012-02-24 06:02:41

program SaveTheGoldfish;

procedure StartGame;
begin
MoveMouse(239, 364);
ClickMouse(239, 364, 1);
Wait(700);
MoveMouse(398,324);
ClickMouse(398, 324, 1);
Wait(700);
MoveMouse(352, 160);
ClickMouse(352, 160, 1);
End;

procedure SaveGoldfish;
var
x, y:Integer;
begin
If FindColorSpiralTolerance(x, y, 1271548, 798, 596, 530, 470, 20) or
FindColorSpiralTolerance(x, y, 1137660, 798, 596, 530, 470, 20) or
FindColorSpiralTolerance(x, y, 869629, 798, 596, 530, 470, 20) or
FindColorSpiralTolerance(x, y, 1869629, 1798, 596, 530, 470, 20) Then
begin
MoveMouse(x, y);
HoldMouse(x, y, 1)
MoveMouse(639, 292);
ReleaseMouse(639, 292, 1)
End;
end; //added ;

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

Flight

2012-02-24 06:04:03


program SaveTheGoldfish;

procedure StartGame;
begin
MoveMouse(239, 364);
ClickMouse(239, 364, 1);
Wait(700);
MoveMouse(398,324);
ClickMouse(398, 324, 1);
Wait(700);
MoveMouse(352, 160);
ClickMouse(352, 160, 1);
End;

procedure SaveGoldfish;
var
x, y:Integer;
begin
If FindColorSpiralTolerance(x, y, 1271548, 798, 596, 530, 470, 20) or
FindColorSpiralTolerance(x, y, 1137660, 798, 596, 530, 470, 20) or
FindColorSpiralTolerance(x, y, 869629, 798, 596, 530, 470, 20) or
FindColorSpiralTolerance(x, y, 1869629, 1798, 596, 530, 470, 20) Then
begin
MoveMouse(x, y);
HoldMouse(x, y, 1);
MoveMouse(639, 292);
ReleaseMouse(639, 292, 1);
end;
end;

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

Edit:
I got :ninja:'d… :(

VillaVuFTW

2012-02-24 06:04:20

I could be wrong.. but if you look at Save Goldfish.. there are 2 End;'s try making another one.. it might just work for you :3

Or the 2nd end doesn't have a semicolon try that too :3

sm321

2012-02-24 06:07:00

From: VillaVuFTW
I could be wrong.. but if you look at Save Goldfish.. there are 2 End;'s try making another one.. it might just work for you :3

Or the 2nd end doesn't have a semicolon try that too :3


Yes! It's worked. Thankyou :)

masterBB

2012-02-24 06:07:13

lol, you guys are so slow. On another note: You should swap the coordinates of the color find functions. Start with the high ones like this:

 FindColorSpiralTolerance(x, y, 1271548, 530, 470, 798, 596, 20) or

instead of:

 FindColorSpiralTolerance(x, y, 1271548, 798, 596, 530, 470, 20) or

sm321

2012-02-24 06:08:02

Another problem.

"Error: Exception: You passed wrong values to a finder function: xs > xe (798,530). at line 19"

masterBB

2012-02-24 06:08:28

Already answered it above: you're to slow :P

sm321

2012-02-24 06:09:04

From: masterBB
lol, you guys are so slow. On another note: You should swap the coordinates of the color find functions. Start with the high ones like this:

 FindColorSpiralTolerance(x, y, 1271548, 530, 470, 798, 596, 20) or

instead of:

 FindColorSpiralTolerance(x, y, 1271548, 798, 596, 530, 470, 20) or


I'll give that a go now. I've got this again "Compiled successfully in 31 ms.
Error: Exception: Out of memory at line 19". It compiled fine, and then that message came up. Here's the code I have now:

program SaveTheGoldfish;

procedure StartGame;
begin
MoveMouse(239, 364);
ClickMouse(239, 364, 1);
Wait(700);
MoveMouse(398,324);
ClickMouse(398, 324, 1);
Wait(700);
MoveMouse(352, 160);
ClickMouse(352, 160, 1);
End;

procedure SaveGoldfish;
var
x, y:Integer;
begin
If FindColorSpiralTolerance(x, y, 1271548, 530, 470, 798, 596, 20) or
FindColorSpiralTolerance(x, y, 1137660, 530, 470, 798, 596, 20) or
FindColorSpiralTolerance(x, y, 869629, 530, 470, 798, 596, 20) or
FindColorSpiralTolerance(x, y, 1869629, 530, 470, 798, 596, 20) Then
begin
MoveMouse(x, y);
HoldMouse(x, y, 1)
MoveMouse(639, 292);
ReleaseMouse(639, 292, 1)
End
end;

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

masterBB

2012-02-24 06:19:06

I don't get that error, it compiles fine here…

sm321

2012-02-24 06:22:11

From: masterBB
I don't get that error, it compiles fine here…


It compiled, but when it actually played, it said that.

EDIT: I needed to put the cross-hair on the box. Although, it loads at the start, and doesn't actually pick up the fish? "Compiled successfully in 31 ms.
Error: Exception: You passed a wrong xe to a finder function: 798. The client has a width of 480, thus the xe is out of bounds. at line 19". Got that error too. Sorry about this :)

budbud2oo7

2012-02-26 15:18:41

I get the same error, dont know what to do, im a total newbie at this

sm321

2012-02-27 03:51:56

From: budbud2oo7
I get the same error, dont know what to do, im a total newbie at this


I re-did the script and it works now :) Were you watching his tutorial too? Because I have the working script if you want it :)