Loading...
  OR  Zero-K Name:    Password:   

More voice controls! (Using GlovePIE)

2 posts, 12256 views
Post comment
Filter:    Player:  
sort
USrankZag
12 years ago
I put together a script for GlovePIE that will turn voice commands into most hot-keys, so I don't have to fumble to the J key and others during an intense battles. Requirements: Windows XP, Vista, 7 (xp may require MS Office voice recognition), GlovePIE http://glovepie.org/glovepie_download.php , a mic, and the script at the end of this post.

How to install: download GlovePIE from the link, unzip it, launch GlovePIE.exe, then copy and paste the script into GlovePIE, then hit the GlovePIE run button.

How to use: when you run the script say "Listen" to activate voice control and "Stand by" to have it not do anything except wait for you to say "Listen" again. It has TTS feed-back that you can turn on or off by saying "speak" for on or "shut up" for off. :P ("silence" works too.) For setting or selecting groups say for example "Set group" wait a second then say the number, also instead of saying "nine" you have to say "niner" because it kept thinking "nine" was "five."
This should work with other Spring games too as long they have the same hot-keys.
The script is really easy to modify, so if you notice a hot-key command that isn't used here, you can just add it in, or change what you have to say to trigger existing commands.

Known problems: saying "Shift" tends to register as "stop" or "jump," and you are probably better off using the keyboard shift. Also, Zero-K will keep telling you that key "UNKNOWN" has been pressed for 30 seconds. Don't know what causes that. If you have any problems or questions, just let me know.

-Zag

Script:

if said("listen") then
var.sr = true
say("Voice control enabled")
end if
if said("stand by") then
var.sr = false
say("Voice control disabled")
end if

if var.sr then
if said("attack") then
keyboard.A = true
keyboard.A = false
keyboard.Shift = false
if var.voice then
say("attack")
end if
end if
if said("cancel") then
keyboard.Shift = false
var.group = false
key.ctrl = false
keyboard.Escape = true
keyboard.Escape = false
if var.voice then
say("cancel")
end if
end if
if said("skuttle") then
keyboard.Ctrl+D = true
wait 10 ms
keyboard.Ctrl+D = false
keyboard.Shift = false
if var.voice then
say("Self destructing")
end if
end if
if said("jump") then
keyboard.J = true
keyboard.J = false
keyboard.Shift = false
if var.voice then
say("jump")
end if
end if
if said("create group") or said("set group") then
var.group = true
keyboard.Ctrl = true
keyboard.Shift = false
if var.voice then
say("create what group")
end if
end if
if said("select group") then
var.group = true
if var.voice then
say("select what group")
end if
end if
if said("stop") then
keyboard.S = true
keyboard.S = false
keyboard.Shift = false
if var.voice then
say("stop")
end if
end if
if said("shift") then
toggle(keyboard.Shift)
if var.voice then
say("shift"+key.Shift)
end if
end if
if said("silent") or said("silence") or said("shut up") or said("voice off") then
var.voice = false
say("Voice off")
end if
if said("talk") or said("speak") or said("voice on") then
var.voice = true
say("Voice on")
end if
if said("thank you") or said("thanks") then
if var.voice then
say("Your welcome")
end if
end if
if said("commander") then
keyboard.Ctrl = true
wait 20 ms
key.C = true
wait 20 ms
keyboard.Ctrl+c = false
if var.voice then
say("Commander selected")
end if
key.shift = false
end if
if said("builder") or said("constructor") then
keyboard.Ctrl+V = true
wait 10 ms
keyboard.Ctrl+V = false
if var.voice then
say("Next constructor selected")
end if
key.shift = false
end if
if said("cloak") or said("toggle cloak") then
key.shift = false
key.K = true
key.K = false
if var.voice then
say("Cloak toggled")
end if
end if
if said("patrol") then
key.shift = true
key.p = true
key.p = false
if var.voice then
say("Patrol")
end if
end if
if said("fight") then
key.f = true
key.f = false
if var.voice then
say("Fight")
end if
end if
if said("height map") then
key.f1 = true
key.f1 = false
if var.voice then
say("Hite map")
end if
end if
if said("metal map") then
key.F4 = true
key.F4 = false
if var.voice then
say("Metal map")
end if
end if


if var.group then
if said("one") then
keyboard.one = true
wait 20 ms
keyboard.one = false
if var.voice then
say("one")
end if
var.group = false
keyboard.Ctrl = false
keyboard.Shift = false
end if
if said("two") then
keyboard.two = true
wait 20 ms
keyboard.two = false
if var.voice then
say("too")
end if
var.group = false
keyboard.Ctrl = false
keyboard.Shift = false
end if
if said("three") then
keyboard.three = true
wait 20 ms
keyboard.three = false
if var.voice then
say("three")
end if
var.group = false
keyboard.Ctrl = false
keyboard.Shift = false
end if
if said("for") or said("four") then
keyboard.four = true
wait 20 ms
keyboard.four = false
if var.voice then
say("four")
end if
var.group = false
keyboard.Ctrl = false
keyboard.Shift = false
end if
if said("five") then
keyboard.five = true
wait 20 ms
keyboard.five = false
if var.voice then
say("five")
end if
var.group = false
keyboard.Ctrl = false
keyboard.Shift = false
end if
if said("six") or said("sick") then
keyboard.six = true
wait 20 ms
keyboard.six = false
if var.voice then
say("six")
end if
var.group = false
keyboard.Ctrl = false
keyboard.Shift = false
end if
if said("seven") then
keyboard.seven = true
wait 20 ms
keyboard.seven = false
if var.voice then
say("seven")
end if
var.group = false
keyboard.Ctrl = false
keyboard.Shift = false
end if
if said("eight") or said("ate") then
keyboard.eight = true
wait 20 ms
keyboard.eight = false
if var.voice then
say("ate")
end if
var.group = false
keyboard.Ctrl = false
keyboard.Shift = false
end if
if said("niner") then
keyboard.nine = true
wait 20 ms
keyboard.nine = false
if var.voice then
say("nine")
end if
var.group = false
keyboard.Ctrl = false
keyboard.Shift = false
end if
if said("zero") or said("ten") then
keyboard.zero = true
wait 20 ms
keyboard.zero = false
if var.voice then
say("ten")
end if
var.group = false
keyboard.Ctrl = false
keyboard.Shift = false
end if

end if

end if
+0 / -0


12 years ago
Hmm Zero-K has its own voice control system, could it be made for it?
You can already control factories with it..

http://zero-k.info/Forum/Thread/1548
+0 / -0