Jump to content

Scripting Help


Hero422

Recommended Posts

So im trying to make a script for tf2 that will every 10ish seconds send a msg in a rotating set, this is currently what i have but to change anything i either have to leave the server or leave the game (havent actually figure out which) and there is no way to turn it off.

alias regtradebind "regtradebind1; wait 1320; regtradebind2; wait 1320; regtradebind3; wait 1320; regtradebind"
alias regtradebind1 "say Selling Cases/Crates for 1 scrap : 2 cases & pg 4/5 of my !bp, and Buying BPs/Discounted Items with 1 keys 67 ref"
alias regtradebind2 "say Selling Spec KS Pan - 1 key 0.88 ref & Strange Spec KS Tomislav w/ parts - 1 key 14 ref and pg 4/5 of my !bp"
alias regtradebind3 "say Selling Haunted Sir Shootsalot - 3 keys 24.88 ref & pg 4/5 of my !bp. Buying Keys for 32 ref"
bind = "regtradebind"

So can someone help me and show me what I need to do to make this where I can turn it off and/or make it more efficient/compact.

 

EDIT: I just thought of a way to technically do this but it doesn't seem like its the best way.

alias regtradebind "resetbind; regtradebind1; wait 1320; regtradebind2; wait 1320; regtradebind3; wait 1320; regtradebind"
alias resetbind "bind = offloop"
alias realias "alias regtradebind "resetbind; regtradebind1; wait 1320; regtradebind2; wait 1320; regtradebind3; wait 1320; regtradebind""
alias offloop "alias regtradebind ""; wait 4290; bind = "regtradebind"; realias"
alias regtradebind1 "say Selling Cases/Crates for 1 scrap : 2 cases & pg 4/5 of my !bp, and Buying BPs/Discounted Items with 1 keys 67 ref"
alias regtradebind2 "say Selling Spec KS Pan - 1 key 0.88 ref & Strange Spec KS Tomislav w/ parts - 1 key 14 ref and pg 4/5 of my !bp"
alias regtradebind3 "say Selling Haunted Sir Shootsalot - 3 keys 24.88 ref & pg 4/5 of my !bp. Buying Keys for 32 ref"
bind = "regtradebind"

I also want to know is there a way to load in the script on launch of the game

Link to comment
Share on other sites

1. The wait command requires sv cheats 0 I believe.

2. You need to make a toggle script with "TradeOn" and "TradeOff" 

 

Then alias the on and off with the required console commands.

 

Edit: to make it automatically load place the text eithin your autoexec.cfg in tf/cfg folder. If you do not have it, create it using notepad++

Link to comment
Share on other sites

ok so this script kinda works for anyone who wants to use it, but after the turning it off and then turning it back on it take some time to start saying stuff again.

alias regtradebind "resetbind; regtradebind1; wait 1600; regtradebind2; wait 1600; regtradebind3; wait 1600; regtradebind"
alias resetbind "bind = offloop"
alias realias "alias regtradebind resetbind; regtradebind1; wait 1320; regtradebind2; wait 1320; regtradebind3; wait 1320; regtradebind"
alias offloop "alias regtradebind ; wait 10000; bind = "regtradebind"; realias"
alias regtradebind1 "say Selling Cases/Crates for 1 scrap : 2 cases & pg 4/5 of my !bp, and Buying BPs/Discounted Items with 1 keys 67 ref"
alias regtradebind2 "say Selling Strange Spec KS Tomislav w/ parts - 1 key 14 ref and pg 4/5 of my !bp. Buying Keys for 32 ref"
alias regtradebind3 "say Selling Haunted Sir Shootsalot - 3 keys 24.88 ref & pg 4/5 of my !bp. Buying Keys for 32 ref"
bind = "regtradebind"

If you want to make it where you don't have to put that into the console line by line every time, go into the files of your tf2 install, and then go into tf/cfg and make a file with this stuff called autoexec.cfg. If you want to change what it says change the text in bettween the say and the quote mark. press the = button to turn it on, press it again to turn it off.

 

EDIT: you may also have to change the wait times, make sure that the one in the offloop is at least as long as all the regtradebind waits combined. I actually have mine set to 3000 and 15000 just to make sure it doesnt piss off a admin or something.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...