Half-Life Console Help
Basic Script Types: Multiple-Option
Cycler
Sometimes it's handy to have
a single key cycle through each of a set of options, changing to the next
one each time the key is pressed, and looping back around to the first
option at the end. For example, say your three favorite servers generally
have different speeds / pings for you, so each one has it's own best rate
and pushlatency settings (If you don't know that those are, do
yourself a huge favor and read the Multiplayer
Tweaks to find out). This little script will cycle through three different
sets of rate and pushlatency settings, so you can press
the 'x' key to pick from among the options depending on which server you're
on.
alias makeslow
"bind x slow"
alias makemed "bind x
med"
alias makefast "bind x
fast"
alias slow "rate 2500;
pushlatency -150; makemed"
alias med "rate 3500;
pushlatency -100; makefast"
alias fast "rate 4500;
pushlatency -50; makeslow"
med // make medium speed
the default
Here's another example of an option-cycler
that can be used to make one key type a different message to the other
players whenever it is pressed (unfortunately, I don't know a way to randomize
the list of messages). You can extend this idea indefinitely by just adding
more msgX and setXnext aliases using the same form:
alias set1next
"bind x msg1"
alias set2next "bind x
msg2"
alias set3next "bind x
msg3"
alias msg1 "say message
#1 contents; set2next"
alias msg2 "say message
#2 contents; set3next"
alias msg3 "say message
#3 contents; set1next"
set1next // make msg1 first
in the list
|