Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Mortal Kombat X Scripting


  • Please log in to reply
9 replies to this topic
Kwert
  • Members
  • 4 posts
  • Last active: Apr 17 2015 12:09 AM
  • Joined: 15 Apr 2015

Since the release of the game, I was wanting to create a script in which I could bind the actions required to perform a special attack. I first used a sample script which was used in Mortal Kombat 9 in junction with autohotkey to see how it would perform in the new game. However, I found that neither the script nor keyboard macros made in Microsoft Mouse and Keyboard Center wouldn't do anything in game. I can confirm the script works outside of the game, such as typing letters in the Google search bar. I would like to know what is preventing these macros and if there is any workaround for it

 

The sample script I used (retrieved from mksecrets.com by user percitrovsk)

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

; Numpad Commands

Numpad1::	; FK - Front Kick / Confirm
Send {g down}
KeyWait Numpad1
Send {g up}
return

Numpad2::	; BK - Back Kick / Cancel
Send {j down}
KeyWait Numpad2
Send {j up}
return

Numpad3::	; BL - Block
Send {Space down}
KeyWait Numpad3
Send {Space up}
return

Numpad4::	; FP - Front Puch
Send {t down}
KeyWait Numpad4
Send {t up}
return

Numpad5::	; BP - Back Punch
Send {u down}
KeyWait Numpad5
Send {u up}
return

Numpad6::	; TH - Throw
Send {y down}
KeyWait Numpad6
Send {y up}
return

Numpad7::	; TG - Tag
Send {Tab down}
KeyWait Numpad7
Send {Tab up}
return

Numpad8::	; SS - Flip Stance
Send {h down}
KeyWait Numpad8
Send {h up}
return

Numpad9::	; X-Ray (BL + SS)
Send {Space down}{h down}
KeyWait Numpad9
Send {Space up}{h up}
return

Numpad0::	; Start
Send {1 down}
KeyWait Numpad0
Send {1 up}
return

NumpadDot::	; Back
Send {4 down}
KeyWait NumpadDot
Send {4 up}
return


; Q + Numpad Commands (your character in the left)

Q & Numpad1::	; Low Forceball
Send {s down}
Sleep, 30
Send {s up}
Send {d down}
Sleep, 30
Send {d up}
Send {u down}
Sleep, 30
Send {u up}
return

Q & Numpad2::	; High Forceball
Send {s down}
Sleep, 30
Send {s up}
Send {a down}
Sleep, 30
Send {a up}
Send {u down}
Sleep, 30
Send {u up}
return

Q & Numpad3::	; Flip Kick
Send {s down}
Sleep, 30
Send {s up}
Send {a down}
Sleep, 30
Send {a up}
Send {g down}
Sleep, 30
Send {g up}
return

Q & Numpad4::	; Shadow Kick
Send {a down}
Sleep, 30
Send {a up}
Send {d down}
Sleep, 30
Send {d up}
Send {j down}
Sleep, 30
Send {j up}
return

Q & Numpad5::	; Nut Punch
Send {a down}
Sleep, 30
Send {a up}
Send {s down}
Sleep, 30
Send {s up}
Send {t down}
Sleep, 30
Send {t up}
return

Q & Numpad7::	; Combo - 4 Hits
Send {u down}
Sleep, 30
Send {u up}
Sleep, 60
Send {t down}
Sleep, 30
Send {t up}
Sleep, 60
Send {d down}{u down}
Sleep, 30
Send {d up}{u up}
Sleep, 1000
Send {a down}
Sleep, 30
Send {a up}
Send {d down}
Sleep, 30
Send {d up}
Send {j down}
Sleep, 30
Send {j up}
return

Q & Numpad8::	; Combo - 4 Hits
Send {d down}{g down}
Sleep, 30
Send {d up}{g up}
Sleep, 60
Send {g down}
Sleep, 30
Send {g up}
Sleep, 100
Send {a down}{g down}
Sleep, 30
Send {a up}{g up}
Sleep, 400
Send {a down}
Sleep, 30
Send {a up}
Send {s down}
Sleep, 30
Send {s up}
Send {t down}
Sleep, 30
Send {t up}
return

Q & Numpad9::	; Combo - 5 Hits (opponent must be in corner, sometimes fails)
Send {d down}{j down}
Sleep, 30
Send {d up}{j up}
Sleep, 700
Send {d down}{j down}
Sleep, 30
Send {d up}{j up}
Sleep, 800
Send {t down}
Sleep, 30
Send {t up}
Sleep, 10
Send {t down}
Sleep, 30
Send {t up}
Sleep, 60
Send {s down}
Sleep, 30
Send {s up}
Send {a down}
Sleep, 30
Send {a up}
Send {g down}
Sleep, 30
Send {g up}
return

Q & Numpad0::	; Stage Fatality (Distance: Varies)
Send {s down}
Sleep, 30
Send {s up}
Send {a down}
Sleep, 30
Send {a up}
Send {d down}
Sleep, 30
Send {d up}
Send {Space down}
Sleep, 30
Send {Space up}
return

Q & NumpadAdd::	; Babality (Distance: Jump)
Send {d down}
Sleep, 30
Send {d up}
Send {a down}
Sleep, 30
Send {a up}
Send {d down}
Sleep, 30
Send {d up}
Send {j down}
Sleep, 30
Send {j up}
return

Q & NumpadDiv::	; Fatality 1 - Heads Up! (Distance: Touching)
Send {d down}
Sleep, 30
Send {d up}
Sleep, 10
Send {d down}
Sleep, 30
Send {d up}
Send {a down}
Sleep, 30
Send {a up}
Send {s down}
Sleep, 30
Send {s up}
Send {g down}
Sleep, 30
Send {g up}
return

Q & NumpadMult::	; Fatality 2 - And the Winner Is... (Distance: Sweep)
Send {s down}
Sleep, 30
Send {s up}
Send {d down}
Sleep, 30
Send {d up}
Send {s down}
Sleep, 30
Send {s up}
Send {d down}
Sleep, 30
Send {d up}
Send {j down}
Sleep, 30
Send {j up}
return


; E + Numpad Commands (your character in the right)

E & Numpad1::	; Low Forceball
Send {s down}
Sleep, 30
Send {s up}
Send {a down}
Sleep, 30
Send {a up}
Send {u down}
Sleep, 30
Send {u up}
return

E & Numpad2::	; High Forceball
Send {s down}
Sleep, 30
Send {s up}
Send {d down}
Sleep, 30
Send {d up}
Send {u down}
Sleep, 30
Send {u up}
return

E & Numpad3::	; Flip Kick
Send {s down}
Sleep, 30
Send {s up}
Send {d down}
Sleep, 30
Send {d up}
Send {g down}
Sleep, 30
Send {g up}
return

E & Numpad4::	; Shadow Kick
Send {d down}
Sleep, 30
Send {d up}
Send {a down}
Sleep, 30
Send {a up}
Send {j down}
Sleep, 30
Send {j up}
return

E & Numpad5::	; Nut Punch
Send {d down}
Sleep, 30
Send {d up}
Send {s down}
Sleep, 30
Send {s up}
Send {t down}
Sleep, 30
Send {t up}
return

E & Numpad7::	; Combo - 4 Hits
Send {u down}
Sleep, 30
Send {u up}
Sleep, 60
Send {t down}
Sleep, 30
Send {t up}
Sleep, 60
Send {a down}{u down}
Sleep, 30
Send {a up}{u up}
Sleep, 1000
Send {d down}
Sleep, 30
Send {d up}
Send {a down}
Sleep, 30
Send {a up}
Send {j down}
Sleep, 30
Send {j up}
return

E & Numpad8::	; Combo - 4 Hits
Send {a down}{g down}
Sleep, 30
Send {a up}{g up}
Sleep, 60
Send {g down}
Sleep, 30
Send {g up}
Sleep, 100
Send {d down}{g down}
Sleep, 30
Send {d up}{g up}
Sleep, 400
Send {d down}
Sleep, 30
Send {d up}
Send {s down}
Sleep, 30
Send {s up}
Send {t down}
Sleep, 30
Send {t up}
return

E & Numpad9::	; Combo - 5 Hits (sometimes fails)
Send {a down}{j down}
Sleep, 30
Send {a up}{j up}
Sleep, 700
Send {a down}{j down}
Sleep, 30
Send {a up}{j up}
Sleep, 800
Send {t down}
Sleep, 30
Send {t up}
Sleep, 10
Send {t down}
Sleep, 30
Send {t up}
Sleep, 60
Send {s down}
Sleep, 30
Send {s up}
Send {d down}
Sleep, 30
Send {d up}
Send {g down}
Sleep, 30
Send {g up}
return

E & Numpad0::	; Stage Fatality (Distance: Varies)
Send {s down}
Sleep, 30
Send {s up}
Send {d down}
Sleep, 30
Send {d up}
Send {a down}
Sleep, 30
Send {a up}
Send {Space down}
Sleep, 30
Send {Space up}
return

E & NumpadAdd::	; Babality (Distance: Jump)
Send {a down}
Sleep, 30
Send {a up}
Send {d down}
Sleep, 30
Send {d up}
Send {a down}
Sleep, 30
Send {a up}
Send {j down}
Sleep, 30
Send {j up}
return

E & NumpadDiv::	; Fatality 1 - Heads Up! (Distance: Touching)
Send {a down}
Sleep, 30
Send {a up}
Sleep, 10
Send {a down}
Sleep, 30
Send {a up}
Send {d down}
Sleep, 30
Send {d up}
Send {s down}
Sleep, 30
Send {s up}
Send {g down}
Sleep, 30
Send {g up}
return

E & NumpadMult::	; Fatality 2 - And the Winner Is... (Distance: Sweep)
Send {s down}
Sleep, 30
Send {s up}
Send {a down}
Sleep, 30
Send {a up}
Send {s down}
Sleep, 30
Send {s up}
Send {a down}
Sleep, 30
Send {a up}
Send {j down}
Sleep, 30
Send {j up}
return


nicepants42
  • Members
  • 3 posts
  • Last active: Apr 17 2015 01:32 PM
  • Joined: 30 Oct 2014

You've tried adding #Usehook On?

 

https://www.autohotk...ds/_UseHook.htm



Kwert
  • Members
  • 4 posts
  • Last active: Apr 17 2015 12:09 AM
  • Joined: 15 Apr 2015

I tried and the result didn't seem to change



Xtra
  • Members
  • 954 posts
  • Last active: Jul 23 2016 09:04 PM
  • Joined: 29 Sep 2013

Read here : http://www.autohotke...mes-the-basics/

 

Try some of the methods listed.



Kwert
  • Members
  • 4 posts
  • Last active: Apr 17 2015 12:09 AM
  • Joined: 15 Apr 2015

I have already tried beginning methods 1-4 and intermediate method 1. I use windows 7, so I am unable to do intermediate step 2. I don't know DLL or how to set up a virtual machine, so I haven't done the expert steps



Xtra
  • Members
  • 954 posts
  • Last active: Jul 23 2016 09:04 PM
  • Joined: 29 Sep 2013

You can try SnowFlakes' Send and Click Tool.

He also provides some dll call info.



Kwert
  • Members
  • 4 posts
  • Last active: Apr 17 2015 12:09 AM
  • Joined: 15 Apr 2015

The mouse has no use in Mortal Kombat. I have since given up in my endeavor, coming to the conclusion that I would need a virtual keyboard driver to spoof the key presses, which I don't believe setting up to be worth it for this game. I appreciate your help regardless



rip
  • Members
  • 1 posts
  • Last active: Apr 26 2015 09:47 PM
  • Joined: 20 Apr 2015

So, AutoHotkey is not working in Mortal Kombat X? :(



Shinshikaizer
  • Members
  • 1 posts
  • Last active: Apr 25 2015 02:35 PM
  • Joined: 25 Apr 2015

That might be it. I tried using a

#IfWinActive, MK10

Line to identify the Window, and while it does identify the window, the key reconfiguration doesn't really work, ie, I was able to reassign the W key, but I wasn't able to reassign the ASDF row, and when I tried to assign the arrow keys, it completely removed them from use.



Bobo5050
  • Members
  • 3 posts
  • Last active: Jun 15 2015 04:18 AM
  • Joined: 11 Jun 2015

anyone seem to figure this out yet?