Sign in to follow this  
Followers 0
dgarrett8

Hotkey Issue

3 posts in this topic

Ok, so, what I plan on doing it something extremely easy...but I'm having the most difficult time doing this. I just want to press the button R and make it basically substitute for 'D'.

I have this basketball game for my computer and the shoot button is 'D' right? The R button is unused fyi. 'R' would be replacing 'D' but would be delayed .4 seconds. (I wonder if this makes any sense to you) I understand autoit a bit. But this is just stumping me. Shouldn't this take me like 5-10 minutes to make? Maybe even less...


"I think, therefore I am"[size="1"]René Descartes[/size]

Share this post


Link to post
Share on other sites



I just fixed-up the demo at the bottom of the HotKeySet() help page

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("r", "ShowMe")  

;;;; Body of program would go here ;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMe()
    Send("D")
EndFunc

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

I just fixed-up the demo at the bottom of the HotKeySet() help page

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("r", "ShowMe")  

;;;; Body of program would go here ;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMe()
    Send("D")
EndFunc

8)

ty :). wouldn't i do Sleep(400) after the Send("D") for the shot to take longer?

also, i would be able to press r as many times as i want to send D, correct?

thank you for replying so quickly


"I think, therefore I am"[size="1"]René Descartes[/size]

Share this post


Link to post
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
Sign in to follow this  
Followers 0