SRL Archive - OSR Help

Weird error.. wont compile..


Le_don

2013-02-27 13:20:11


program LeDonsKhazardIronDepositor;

{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P07Include.Simba}

procedure MineIron;
var x, y: integer;
begin
repeat
if P07_FindObjCustom (x, y, ['ine', 'Mine'], [1581108, 1910852, 1778233], 5) Then
begin
ClickMouse2(mouse_left);
Wait(RandomRange(400,2000))
// until(P07_InvFull)
end;
begin
MineIron;
end.

[Error] C:\Simba\Scripts\LeDonsKhazardIronDepositor.simba(21:4): Identifier expected at line 20
Compiling failed.

Lol.. probably something extremely simple, but just can't figure it out.

Jake

2013-02-27 13:26:15

http://villavu.com/forum/showthread.php?p=851555

Olly

2013-02-27 13:32:46

the repeat needs a until….

Le_don

2013-02-27 13:35:30

From: Ollybest
the repeat needs a until….


Thank you!

When I un-comment // until(P07_InvFull) I get

'[Error] C:\Simba\Scripts\LeDonsKhazardIronDepositor.simba(16:1): Identifier expected at line 15
Compiling failed.'

I looked at some other similar scripts and couldn't spot a difference.

Olly

2013-02-27 13:48:20


procedure MineIron;
var
x, y: integer;
begin
repeat
if P07_FindObjCustom (x, y, ['ine', 'Mine'], [1581108, 1910852, 1778233], 5) Then
begin
writeln('we found a rock!');
mouse(x,y, randomrange(-5, 5), randomrange(-5, 5), mouse_left);
Wait(RandomRange(400, 2000));
end;
until(P07_InvFull);
end;

begin
MineIron;
end.

you were missing a end and had some in the wrong places, also you weren't moving the mouse just clicking it, i changed it to mouse which does both :)

Le_don

2013-02-27 13:51:00

From: Ollybest

procedure MineIron;
var
x, y: integer;
begin
repeat
if P07_FindObjCustom (x, y, ['ine', 'Mine'], [1581108, 1910852, 1778233], 5) Then
begin
writeln('we found a rock!');
mouse(x,y, randomrange(-5, 5), randomrange(-5, 5), mouse_left);
Wait(RandomRange(400, 2000));
end;
until(P07_InvFull);
end;

begin
MineIron;
end.

you were missing a end and had some in the wrong places, also you weren't moving the mouse just clicking it, i changed it to mouse which does both :)


Thanks a ton!

blockay

2013-02-27 13:53:03

every begin needs an end, every until needs a repeat