Page 1 of 1

Simple script problem - combo keys  Topic is solved

Posted: 24 Jan 2014, 10:46
by Guest
I was wondering if you could tell me why a line of script doesnt work, its pretty simple. I'm trying to make a script to use in a game called smite that i press a key, it sends a string of key responses like V then G then F, etc. But when I try to make binds for combo keys, like Shift+ mouse 4, it will not function properly. Here is what I have:

#IfWinActive, ahk_class LaunchUnrealUWindowsClient ; if smite running

XButton1:: ;Enemies spotted (blank)
Send v
Sleep, 100
Send b
Sleep, 100
Return

XButton2:: ;I'll attack (blank)
Send v
Sleep, 100
Send s
Sleep, 100
Send a
Return

+WheelUp:: ;I'll defend (blank)
Send v
Sleep, 100
Send s
Sleep, 100
Send d
Return

+WheelDown:: ;Ok! + No problem
Send v
Sleep, 200
Send v
Sleep, 200
Send a
Sleep, 500
Send v
Sleep, 200
Send v
Sleep, 200
Send g
Sleep, 200
Send r
Return



The first two work just fine, the second two (for shift + mwheelup or down) do not. I was wondering if you might know why or how I may improve upon this to make it work?

Re: Simple script problem - combo keys

Posted: 31 Jan 2014, 16:04
by MasterFocus
Please use code tags (see the "Code" button) when posting code.

You could try checking if Shift is held down.
Something like this (untested):

Code: Select all

*$WheelDown::
    If !GetKeyState("LShift","P") { ; ignore if left shift is not held down
        Send, {Blind}{WheelDown}
        Return
    }
    MsgBox, % "You just used LShift+WheelDown !!" ; do whatever actions you want here
Return

Re: Simple script problem - combo keys

Posted: 31 Jan 2014, 19:55
by timeFlies
Guests are not permitted to use BBCode, so code tags wouldn't work.