Code: Select all
import subprocess
from subprocess import call
import time
from time import sleep
def heard(vcmd, cfd):
return speech.said(vcmd, cfd)
def play(audio_file_path):
subprocess.call(["ffplay", "-nodisp", "-autoexit", audio_file_path])
if heard("normal", 0.2):
call("C:\\ahkscripts\\sp_engr_c1.ahk", -1, None, None, None, None, None, False, True)
call("C:\\ahkscripts\\sp_engr_h1.ahk", -1, None, None, None, None, None, False, True)
play("C:\\ahkscripts\\a.wav")
if heard("camera", 0.1):
call("C:\\ahkscripts\\sp_engr_c2.ahk", -1, None, None, None, None, None, False, True)
call("C:\\ahkscripts\\sp_engr_h2.ahk", -1, None, None, None, None, None, False, True)
play("C:\\ahkscripts\\a.wav")
if heard("fly", 0.3):
call("C:\\ahkscripts\\sp_engr_c3.ahk", -1, None, None, None, None, None, False, True)
call("C:\\ahkscripts\\sp_engr_h3.ahk", -1, None, None, None, None, None, False, True)
play("C:\\ahkscripts\\a.wav")
if heard("build", 0.3):
call("C:\\ahkscripts\\sp_engr_c4.ahk", -1, None, None, None, None, None, False, True)
call("C:\\ahkscripts\\sp_engr_h4.ahk", -1, None, None, None, None, None, False, True)
play("C:\\ahkscripts\\a.wav")
if heard("inventory", 0.0):
keyboard.setPressed(Key.I)
if heard("jetpack", 0.0):
keyboard.setKey(Key.X, not keyboard.getPressed(Key.X))
if heard("crouch", 0.0):
keyboard.setKey(Key.Apostrophe, not keyboard.getPressed(Key.Apostrophe))
if heard("break through", 0.0):
keyboard.setKey(Key.F, not keyboard.getPressed(Key.F))