Sequenceof keys to trigger action for dota Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mrpopo1992

Sequenceof keys to trigger action for dota

19 Aug 2018, 05:20

Im trying to initiate a set of action on LButton. What i require is:
1. Press and release space
2. if the previous key was space and the current pressed key is LButton, initiate actions
3. if the previous key was space and the current pressed key is NOT LButton, do nothing
Here i want to use space and lbutton one by one(not simultaneously) in same sequence to trigger on lbutton

PS: I tried Input function; works wonderfully with keyboard keys. but doesnt detect mouseclicks;
Tried A_PriorKey; same issue; doesnt detect mouse;
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Sequenceof keys to trigger action for dota  Topic is solved

19 Aug 2018, 18:09

Hi,
2 pieces of advice:
1. register
2. Post your current code.

Probably you might also use:
#InstallMouseHook
https://autohotkey.com/docs/commands/_I ... seHook.htm

P.S.
To be honest I didn't really understand your aim.
Since I'm the only one who replied, the others might have problems understanding it as well.
Maybe you can try to describe it a bit more clearly.

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
mrpopo1992
Posts: 10
Joined: 20 Aug 2018, 05:24

Re: Sequenceof keys to trigger action for dota

20 Aug 2018, 05:51

ok. let me explain. its for dota.my hero is legion commander.
enemy hero has linken sphere. so what i have to do is
1. break linken sphere with some item in my inventory
2. initiate my ultimate(duel) on the hero
both actions have to be done quickly

i want it such that when i press "r" and then release key and then press click on that hero i want both the above actions to occur on that hero.

Please note- the key "r" and Lbutton are not pressed together but rather in sequence, i.e., first, press and release "r"; when i click on enemy hero, if previous key was "r" then initiate the above actions.

I wrote a program; but here while pressing the key "r", my cursor has to hover over the hero;
again i want it such that the above actions occur on single lbutton ( provided the previous pressed key was "r")


#InstallKeybdHook
#InstallMouseHook
#UseHook
SendMode Event

$r::
SetKeyDelay 20,100
Send {v}; this key selects an item in my inventory to break linken sphere
Click; this applies the above item on the enemy hero i click
Send {r}; this key is the default key to initiate ultimate/duel on enemy hero
Click; this initiates duel on the enemy hero i click
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, rc76, uchihito and 364 guests