Anyone good at scripting?

  1. Anyone good at scripting?

    #684
    I'm wondering three things:

    1. Is it possible to make it so that you have to hit two keys in order for a script to start working (ex: Hitting left control and P)?
    2. Is it possible to make a script where you can press a button and it switches scripts (ex: Hitting "i" once and saying /3, and hitting "i" again would make me say /1)?
    3. How would you stop a looping script (ex: alias "poop" "+taunt; poop")?

    If anyone knows how to do any of these, please post an example script below! <3
  2. Re: Anyone good at scripting?

    #691
    This shit is all untested so tell me if it works I guess. It's been a while since I've done scripting.

    1. I think this will work

    bind ctrl +ctrlp;
    bind p myaction;
    alias +ctrlp "alias myaction action";
    alias -ctrlp "alias myaction nullaction";


    2. Yeah this is possible. Extracted from one of my scripts to toggle netgraph
    alias toggle_net_graph tng1
    alias tng0 "net_graph 0; alias toggle_net_graph tng1"
    alias tng1 "net_graph 3; alias toggle_net_graph tng0"

    3. You can't anymore. You used to be able to do this using "wait" but Valve has disabled it permanantly I think. Even if they didn't, it's disabled on most servers since you can do some really terrible things with it.
  3. Re: Anyone good at scripting?

    #721
    Exile wrote View original post
    2. Yeah this is possible. Extracted from one of my scripts to toggle netgraph
    alias toggle_net_graph tng1
    alias tng0 "net_graph 0; alias toggle_net_graph tng1"
    alias tng1 "net_graph 3; alias toggle_net_graph tng0"


    What does tng1 mean in the first line? >.< Actually, what does it mean in all the other lines (other than naming the alias)? :3
    And what would I bind "o" to?
  4. Re: Anyone good at scripting?

    #753
    Okay. So I made a toggle script after learning about rebinding in scripts.

    One for switching between first and third person on the servers:
    Quoted text
    alias 3rdon "echo ThirdPerson Enabled; say /3; bind o 1ston"
    alias 1ston "echo FirstPerson Enabled; say /1; bind o 3rdon"
    bind o 3rdon


    And one for going through Buddha, God, and Mortal mode on the trade server:
    Quoted text
    alias buddha "echo Buddha On; say /buddha; bind p god"
    alias god "echo God On; say /god; bind p mortal"
    alias mortal "echo Mortal On; say /mortal; bind p buddha"
    bind p buddha

Archive Notice

The Saxton Hell community forums have been retried. This website is available as a read-only archive. Join us on Discord for the latest discussions!

Join the Saxton Hell Discord server