basically, i want the script to switch back to/send 1 after using any of these keys
e::send 2
c::send 0
z::send 5
x::send 6
like the script is waiting for Lbutton (left click) to happen after one of these keys were pressed
it's for a game I play to make it switch back to 1 on the Hotbar after using a skill
so i dont have to equip 1 over and over after each skill use
oh and also set a wait time so if the mouseclick does not happen in the time set then the script wont act on it
and if another key other than those is pressed (like 1 or any other key except e,c,z,x) then have the script cancel this action
also set a delay after mouseclick for when 1 should be sent
i'll tweak it depending on if i want a delay or not
im Bad at explanations but i hope the message was received!
Sending a key after mouseclick
Re: Sending a key after mouseclick
Hallo,
perhaps?:
perhaps?:
Code: Select all
#InstallKeybdHook
e::
c::
z::
x::
Send,% {e:2,c:0,z:5,x:6}[A_ThisHotkey]
Time := A_TickCount + 2000 ;2 seconds
; delay after mouseclick for when 1 should be sent
Return
#IF (A_TickCount < Time)
~LButton::
Time = 0
IF !InStr("eczx", A_PriorKey)
Return
KeyWait, LButton
Sleep, 100
Send, 1
Return
#IF