View Full Version : Semicolon expeted
sm321
02-24-2012, 11:01 AM
I have this script so far, from YoHoJo's Scripting Tutorial #1 (http://www.youtube.com/watch?v=pMMejhyjGwI)
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
02-24-2012, 11:02 AM
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
02-24-2012, 11:04 AM
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
02-24-2012, 11:04 AM
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
02-24-2012, 11:07 AM
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
02-24-2012, 11:07 AM
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
02-24-2012, 11:08 AM
Another problem.
"Error: Exception: You passed wrong values to a finder function: xs > xe (798,530). at line 19"
masterBB
02-24-2012, 11:08 AM
Already answered it above: you're to slow :P
sm321
02-24-2012, 11:09 AM
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
02-24-2012, 11:19 AM
I don't get that error, it compiles fine here...
sm321
02-24-2012, 11:22 AM
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
02-26-2012, 08:18 PM
I get the same error, dont know what to do, im a total newbie at this
sm321
02-27-2012, 08:51 AM
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 :)
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.