PC Players: Enhancing Training Mode using macro programs

you rule mrdhalsim

Yes there is one against Ryu. check the thread in the main forum linked in first post above. If you want a specific one, just tell me.

I can’t get the scripts to work. Keeps saying Mk is an uncallable function or some error like that :frowning:

There are two files, common.ahk and the main script.

common.ahk is where commonly used/called functions go, and it’s most likely where you’ll find the MK() function

I have common.ahk as well as the normal script. However maybe I’m not using it right? I have common.ahk in the same folder as the script and I just run the script right?

I dunno how to use autohotkey right.

in fact you just install it. and then you don’t have to launch anything.
You previously have copy pasted the script from the thread to text files using Notepad, one called “common” that you’ll rename to common.ahk (instead of common.txt) and the other one call it whatever you want with the ahk extension. To launch a script just double click it. Autohotkey icon will show in tray bar near the clock and other running app.
If you have this error message I assume you installed it properly. Be sure to copy paste exactly what is written in the code.

And be sure to use the right “common” file. For each post I modified the common file’s function so its not working with other scipt in other posts, you should always use the script + common that is in the same post.

I left the files laying in the My Document folder, seems the default folder. both files should be in the same place.

Ok well the script works but it doesn’t do anything…I put the dummy on human, put the controls as what I have on the keyboard. I’m also using the keyboard though so do I need another controller or something for this to work? The Autoit script in the first post worked swimmingly.

well it was scripted to use with a stick. But you can edit the scripts to change those trigger keys.
It’s normal if the dummy don’t do anything, you have to initiate the loop by pushing L1 button (after you have set the side using arrow keys of course).

For you this :
2joy5::
do_the_setup()
return

Should be modified to

“whatever key you want”::
do_the_setup()
return

Example :
g::
do_the_setup()
return

Autohotkey is above Autoit only because it recognize fightstick inputs and that make it possible for the dummy to punish your moves. If you’re not using stick, this make less sense of course ^^.

Buy a stick ?

Anyway there is your training course for anti air demon inside a fireball war session.



; Ryu : cr.MK xx HP fireball Footsies training, try to Sweep his whiffed kicks
#include common.ahk
 
MIN_WALK_FRAMES := 5
MAX_WALK_FRAMES := 20
 
Fireball_War()
{
  Global
  Random, Guess, 0, 10
  if(Guess > 3)
  QC_X(forward, HP)
  else
  QC_X(forward, "EXP")
  Wait(20)
}
 
do_the_setup()
{
Global
Run := "go"
  While(Run = "go")
  {
    Random, Guess, 0, 30
  ; Walk forward a random amount of time
    Random howLong, MIN_WALK_FRAMES, MAX_WALK_FRAMES
    Walk(forward, howLong)
    Walk(backward, 5)
 
  ; Randomly throw fireballs
    if (Guess > 8) {
        Fireball_War()
    }
    else
    {
    Jump(forward)
    Wait(15)
    push(HK)
    Wait(4)
    release(HK)
    Wait(4)
    push(UP)
    Wait(30)
    release(UP)
    Wait(30)
    Dash(backward)
    Wait(14)
    Jump(backward)
    Wait(20)
    }
 
  ; Walk backward roughly the same distance, but modify
  ; the time because Ryu's backward speed is slower
  ; than his forward speed
    howLong += 20
    Walk(backward, howLong)
  }
}
 
 
 
; Set Ruy's punish if we whiff a sweep
2joy8::
  Wait(12)
  Sweep()
  return
 
 
; controls for Cancel and side selection
2joy5::
  do_the_setup()
  return
 
2joy9::
  Run := "stop"
  return
 
LEFT::
  forward := LEFT
  backward := RIGHT
  return
 
RIGHT::
  forward := RIGHT
  backward := LEFT
  return


common.ahk file



#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
SetKeyDelay 12 ; Not sure about usefullness
SendMode Input ; Not sure about usefullness
 
ONE_FRAME_IN_MS = 16.67
LEFT    := "q"
RIGHT  := "d"
UP    := "z"
DOWN    := "s"
LP      := "i"
MP      := "o"
HP      := "p"
LK      := "k"
MK      := "l"
HK      := "m"
 
 
Switch_side() ; instantly switch the value of LEFT and RIGHT so the dummy do the moves on the right side. Usefull when your setup involve a cross up.
{
  Global
  if(forward = RIGHT)
  {
    forward := LEFT
    backward := RIGHT
  }
  else
  {
    forward := RIGHT
    backward := LEFT
  }
}
Wait(frames)
{
  Global
  Letimer := frames * ONE_FRAME_IN_MS
  Sleep, %Letimer%
}
 
push(button)
{
  Global
  Send {%button% down}
}
release(button)
{
  Global
  Send {%button% up}
}
 
Walk(direction, howLong)
{
  Global
  push(direction)
  Wait(howLong)
  release(direction)
  Wait(2)
}
 
Dash(direction)
{
  Global
  push(direction)
  Wait(2)
  release(direction)
  Wait(2)
  push(direction)
  Wait(2)
  release(direction)
  Wait(6)
}
FADC(direction)
{
  Global
  push(MP)
  push(MK)
  push(direction)
  Wait(3)
  release(direction)
  Wait(2)
  push(direction)
  Wait(3)
  release(direction)
  release(MP)
  release(MK)
}
QC_X(direction, hit) ; hit = "LP", "MP", "HK", etc. for ex , use "EXP" or "EXK"
{
  Global
  push(DOWN)
  Wait(2)
  push(direction)
  Wait(2)
  release(DOWN)
  Wait(2)
  if(hit = "EXP")
  {
  push(LP)
    push(MP)
  }
  else if(hit = "EXK")
{
  push(LK)
    push(MK)
  }
  else
  {
  push(hit)
  }
  Wait(2)
  release(direction)
  if(hit = "EXP")
  {
  release(LP)
    release(MP)
  }
  else if(hit = "EXK")
{
  release(LK)
    release(MK)
  }
  else
  {
  release(hit)
  }
  Wait(6)
}
Jump(direction)
{
  Global
  if(direction = "neutral")
  {
    push(UP)
    Wait(2)
    release(UP)
    Wait(2)
  }
  else
  {
    push(direction)
    push(UP)
    Wait(6)
    release(direction)
    release(UP)
    Wait(2)
  }
}
Throw(direction)
{
  Global
  push(direction)
  push(LK)
  push(LP)
  Wait(5)
  release(direction)
  release(LK)
  release(LP)
  Wait(2)
}
Cr_MK()
{
  Global
  push(backward)
  push(DOWN)
  push(MK)
  Wait(2)
  release(MK)
  release(backward)
  release(DOWN)
}
Sweep() ; this sweep is plinked by default
{
  Global
  push(backward)
  push(DOWN)
  Wait(2)
  push(HK)
  Wait(1)
  push(MK)
  Wait(2)
  release(MK)
  release(HK)
  release(backward)
  release(DOWN)
}
Cr_MK_xx_Fireball(direction, punch)
{
  Global
  push(DOWN)
  push(MK)
  Wait(2)
  push(direction)
  Wait(2)
  release(DOWN)
  release(MK)
  Wait(2)
  push(punch)
  release(direction)
  Wait(4)
  release(punch)
  Wait(2)
}
SRK(direction, punch) ; works for any shoryu motion with punches or kicks : "EXP" to do an ex with punches, "EXK" for ex kicks, "LP", "MP", "HK", etc, for normals.
{
  Global
  push(direction)
  Wait(4)
  release(direction)
  push(DOWN)
  Wait(2)
  push(direction)
  Wait(2)
  if(punch = "EXP")
  {
    push(LP)
    push(MP)
  }
  else if(punch = "EXK")
  {
    push(LK)
    push(MK)
  }
  else
  {
    push(punch)
  }
  release(direction)
  release(DOWN)
  Wait(2)
  if(punch = "EXP")
  {
    release(LP)
    release(MP)
  }
  else if(punch = "EXK")
  {
    release(LK)
    release(MK)
  }
  else
  {
    release(punch)
  }
  Wait(2)
}
Teleport(direction, punch) ; punch = "punch" or "kick" to do the specified teleport.
{
  Global
  push(direction)
  Wait(4)
  release(direction)
  push(DOWN)
  Wait(2)
  push(direction)
  Wait(2)
  if(punch = "kick")
  {
    push(LK)
    push(MK)
    push(HK)
  }
  else
  {
    push(LP)
    push(MP)
    push(HP)
  }
  release(direction)
  release(DOWN)
  Wait(2)
  if(punch = "kick")
  {
    release(LK)
    release(MK)
    release(HK)
  }
  else
  {
    release(LP)
    release(MP)
    release(HP)
  }
  Wait(2)
}
ULTRA_2X_QC_PPP(direction) ; clean double quarter circle ultra, don't use it for kara ultra like those involving super jump cancels.
{
  Global
  push(DOWN)
  Wait(2)
  push(direction)
  Wait(2)
  release(DOWN)
  Wait(2)
  release(direction)
  Wait(2)
  push(DOWN)
  Wait(2)
  push(direction)
  Wait(2)
  release(DOWN)
  Wait(2)
  release(direction)
  push(LP)
  push(MP)
  push(HP)
  Wait(4)
  release(LP)
  release(MP)
  release(HP)
  Wait(6)
}
 
HC_forward(punch) ; "EXP" for ex punch, "EXK" for ex kick, "LP", "MP", "HK", etc for normals
{
  Global
  push(backward)
  push(DOWN)
  Wait(2)
  release(backward)
  Wait(2)
  push(forward)
  Wait(2)
  release(DOWN)
  Wait(2)
  release(forward)
  if(punch = "EXP")
  {
    push(LP)
    push(MP)
  }
  else if(punch = "EXK")
  {
    push(LK)
    push(MK)
  }
  else
  {
    push(punch)
  }
  Wait(2)
  if(punch = "EXP")
  {
    release(LP)
    release(MP)
  }
  else if(punch = "EXK")
  {
    release(LK)
    release(MK)
  }
  else
  {
    release(punch)
  }
  Wait(2)
}
 
HC_backward(punch) ; "EXP" for ex punch, "EXK" for ex kick, "LP", "MP", "HK", etc for normal
{
  Global
  push(forward)
  push(DOWN)
  Wait(2)
  release(forward)
  Wait(2)
  push(backward)
  Wait(2)
  release(DOWN)
  Wait(2)
  release(backward)
  if(punch = "EXP")
  {
    push(LP)
    push(MP)
  }
  else if(punch = "EXK")
  {
    push(LK)
    push(MK)
  }
  else
  {
    push(punch)
  }
  Wait(2)
  if(punch = "EXP")
  {
    release(LP)
    release(MP)
  }
  Wait(2)
  if(punch = "EXK")
  {
    release(LK)
    release(MK)
  }
  else
  {
    release(punch)
  }
  Wait(2)
}


Question, so 2joyx can be changed to any key? I’m not sure what key to change 2joy5 to for example. Is it my movement keys or the dummies?

Also what’s the L1 key?

yes 2joyX mean joystick n°2 (because on my Windows 7 it’s recognized as the n°2 although there’s no n°1…
and JoyX X is the button. 1 2 3 4 5 6 7 8 9 10 for a 8 buttons stick + select start

The key you are trying to modify do not interfere with the setup. You won’t use the same keys you use on your game options. Choose a completely different key un-used. It’s just a trigger to start the session.
You could even use Fx keys or a combinaison of Ctrl + key etc but this is documented in the Autohotkey Help I’m not a specialist.You can set it to be DOWN arrow key. The LEFT and RIGHT arrow keys are already set to modify orientation of the setups while you’re in the loop.
DOWN::
do_the_setup()
return

Oh hmm, ok so I set the joy buttons to 3 keys I don’t use at all right (your above script has 3 buttons to change I believe). So I went into training and just pushed those keys to start the session but the dummy did some random crap and then just stopped.

Yep pretty much. look at the script in the Akuma forum.
One of those 3 keys is a STOP the loop key. so if the loop stop it’s normal :slight_smile: you only need after launching the script and the game, enter in training room or any VS session, set the opponent to use the good keyboard keys and then :

  1. set the side (left or right arrow)
  2. start the setup
    I think you may want to use 2 keyboards because if you inputs keys at the same time the opponent do, it will not works as intended.

Ok I saw your post on the Akuma forums. So I set the first button to the sweep of the dummy and the other 2 to random buttons to start and stop.

Ok so the dummy works now, he throws fireballs and stuff. But he doesn’t punish my whiffed sweep. He also doesn’t do cr.mk xx fireball and I’m not sure if the jump ins should just be empty jumps (he never does an attack with the jump ins).
Great training though.

hmmm this last script was more intended to play the fireball war at mid range, not really to footsies him. Just bait a jump in and ultra punish it.
I’ll check it again to see if I didn’t forget something. The jump in should be a jump HK, then a neutral jump, a backdash and a jump back. And no there’s no cr.mk xx fireball in this session. Not a footsie training :slight_smile:
there’s a mix of fireball, ex fireball, focus saving, jump in HK. that’s all.
Shoudl I make a footsies version ? with footsies + jump in HK mix up ?

this part of the script



Jump(forward)
    Wait(15)  <----- this
    push(HK)
    Wait(4)
    release(HK)
    Wait(4)
    push(UP)
    Wait(30)
    release(UP)
    Wait(30)
    Dash(backward)
    Wait(14)
    Jump(backward)
    Wait(20)


can be modified. Well at least the Wait(X) because if you don’t see a jump HK, it’s because the kick is too late.
That’s why it’s better to use P2 and let the script run P1 to see his inputs on screen and see what is wrong / mistimed in the script.

this should be a bit better in terms of timings, I felt like there wasn’t enough fireball and too much jumps / saving.
But it’s still the same number for the jump HK, only you could find the good number at the end, with your computer speed.



#include common.ahk
 
MIN_WALK_FRAMES := 5
MAX_WALK_FRAMES := 20
 
Fireball_War()
{
  Global
  Random, Guess, 0, 10
  if(Guess > 3)
  {
   QC_X(forward, HP)
  }
  else
  {
   QC_X(forward, "EXP")
  }
  Wait(50)
}
 
do_the_setup()
{
 Global
 Run := "go"
  While(Run = "go")
  {
    Random, Guess, 0, 30
    ToolTip, value : %Guess%
   ; Walk forward a random amount of time
    Random howLong, MIN_WALK_FRAMES, MAX_WALK_FRAMES
   ; Walk(forward, howLong)
   ; Walk(backward, 5)
 
   ; Randomly throw fireballs
    if (Guess > 15) {
        Fireball_War()
    }
    else if(Guess > 10)
    {
     Jump(forward)
     Wait(15)
     push(HK)
     Wait(4)
     release(HK)
     push(backward)
     push(UP)
     Wait(50)
     release(UP)
     release(backward)
    }
  else if (Guess > 6)
    {
   push(DOWN)
   push(MP)
   Wait(4)
   release(DOWN)
   release(MP)
   Wait(15)
    }
    else
    {
   Saving(backward, 40)
    }
   ; Walk backward roughly the same distance, but modify
   ; the time because Ryu's backward speed is slower
   ; than his forward speed
    howLong += 20
    ;Walk(backward, howLong)
  }
}
 
 
 
; Set Ruy's punish if we whiff a sweep. This is a stick HK, modify to your HK button if you're not using a stick
2joy8::
  Wait(12)
  Sweep()
  return
 
 
; controls for Cancel and side selection
2joy5:: ; the L1 button for a stick
  do_the_setup()
  return
 
2joy9:: ; the Select button for a stick
  Run := "stop"
  return
 
LEFT:: ; keyboard left arrow
  forward := LEFT
  backward := RIGHT
  return
 
RIGHT:: ; keyboard right arrow
  forward := RIGHT
  backward := LEFT
  return


And about the sweep punish :

2joy8::
Wait(12)
Sweep()
return

If you did it well, replacing the 2joy8 with your own sweep key, every time you input a HK (standing or crouching) the opponent try to sweep it. But of course if he’s doing something, any normals, at the same moment, he can’t sweep you back. You see ? Just like in the real world. ^^

Again play as Player 2 and let the script run player 1 with inputs on to see what’s going on. Playing in windowed mode at lower screen dimension make it easier to edit the script and reload it several time while checking in game the result.

.kjgvbkhgck h this is amazing im going to buy a pc asap brb will follow the thread

I thought it could be a good idea to make something up for the sake of it.
Website : bit.ly/ssfivtool
If you see a better way to write any information, feel free to submit your text, my english is weak.

This might be a keyboard only thing but when I set that as my own sweep button, if I sweep nothing happens and the dummy sweeps instead. It basically disables my hk button entirely.

You have only 1 keyboard ? that might be the limitation in your case. You should get a spare keyboard usb to avoid this.
But if the dummy sweep, that mean the command is sent. And I don’t see why your char would drop the sweep himself if the dummy have different sweep key. That’s weird.