SRL Archive - Help

IsKeyDown


sm321

2012-03-01 11:21:44

I have made a simple auto-typer, and want to add start/stop shortcuts. I know you need IsKeyDown but I don't know how to put that into use. I would like F1 to start, and F2 to stop. I can also post the script I have at the moment if that would help? Thankyou.

Brandon

2012-03-01 11:22:55



If IsKeyDown(08) then
writeln('you pressed backspace')
else
if IsFKeyDown(124) then
writeln('You pressed F12?');

//http://docs.villavu.com/simba/scriptref/mouseandkeyboard.html#keyboard-virtual-keys

sm321

2012-03-01 11:34:42

From: ggzz


If IsKeyDown(08) then
writeln('you pressed backspace')
else
if IsFKeyDown(124) then
writeln('You pressed F12?');

//http://docs.villavu.com/simba/scriptref/mouseandkeyboard.html#keyboard-virtual-keys


Thanks for the reply. I've got this script at the moment. I am completely stumped:

program AutoTpyer;

procedure Typing;
begin

SendKeys('Your Text Here', 1);
KeyDown(13);
KeyUp(13);
Wait(2500);
end;

begin
repeat
Typing;
for i:= 0 to 19 do
begin
Wait(100);
if IsKeyDown(F1KeyCode) then terminateScript;
end;
until(false);

I get this error:

[Error] (16:7): Unknown identifier 'i' at line 15
Compiling failed.

Brandon

2012-03-01 12:04:39

U didn't declare I :S


program AutoTpyer;

procedure Typing;
begin

SendKeys('Your Text Here', 1);
KeyDown(13);
KeyUp(13);
Wait(2500);
end;

var
I: Integer;
F1KeyCode: word;//or whatever type u named it.
begin
repeat
Typing;
for i:= 0 to 19 do
begin
Wait(100);
if IsKeyDown(F1KeyCode) then
terminateScript;
end;
until(false);
end.

LordJashin

2012-03-01 15:34:44

From: sm321
I have made a simple auto-typer, and want to add start/stop shortcuts. I know you need IsKeyDown but I don't know how to put that into use. I would like F1 to start, and F2 to stop. I can also post the script I have at the moment if that would help? Thankyou.


Autotyper for what? You just doing this to learn Simba coding, or do you really want this? I know an application that can do typing/mouse/window switching/etc for you. It works extremely well. If you want it PM me for it and I can link you to it. You can setup hotkeys for anything with it.

sm321

2012-03-02 02:44:02

From: LordJashin
Autotyper for what? You just doing this to learn Simba coding, or do you really want this?


I'm just learning some things before I move onto RuneScape bots.

From: LordJashin
I know an application that can do typing/mouse/window switching/etc for you. It works extremely well. If you want it PM me for it and I can link you to it. You can setup hotkeys for anything with it.


I'm ok, thankyou anyway.

sm321

2012-03-02 02:47:29

From: LordJashin
Autotyper for what? You just doing this to learn Simba coding, or do you really want this?


I'm just learning some things before I move onto RuneScape bots.

From: LordJashin
I know an application that can do typing/mouse/window switching/etc for you. It works extremely well. If you want it PM me for it and I can link you to it. You can setup hotkeys for anything with it.


I'm ok, thankyou anyway.

From: ggzz
U didn't declare I :S


program AutoTpyer;

procedure Typing;
begin

SendKeys('Your Text Here', 1);
KeyDown(13);
KeyUp(13);
Wait(2500);
end;

var
I: Integer;
F1KeyCode: word;//or whatever type u named it.
begin
repeat
Typing;
for i:= 0 to 19 do
begin
Wait(100);
if IsKeyDown(F1KeyCode) then
terminateScript;
end;
until(false);
end.


What do I put here:

F1KeyCode: word;//or whatever type u named it.

Do I put the name of the procedure?