View Full Version : Error
sm321
03-25-2012, 03:04 PM
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
03-25-2012, 03:09 PM
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
03-25-2012, 03:11 PM
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
03-25-2012, 03:15 PM
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 :)
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
03-25-2012, 03:22 PM
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
03-25-2012, 03:43 PM
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?
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
03-25-2012, 03:55 PM
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?
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.