SRL Archive - Help

Sorry for another post so quick >.<


phrost69

2012-09-26 19:23:18

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

2012-09-26 19:33:43

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

2012-09-26 19:36:07

You may have also found the answer to this in your old thread;
http://villavu.com/forum/showpost.php?p=1105307&postcount=3

phrost69

2012-09-26 19:42:40

Thanks to both of you! Again sorry for the double post!

phrost69

2012-09-26 20:04:33

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

2012-09-26 20:08:54

From: phrost69
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

2012-09-26 20:20:31

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©;
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

2012-09-26 20:23:20

^ Declare the vars outside of the begin/end loop.