shapeshifting and new skillsets

Ask gaming related questions (AHK v1.1 and older)
badnecros
Posts: 19
Joined: 11 Nov 2016, 17:21

shapeshifting and new skillsets

19 Apr 2017, 12:21

The code listed below is an attempt at making "q" activate a macro, then no activate the macro again until after the ability q is mapped to ends.

Code: Select all

;;Stack Tals/Archon

$q::
	q={q}
	
	;;Cycle Elements
		send, e
		sleep, 200
		send, r
		sleep, 200
	;;Activate Archon
		send, q
		sleep, 200
	;;Activate Slow Time
		send, w
	;;Wait for Spell to end
		sleep, 19800
Return
The idea of "Archon" is that it gives me a new skillset after activating it. it is empowered by the two spells cycled before it, and the one cast after it. so i would like it to cycle through all four spells immediately. HOWEVER, it gives me a new spell mapped to Q, and i would like to utilize that ability during the spell.

any ideas on how to do that?
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Re: shapeshifting and new skillsets

19 Apr 2017, 16:52

I assume you don't want Q to trigger manually until Archon is active. This should work:

Code: Select all

;;Stack Tals/Archon
Toggle := false

#If (!Toggle)
$q::
	;;Cycle Elements
		send, e
		sleep, 200
		send, r
		sleep, 200
	;;Activate Archon
		send, q
		sleep, 200
		Toggle := true
	;;Activate Slow Time
		send, w
	;;Wait for Spell to end
		sleep, 19800
		Toggle := false
Return
Not tested, but that should disable the hotkey after Archon activates, and re-enable it after the long sleep.
badnecros04

Re: shapeshifting and new skillsets

21 Apr 2017, 09:10

MaxAstro wrote:I assume you don't want Q to trigger manually until Archon is active. This should work:

Code: Select all

;;Stack Tals/Archon
Toggle := false

#If (!Toggle)
$q::
	;;Cycle Elements
		send, e
		sleep, 200
		send, r
		sleep, 200
	;;Activate Archon
		send, q
		sleep, 200
		Toggle := true
	;;Activate Slow Time
		send, w
	;;Wait for Spell to end
		sleep, 19800
		Toggle := false
Return
Not tested, but that should disable the hotkey after Archon activates, and re-enable it after the long sleep.
Thanks so much MaxAstro, could you possibly explain the theory behind all of this, and why theory was incorrect? Id like to get to a point where i dont need to ask for help on every script eventually. :P
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

Re: shapeshifting and new skillsets

21 Apr 2017, 12:42

Sure, it's fairly simple. #If allows you to define a hotkey that only works while certain conditions are true. In an expression, the symbol ! mean "not", so the line #If (!Toggle) means "the following hotkey is only active if Toggle is false". Toggle is false by default thanks to the first line of the script, so that means that normally the hotkey is enabled.

Once the script gets to the line Toggle := true, however, the #If statement becomes false. This means that the hotkey is disabled, so pressing "q" does whatever it would normally do in the game instead of triggering the hotkey.

Finally, the last line of the hotkey sets Toggle to false again, and re-enables the hotkey.

Is it working like you wanted in game, or was there a problem with it?

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 122 guests