SRL Archive - Help

Error


sm321

2012-03-25 11:04:06

I'm currently making a script, and it's already not working. I've got:

program new;

var

counter:integer;

begin

Wait(1000);

end;

procedure Hot;
begin

KeyDown(9);
Wait(20);
KeyUp(9);

end;

begin
repeat
Hot;
Inc(Counter);
Until
Counter >= 9;

end.

but I get this error:

[Error] (12:4): period ('.') expected at line 11
Compiling failed.

begginer

2012-03-25 11:09:11

program new;

var

counter:integer;


procedure Hot;
begin

KeyDown(9);
Wait(20);
KeyUp(9);

end;

begin
wait(1000);
repeat
Hot;
Inc(Counter);
Until
Counter >= 9;
end.



You were using your main loop first!

68z35h9

2012-03-25 11:11:02

Either make this a procedure/function or remove this from the script


begin

Wait(1000);

end;
Wish I could explain why it needs to be a procedure/function but I don't know myself =[

sm321

2012-03-25 11:15:27

From: begginer
program new;

var

counter:integer;


procedure Hot;
begin

KeyDown(9);
Wait(20);
KeyUp(9);

end;

begin
wait(1000);
repeat
Hot;
Inc(Counter);
Until
Counter >= 9;
end.



You were using your main loop first!


Sorry :) Thanks :) I thought it would repeat the

Wait(1000);

but now I look at it it's right :)

From: 68z35h9
Either make this a procedure/function or remove this from the script


begin

Wait(1000);

end;
Wish I could explain why it needs to be a procedure/function but I don't know myself =[


Ok, thanks :)

begginer

2012-03-25 11:22:01

I think a function can be made at the very beginning at the script and can be used on procedure. I think it never tried :)

There a small button to rep me if I have helped you.

sm321

2012-03-25 11:43:12

From: begginer
I think a function can be made at the very beginning at the script and can be used on procedure. I think it never tried :)

There a small button to rep me if I have helped you.


Infact, I think that has sort of answered a question of mine. Can you instead of writing a new

begin
wait(1000);
repeat
until (false);
end;

every single time, make a "shortcut" so that you can just make each procedure do it a different number of times?

Abu

2012-03-25 11:45:20

From: sm321


every single time, make a "shortcut" so that you can just make each procedure do it a different number of times?


Can you expand on that?

You mean make it do the procedure a certain number of times?

sm321

2012-03-25 11:55:41

From: abu_jwka
Can you expand on that?

You mean make it do the procedure a certain number of times?


Say for example you have

program Example;

var

counter:integer;

procedure Example2;
begin

KeyDown(9);
KeyUp(9);

end;



begin
repeat
Example2;
Inc(Counter);
Until
Counter >= 10;

end.


and you wanted to do ALOT of procedures similar to that, are there any shortcuts other than adding


program Example;

var

counter:integer;

procedure Example2;
begin

KeyDown(9);
KeyUp(9);

end;

procedure Example3;
begin

KeyDown(9);
KeyUp(9);

end;

begin
repeat
Example2;
Inc(Counter);
Until
Counter >= 9;

end;

begin
repeat
Example3;
Inc(Counter);
Until
Counter >= 20;

end.

every single time?