is there a way to hold a key down?
i know to do it with mouse, but with a key... nope
is there a way to hold a key down?
i know to do it with mouse, but with a key... nope
We merely play "against the rules". We cheat. Thats what we are good at, thats what we do.
http://www.frement.net/srl/simba_user4.png
procedure HoldMouse(x, y: Integer; Left: Boolean);
Holds mouse button. Set parameter Left to true for left button, false for right.
procedure ReleaseMouse(x, y: Integer; Left: Boolean);
Releases mouse button. Set parameter Left to true for left button, false for right.
Those are from the Scar Manuel.
Sry I read it wrong, Shuttle is right.
procedure KeyDown(Key: Byte);
procedure KeyUp(Key: Byte);
~shut
All my scripts are held on Googlecode git, so if you ever see a problem, fork it and send me a pull request
If a script is grey, it doesn't work, if it's colour then it does!
My Tutorials:-
Everything you need to know about setting up Simba, SRL and Reflection!, How to sort out the MSVCR71.dll error
How to set up players for autoing with Simba, SRL/Simba Standards (with examples), Defines
Auto Updater and Git, Using a testing branch for git, Adding SRL Stats to your script
Creating your own font set for Simba, Guide to Cups, How to make 1.45M (RSGP) a day (not really my tut)
Download a image and set it as your Desktop Wallpaper in C#, How to make your first PHP file uploader
<Coh3n> Shuttleu, fuck I love you right now
got it
We merely play "against the rules". We cheat. Thats what we are good at, thats what we do.
http://www.frement.net/srl/simba_user4.png

you have to do Keydown(GetKey('x'));
and KeyUp(GetKey('x'));
don't you?
i know... but you don't 'have' to use getkeycode, which is what he is saying. plus i was trying to help nielskool understand the function better!
To hold a key down you simply use this:
SCAR Code:procedure HoldKey(key : char; howlong : integer);
begin
KeyDown(GetKeyCode(key));
wait(howlong);
KeyUp(GetKeyCode(key));
end;
No credit needed...
To use it do this
SCAR Code:HoldKey('n', 1000); // 'n' is the key you want to press, 1000 is how long you want it to hold it, in milliseconds
Yeah, I was just making a ready made procedure for him.
There are currently 1 users browsing this thread. (0 members and 1 guests)