Voice Toggle Script

DragonMechDragonMech Join Date: 2003-09-19 Member: 21023Members, Constellation, Reinforced - Shadow
<div class="IPBDescription">In need of debugging</div> <!--QuoteBegin-=DV= Destructor+Jun 23 2004, 09:50 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (=DV= Destructor @ Jun 23 2004, 09:50 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->make a script

bind "o" "VoiceON"

alias "VoiceON" "+voicerecord; bind o VoiceOFF"
alias "VoiceOFF" "-voicerecord; bind o VoiceON"


You may need to add a few more quotes, but I think you should be alirght. This script has you press the key once to talk, then press it again to turn it off...<!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Adding those "few more quotes" and changing 'o' to 'mouse3', I got:

<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->//Voice Toggle
bind "MOUSE3" "VoiceON"

alias "VoiceON" "+voicerecord; bind "MOUSE3" "VoiceOFF"
alias "VoiceOFF" "-voicerecord; bind "MOUSE3" "VoiceON"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Now this has one problem. While it turns on just fine, it doesn't turn off. That <i>might</i> be irritating to my fellow teammates <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html//emoticons/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif' /><!--endemo-->. Can anyone spot what's wrong with it?

Comments

  • UrdUrd Join Date: 2003-05-25 Member: 16696Members, Constellation
    edited June 2004
    You have too many quotes in your aliases. Half-life isn't able to distinguise if you are intending it to be an opening or closing quote, so it counts every first quote as open and second as closed.

    This is what half-life is seeing.

    Red = Open
    Yellow = Close

    alias <span style='color:red'>"</span>VoiceON<span style='color:yellow'>"</span> <span style='color:red'>"</span>+voicerecord; bind <span style='color:yellow'>"</span>MOUSE3<span style='color:red'>"</span> <span style='color:yellow'>"</span>VoiceOFF<span style='color:red'>"</span>
    alias <span style='color:red'>"</span>VoiceOFF<span style='color:yellow'>"</span> <span style='color:red'>"</span>-voicerecord; bind <span style='color:yellow'>"</span>MOUSE3<span style='color:red'>"</span> <span style='color:yellow'>"</span>VoiceON<span style='color:red'>"</span>

    Here are the correct aliases.

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->alias "VoiceON" "+voicerecord; bind MOUSE3 VoiceOFF"
    alias "VoiceOFF" "-voicerecord; bind MOUSE3 VoiceON"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
  • DragonMechDragonMech Join Date: 2003-09-19 Member: 21023Members, Constellation, Reinforced - Shadow
    That explains it. Thanks - it works great now.
Sign In or Register to comment.