View Full Version : [Error] (1:1): Syntax error at line 0
cynicz
06-28-2012, 11:36 PM
ok my script is as follow and i keep getting the error "[Error] (1:1): Syntax error at line 0"
script is for soulsplit so dont mention about randomness and using smart etc :P
program SSAIO;
var
X, Y, count: Integer;
const
Command = ''; // Check Commands above
procedure MainLoop;
begin
case Lowercase(Command) of
'buybolts':
begin
repeat
MoveMouse(238, 269); //Buys Rune Bolts
Wait(100);
ClickMouse(238, 269, mouse_right);
Wait(100);
MoveMouse(267, 298);
ClickMouse(280, 298, mouse_left);
Wait(100);
IncEx(count, 10); // Prints Log
WriteLn('Bolts: ' + IntToStr(count));
until (IsKeyDown(114)); //pres F3 to stop
end;
'makebolts':
begin
repeat
MoveMouse(573, 232); // Attachs Bolt Tips
Wait(75);
ClickMouse(573, 232, mouse_right);
Wait(75);
MoveMouse(586, 259);
ClickMouse(586, 259, mouse_left);
Wait(75);
MoveMouse(622, 219);
Wait(75);
ClickMouse(622, 219, mouse_right);
Wait(75);
MoveMouse(613, 248);
ClickMouse(613, 248, mouse_left);
Wait(75);
IncEx(count, 15); // Prints Log
WriteLn('Bolts Made: ' + IntToStr(count));
until (IsKeyDown(114));
end;
stuartroad
06-28-2012, 11:51 PM
no "end." at the end.
need another "end;" in the main loop
I believe cases also need an end? someone confirm this?
cynicz
06-28-2012, 11:59 PM
added another end now i get
[Error] (1:1): Unexpected end of file at line 0
no "end." at the end.
need another "end;" in the main loop
I believe cases also need an end? someone confirm this?
The very last end in your entire script should be the end of your mainloop. (the bit where the script repeats through all of your procedures and actually does what you told it earlier).
That final end needs to be end. unlike all your others which need to be end;
EDIT: copied the part of your script that needed editing. Look at the very bottom of your script for the lines I edited.
For every begin in a procedure/function you need an end;
you also cannot use a procedure by itself as your mainloop you need to use the scripts mainloop. Which needs to finish off with an end.
procedure MainLoop;
begin
case Lowercase(Command) of
'buybolts':
begin
repeat
MoveMouse(238, 269); //Buys Rune Bolts
Wait(100);
ClickMouse(238, 269, mouse_right);
Wait(100);
MoveMouse(267, 298);
ClickMouse(280, 298, mouse_left);
Wait(100);
IncEx(count, 10); // Prints Log
WriteLn('Bolts: ' + IntToStr(count));
until (IsKeyDown(114)); //pres F3 to stop
end;
'makebolts':
begin
repeat
MoveMouse(573, 232); // Attachs Bolt Tips
Wait(75);
ClickMouse(573, 232, mouse_right);
Wait(75);
MoveMouse(586, 259);
ClickMouse(586, 259, mouse_left);
Wait(75);
MoveMouse(622, 219);
Wait(75);
ClickMouse(622, 219, mouse_right);
Wait(75);
MoveMouse(613, 248);
ClickMouse(613, 248, mouse_left);
Wait(75);
IncEx(count, 15); // Prints Log
WriteLn('Bolts Made: ' + IntToStr(count));
until (IsKeyDown(114));
end;
end; // Need an end; for every case
end; // Need an end; for every begin
begin // Need to put what your script actually needs to do
end. // Between this begin and end. Maybe just call your MainLoop; procedure
Ok first of all yes it is the end. that is missing but if you want the program to actually do something you have to call it in the main loop (not procedure MainLoop!). So here's the solution:
program SSAIO;
var
* X, Y, count: Integer;
const
Command* *= ''; // Check Commands above
procedure MainLoop;
begin
case Lowercase(Command) of
'buybolts':
begin
repeat
MoveMouse(238, 269); //Buys Rune Bolts
Wait(100);
ClickMouse(238, 269, mouse_right);
Wait(100);
MoveMouse(267, 298);
ClickMouse(280, 298, mouse_left);
Wait(100);
IncEx(count, 10); // Prints Log
WriteLn('Bolts: ' + IntToStr(count));
until (IsKeyDown(114)); //pres F3 to stop
end;
'makebolts':
begin
repeat
MoveMouse(573, 232); // Attachs Bolt Tips
Wait(75);
ClickMouse(573, 232, mouse_right);
Wait(75);
MoveMouse(586, 259);
ClickMouse(586, 259, mouse_left);
Wait(75);
MoveMouse(622, 219);
Wait(75);
ClickMouse(622, 219, mouse_right);
Wait(75);
MoveMouse(613, 248);
ClickMouse(613, 248, mouse_left);
Wait(75);
IncEx(count, 15); // Prints Log
WriteLn('Bolts Made: ' + IntToStr(count));
until (IsKeyDown(114));
end;
end;
begin
Mainloop;
end.
My standards aren't perfect as I'm on phone ATM. But this is the basic principle.
Hope it helped.
-Crit
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.