Log in

View Full Version : Sorry for another post so quick >.<



phrost69
09-26-2012, 11:23 PM
First script for an RSPS and wanted to see how I'd do. The only error is on the very best line I get the error saying "Unexpected end of file". What'd I do wrong ?


program New;
{$i srl/srl.simba}


var
x, y: Integer;


Procedure teleport;
begin;
MoveMouse(572, 360);
Wait(100);
ClickMouse(572, 360, mouse_Left);
Wait(2000);
MoveMouse(301, 430);
Wait(100)
ClickMouse(301, 430, mouse_Left);
end;

procedure ChopTree;
var x, y: integer;
begin
if FindObj(x, y, 'hop', 12056824, 10) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
repeat
Wait(1200+random(250));
Until not IsUpText('ew') or (InvFull);

MoveMouse(570, 285);
Wait(100)
ClickMouse(570,285, mouse_Left);
Wait(4000)
MoveMouse(266, 416)
Wait(100)
ClickMouse(266, 416, mouse_Left);
Wait(6000);
MoveMouse(278, 203);
Wait(100);
ClickMouse(278, 203, mouse_Left);
Wait(3000);
MoveMouse(660, 414);
Wait(100);
ClickMouse(660, 414, mouse_Left);
end;

begin
repeat
teleport;
ChopTree;
until false
end;

Runaway
09-26-2012, 11:33 PM
The end in the main loop has to have a period afterwards instead of a semi-colon:


// incorrect:
begin
repeat
Teleport;
ChopTree;
until false
end;

// correct:
begin
repeat
Teleport;
ChopTree;
until false
end.

Le Jingle
09-26-2012, 11:36 PM
You may have also found the answer to this in your old thread;
http://villavu.com/forum/showpost.php?p=1105307&postcount=3

phrost69
09-26-2012, 11:42 PM
Thanks to both of you! Again sorry for the double post!

phrost69
09-27-2012, 12:04 AM
I ran into another problem. Followed everything ya said but towards the end where I type "var loop, c: integer;" it says an identifier is expected. Not quite sure what that is or how I'd switch it up to work.

Le Jingle
09-27-2012, 12:08 AM
I ran into another problem. Followed everything ya said but towards the end where I type "var loop, c: integer;" it says an identifier is expected. Not quite sure what that is or how I'd switch it up to work.

make sure you remove all of the squiggly brackets, whether they be red or blue, only around the var line/looper. Don't remove the red brackets from the top of the file that has {$i srl/srl.simba} <-- leave as it shows, don't touch srl/srl.simba squiggly brackets.

phrost69
09-27-2012, 12:20 AM
I made sure there were none. It's right on the line that say "var"


begin
var
loop, c: integer;

setupSRL;

loops := 1000;
repeat
teleport;
choptree;
bank;
inc(c);
until(loops = c);
end.


Also saw I put begin at the wrong spot but it didn't help or make the problem worse by switching it.

Runaway
09-27-2012, 12:23 AM
^ Declare the vars outside of the begin/end loop.