Jump to content
Purplehazekid

how do i auto click buttons like backspace or the F keys?

Recommended Posts

procedure SendKeys(s: string);

Simulate key pressing to send a string to the active window.

 

procedure TypeKeys(s: string);

Simulate key pressing to send a string to the active window in a very human-like way.

 

procedure SendKeysWait(Text: string; tWait, tRandom: Integer);

Similates key pressing in a humanlike way by defining the waiting time in ms between each key (tWait) and the randomly added wait (tRandom).

 

procedure SendKeysSilent(S: string);

Send string to Client's window, if this doesn't work, use SendKeys.

 

procedure SendArrow(Key: Byte);

Sends arrow to Client's window. For a, 0 = up, 1 = right, 2 = down, 3 = left.

 

procedure SendArrowWait(Key: Byte; WaitTime: Integer);

Sends an arrow to Client's window like SendArrow and holds it for a given wait time.

Example:

SendArrowSilentWait(1, 10); // Holds "Right" arrow for 10 milliseconds.

 

procedure SendArrowSilent(a: Byte);

Sends arrow to Client's window. For a, 0 = up, 1 = right, 2 = down, 3 = left.

 

procedure SendArrowSilentWait(a: Byte; WaitTime: Integer)

Sends an arrow to Client's window like SendArrowSilent and holds it for a given wait time.

Example:

SendArrowSilentWait(1, 10); // Holds "Right" arrow for 10 milliseconds.

 

procedure SendKeysVB(S: string; Wait: Boolean);

Sends the keys analogically to Visual Basic SendKeys command. Wait parameter specifies if SCAR should wait for the command to complete.

 

procedure KeyDown(Key: Byte);

Simulates pushing a key.

 

procedure KeyUp(Key: Byte);

Simulates releasing a key.

 

procedure KeyDownSilent(Key: Byte);

Simulates pushing a key in silent mode.

 

procedure KeyUpSilent(Key: Byte);

Simulates releasing a key in silent mode.

 

function GetKeyCode(Key: Char): Byte;

Get keyboard code of a character.

 

function IsMouseButtonDown(LeftButton: Boolean): Boolean;

If LeftButton is true, then it checks if the left mouse button is down.

If LeftButton is false, checks if the right mouse button is down.

 

function IsFunctionKeyDown(Key: Byte): Boolean;

Checks if the given function key is down.

Meanings of Key:

0: SHIFT

1: CONTROL

2: ALT

3: LEFT SHIFT

4: LEFT CONTROL

5: LEFT ALT

6: RIGHT SHIFT

7: RIGHT CONTROL

8: RIGHT ALT

 

function IsFKeyDown(Num: Byte): Boolean;

Num = 1..12. Checks if F1, F2, ... F11 or F12 key is down corresponding to Num.

 

function IsArrowDown(Num: Byte): Boolean;

Checks if arrow key is down. Num corresponds to 0 = up, 1 = right, 2 = down, 3 = left.

 

function IsKeyDown(C: Char): Boolean;

Checks if the given key is down.

Example:

if(IsKeyDown('a'))then

Writeln('You have pressed "a". Congratulations!');

 

function IsNumpadKeyDown(Key: Byte): Boolean;

Checks if the entered numpad key is down (you just enter a digit).

 

functionIsNumpadEnabled: Boolean;

Returns True if the numpad is enabled.

 

function IsCapsLockEnabled: Boolean;

Returns True if caps lock is turned on.

 

there is a list of functions procedures and definitions from the old scar manual 99% of these should still work =)

 

So to answer your question, an example of see if an F key is down it looks like this;

Procedure CheckFKeys; // call this procedure where ever in your script you want to check if F7 is pressed. (it has to be higher in the script than where you are calling it!
Begin
if (IsFKeyDown(7)) then // Checks to see if F7 is down
  Writeln('F7 Was Pressed') // Writesln to debug box
  // You could call TerminateScript; here if you wanted to add some function to it(Shuts down script);
  else                                // if F7 wasnt pressed 
   Writeln('F7 Has not been pressed yet'); // Writes in debug box 
end;

Edited by shadowrecon
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...