Jump to content

How do i simulate holding down numpad4 and right cursor?


Galdorf
 Share

Recommended Posts

How do i simulate holding down numpad4 and right cursor key ~~~

Look here:

http://www.autoitscript.com/autoit3/docs/functions/Send.htm

Post whatever code you come up with after reading that page and then people can help you with the loop and maybe the memory part of your quest.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

$i = 0

Global $Paused

HotKeySet("`", "TogglePause")

HotKeySet("{DEL}", "Terminate")

Sleep (2000)

While $i <= 2

Send ("{RIGHT down NUMPAD4 down}")

Sleep (500)

$i = $i + 1

WEnd

Func TogglePause( )

$Paused = NOT $Paused

While $Paused

sleep(100)

ToolTip('Script is "Paused"',0,0)

WEnd

ToolTip("")

EndFunc

Func Terminate( )

Exit 0

EndFunc

not sure if this is right does not seem to work? need to simulate holding both keys down at same time forever.

Edited by Galdorf
Link to comment
Share on other sites

This looks like it is for a game. Be aware that some games block automation - so this may not work.

Global $Paused
HotKeySet("`", "TogglePause")
HotKeySet("{DEL}", "Terminate")

While 1
    Send("{RIGHT down}")
    Send("{NUMPAD4 down}")
    Sleep(500)
WEnd

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
    Sleep(100)
    ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc ;==>TogglePause

Func Terminate()
    Exit 0
EndFunc ;==>Terminate

Func OnAutoItExit()
    Send("{RIGHT up}")
    Send("{NUMPAD4 up}")
EndFunc

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...