Autofire of multiple keys (Modifing script)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
cataflexia
Posts: 30
Joined: 26 Nov 2016, 17:02

Autofire of multiple keys (Modifing script)

27 Aug 2017, 10:28

Hi guys,

I have a problem to modify a autofire script to implement it for Street Fighter IV.

Theres a scrit that work flawessly with one key, in this case, the space key. Here's the script:

Code: Select all

#NoEnv
#SingleInstance force
SendMode Input

ScriptActive = 1

FixAmount = 0.00000000000000000001


RecoilFix(amount)
{
DllCall("keybd_event",uint,1,int,x,int,amount,uint ,0,int,0)
}


IfWinActive, Call of Duty 4
{
~space::
If ScriptActive = 1
{
RecoilFix(FixAmount)
Loop
{
GetKeyState, state, space, P
if state=U
break
Sendinput {space down}
Sleep 35
Sendinput {space up}
Sleep 35
RecoilFix(FixAmount)
}
}
return


;Pauses AutoHotKey Script.

~F6::
If ScriptActive = 1
{
ScriptActive = 0
SoundBeep, 400, 400
}
else if ScriptActive = 0
{
ScriptActive = 1
SoundBeep, 1000, 100
SoundBeep, 1000, 100
}
return


~NumpadAdd::
++FixAmount
SoundBeep, 700, 100
SoundBeep, 700, 100
clipboard = %FixAmount%
return


~NumpadSub::
--FixAmount
SoundBeep, 700, 100
clipboard = %FixAmount%
return

~NumpadDiv::
FixAmount-=0.1
SoundBeep, 600, 100
clipboard = %FixAmount%
return

~NumpadMult::
FixAmount+=0.1
SoundBeep, 600, 100
SoundBeep, 600, 100
clipboard = %FixAmount%
return
}

;M9 = FixAmount 1
;G3 = FixAmount 0.700000
But I want to add 6 keys more instead of only one key (t, y, u, g, h, j)

t=jab punch
y=strong punch
u=fierce punch
g=short kick
h=forward kick
j=roundhouse kick

The problem is that when I add a key the script show me a error (attached in this post):

The modified part is from this:

Code: Select all

IfWinActive, Call of Duty 4
{
~space::
If ScriptActive = 1
{
RecoilFix(FixAmount)
Loop
{
GetKeyState, state, space, P
if state=U
break
Sendinput {space down}
Sleep 25
Sendinput {space up}
Sleep 25
RecoilFix(FixAmount)
}
}
return
to this (example of T and Y keys for the moment):

Code: Select all

IfWinActive, Call of Duty 4
{
~t::
~y::
If ScriptActive = 1
{
RecoilFix(FixAmount)
Loop
{
GetKeyState, state, t, P
if state=U
break
Sendinput {t down}
Sleep 25
Sendinput {t up}
Sleep 25
RecoilFix(FixAmount)
}
{
GetKeyState, state, y, P
if state=U
break
Sendinput {y down}
Sleep 25
Sendinput {y up}
Sleep 25
RecoilFix(FixAmount)
}
}
return
What I'm doing wrong?

Please halp! :(
Attachments
2017-08-27.png
2017-08-27.png (32.71 KiB) Viewed 326 times

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen and 320 guests