Simple script problem - combo keys Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Guest

Simple script problem - combo keys  Topic is solved

24 Jan 2014, 10:46

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?
User avatar
MasterFocus
Posts: 146
Joined: 01 Oct 2013, 09:47
Location: Rio de Janeiro - RJ - Brasil
Contact:

Re: Simple script problem - combo keys

31 Jan 2014, 16:04

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
Antonio França - git.io | github.com | ahk4.net | sites.google.com
Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.
Need help? Please post on the forum before sending me a PM.
timeFlies
Posts: 146
Joined: 22 Oct 2013, 20:54
Location: Somewhere in the northern hemisphere.

Re: Simple script problem - combo keys

31 Jan 2014, 19:55

Guests are not permitted to use BBCode, so code tags wouldn't work.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Shoobis, slowwd and 110 guests