Voice Command Script



  • This is a script i use for toggling my fps on / off, selecting my main knight loadout (currently configured only for 1920 x 1200 monitor resolution), and voice commands. You need to install autoit and get the sciTE IDE (tool that will let you write / compile scripts).

    Link to tool:
    http://www.autoitscript.com/site/autoit/downloads/

    #include <misc.au3>
    #include <string.au3>
    #include <array.au3>
    #include <guiconstantsex.au3>#RequireAdmin
    
    ; link to keys that can be used ----> [url]http://www.autoitscript.com/autoit3/docs/functions/Send.htm[/url]
    
    HotKeySet("{HOME}", "KnightPrimaryLoadout")
    
    HotKeySet("{NUMPAD0}", "MRespect")
    HotKeySet("{NUMPAD1}", "MYes")
    HotKeySet("{NUMPAD2}", "MTaunt")
    HotKeySet("{NUMPAD3}", "MNo")
    HotKeySet("{NUMPAD4}", "MObjective")
    HotKeySet("{NUMPAD5}", "MSorry")
    HotKeySet("{NUMPAD6}", "MIncoming")
    HotKeySet("{NUMPAD7}", "MBehindUs")
    HotKeySet("{NUMPAD8}", "MThanks")
    HotKeySet("{NUMPAD9}", "MAllClear")
    HotKeySet("{NUMPADSUB}", "MHelp")
    HotKeySet("{NUMPADADD}", "MRetreat")
    HotKeySet("{RIGHT}", "MLaugh")
    
    HotKeySet("{\}", "ShowFPS")
    
    ;;;; Body of program would go here ;;;;
    ;Local $hDLL = DllOpen("user32.dll")
    ;$TheActiveWindow = "Chivalry: Medieval Warfare (32-bit, DX9)"
    While 1
        Sleep(100)
    WEnd
    ;;;;;;;;
    
    Func ShowFPS()
    		Send("{~}")
    		Sleep(150)
    		Send("stat fps{Enter}{ESC}")
    EndFunc
    
    Func KnightPrimaryLoadout()
    		;Primary (Maul)
    		MouseMove(813, 527) ; 913 425 = maul,
    		MouseDown("left")
    		Sleep(200)
    		MouseUp("left")
    
    		;Secondary (Falchion)
    		MouseMove(1118, 429) ; for 1920 x 1200 resolution only   1216 430 = Falchion
    		MouseDown("left")
    		Sleep(200)
    		MouseUp("left")
    
    		;Special (Shield)
    		MouseMove(1437, 425) ; for 1920 x 1200 resolution only
    		MouseDown("left")
    		Sleep(200)
    		MouseUp("left")
    
    		;Join Game
    		MouseMove(1205, 1081) ; for 1920 x 1200 resolution only
    		MouseDown("left")
    		Sleep(200)
    		MouseUp("left")
    EndFunc
    
    Func MRespect()
    		Respect()
    EndFunc
    
    Func MLaugh()
    		Laugh()
    EndFunc
    
    Func MTaunt()
    		Taunt()
    EndFunc
    
    Func MSorry()
    		Sorry()
    EndFunc
    
    Func MNo()
    		No()
    EndFunc
    
    Func MYes()
    		Yes()
    EndFunc
    
    Func MThanks()
    		Thanks()
    EndFunc
    
    Func MHelp()
    		Help()
    EndFunc
    
    Func MAllClear()
    		AllClear()
    EndFunc
    
    Func MBehindUs()
    		BehindUs()
    	EndFunc
    
    Func MIncoming()
    		Incoming()
    EndFunc
    
    Func MRetreat()
    		Retreat()
    EndFunc
    
    Func MObjective()
    		Objective()
    EndFunc
    
    ;#####################################################
    ;#                     Commands                      #
    ;#####################################################
    
    Func Respect()
    	Send("{x}")
    	Sleep(150)
    	Send("{x}")
    	Sleep(150)
    	Send("{1}")
    EndFunc
    
    Func Laugh()
    	Send("{x}")
    	Sleep(150)
    	Send("{x}")
    	Sleep(150)
    	Send("{2}")
    EndFunc
    
    Func Taunt()
    	Send("{x}")
    	Sleep(150)
    	Send("{x}")
    	Sleep(150)
    	Send("{3}")
    EndFunc
    
    Func Sorry()
    	Send("{x}")
    	Sleep(150)
    	Send("{x}")
    	Sleep(150)
    	Send("{4}")
    EndFunc
    
    Func No()
    	Send("{x}")
    	Sleep(150)
    	Send("{x}")
    	Sleep(150)
    	Send("{9}")
    EndFunc
    
    Func Yes()
    	Send("{x}")
    	Sleep(150)
    	Send("{x}")
    	Sleep(150)
    	Send("{0}")
    EndFunc
    
    Func Thanks()
    	Send("{x}")
    	Sleep(150)
    	Send("{x}")
    	Sleep(150)
    	Send("{6}")
    EndFunc
    
    Func Help()
    	Send("{x}")
    	Sleep(150)
    	Send("{x}")
    	Sleep(150)
    	Send("{8}")
    EndFunc
    
    Func AllClear()
    	Send("{z}")
    	Sleep(150)
    	Send("{z}")
    	Sleep(150)
    	Send("{1}")
    EndFunc
    
    Func BehindUs()
    	Send("{z}")
    	Sleep(150)
    	Send("{z}")
    	Sleep(150)
    	Send("{2}")
    EndFunc
    
    Func Incoming()
    	Send("{z}")
    	Sleep(150)
    	Send("{z}")
    	Sleep(150)
    	Send("{3}")
    EndFunc
    
    Func Retreat()
    	Send("{z}")
    	Sleep(150)
    	Send("{z}")
    	Sleep(150)
    	Send("{8}")
    EndFunc
    
    Func Objective()
    	Send("{z}")
    	Sleep(150)
    	Send("{z}")
    	Sleep(150)
    	Send("{6}")
    EndFunc</guiconstantsex.au3> </array.au3></string.au3></misc.au3>
    

Log in to reply