Jump to content

Using AutoIt for Street Fighter


lucky
 Share

Recommended Posts

ooh that's a good thought.

i didnt think of that, but i guess knowing which emulator he is using would be extremely helpful.

...helpful to a fellow gamer maybe :-) :-)

lucky,

You mentioned in another post that you thought it might be looping or sending the keys within the function more than once. Let's make sure that you are only sending one letter for now:

For $i = 10 To 1 Step - 1
    TrayTip("", "The letter s will be sent in " & $i, 1)
    Sleep(1000)
Next

Send("s")
Start your game and then this little test script... watch the AutoIt icon in the system tray (if that is even visible when the emulator is on).

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Using MAME and Super Street Fighter 2 Turbo (the best version of SF :) ), the below would spit out a fireball more often than not. The timings seem REALLY hard to nail down, though, and this isn't perfect. I could see timings on one machine not working on another, because of emulation speed that can vary between machines. Maybe there's a fps throttle or something that would help. Anyway, maybe this will send you in the right direction.

(Just using default keys... arrows to move, and space is punch.)

HotKeySet('{F5}', 'fireball')
HotKeySet('{esc}', 'quit')

While 1
    Sleep(10)
WEnd

Func fireball()
    Send('{down down}')  ;hold down arrow
    Sleep(35)
    Send('{right down}')  ;hold right arrow
    Sleep(25)
    Send('{down up}')  ;release down arrow
    Sleep(35)
    Send('{space}')  ;punch btn
    Sleep(25)
    Send('{right up}')  ;release right arrow
EndFunc

Func quit()
    Exit
EndFunc
Edited by xcal
Link to comment
Share on other sites

Using MAME and Super Street Fighter 2 Turbo (the best version of SF :) ), the below would spit out a fireball more often than not. The timings seem REALLY hard to nail down, though, and this isn't perfect. I could see timings on one machine not working on another, because of emulation speed that can vary between machines. Maybe there's a fps throttle or something that would help. Anyway, maybe this will send you in the right direction.

(Just using default keys... arrows to move, and space is punch.)

HotKeySet('{F5}', 'fireball')
HotKeySet('{esc}', 'quit')

While 1
    Sleep(10)
WEnd

Func fireball()
    Send('{down down}')  ;hold down arrow
    Sleep(35)
    Send('{right down}')  ;hold right arrow
    Sleep(25)
    Send('{down up}')  ;release down arrow
    Sleep(35)
    Send('{space}')  ;punch btn
    Sleep(25)
    Send('{right up}')  ;release right arrow
EndFunc

Func quit()
    Exit
EndFunc
Brilliant, i completely forgot that the moves had to be legato!

Good implementation, very ingenious.

{= )

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Link to comment
Share on other sites

To anybody interested in the final code:

HotKeySet('e', 'RHado'); Hadoken to the right
HotKeySet('z', 'RTatsu'); Tatsumaki Senpuu Kyaku to the right
HotKeySet('f', 'RShoryu'); Sho Ryu Ken to the right
HotKeySet('q', 'LHado'); Hadoken to the left
HotKeySet('x', 'LTatsu'); Tatsumaki Senpuu Kyaku to the left
HotKeySet('r', 'LShoryu'); Sho Ryu Ken to the left
While 1
    Sleep(100)
WEnd

Func RHado()
    Send('{s down}') ;hold down
    Sleep(10)
    Send('{d down}') ;hold right
    Sleep(10)
    Send('{s up}') ;release down
    Sleep(10)
    Send('{NUMPAD6}') ;fierce punch
    Send('{d up}') ;release right
EndFunc; Hadoken to the right

Func RTatsu()
    Send('{s down}') ;hold down
    Sleep(10)
    Send('{a down}') ;hold right
    Sleep(10)
    Send('{s up}') ;release down
    Sleep(10)
    Send('{NUMPAD3}') ;roundhouse kick
    Send('{a up}') ;release right
EndFunc; Tatsumaki to the right

Func RShoryu()
    Send('{d down}') ;hold right
    Sleep(10)
    Send('{s down}') ;hold down
    Sleep(10)
    Send('{d up}') ;hold right
    Sleep(10)
    Send('{d down}') ;release down
    Sleep(10)
    Send('{s up}') ;hold down
    Sleep(10)
    Send('{NUMPAD6}') ;fierce punch
    Send('{d up}') ;release right
EndFunc; Shoryu to the right

Func LHado()
    Send('{s down}') ;hold down
    Sleep(10)
    Send('{a down}') ;hold right
    Sleep(10)
    Send('{s up}') ;release down
    Sleep(10)
    Send('{NUMPAD6}') ;fierce punch
    Send('{a up}') ;release right
EndFunc; Hadoken to the left

Func LTatsu()
    Send('{s down}') ;hold down
    Sleep(10)
    Send('{d down}') ;hold right
    Sleep(10)
    Send('{s up}') ;release down
    Sleep(10)
    Send('{NUMPAD3}') ;roundhouse kick
    Send('{d up}') ;release right
EndFunc; Tatsumaki to the left

Func LShoryu()
    Send('{a down}') ;hold right
    Sleep(10)
    Send('{s down}') ;hold down
    Sleep(10)
    Send('{a up}') ;hold right
    Sleep(10)
    Send('{a down}') ;release down
    Sleep(10)
    Send('{s up}') ;hold down
    Sleep(10)
    Send('{NUMPAD6}') ;fierce punch
    Send('{a up}') ;release right
EndFunc; Shoryu to the left
Link to comment
Share on other sites

  • 7 years later...
  • Moderators

bhns,

Please read the Forum rules (there is also a link at bottom right of each page) - things have changed a lot since this thread was last active over 7 years ago - necroposts over that sort of period are strongly discouraged, especially when they revive threads which are illegal nowadays. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...