r/tf2scripthelp • u/covert_operator100 • Mar 24 '17
Resolved Tracking current slot
My script doesn't behave anywhere near what I expect it to. The intent is for it to echo each time I press the relevant buttons, but it behaves really weirdly, as if it thinks it's always on slot three no matter how many times -thirdis called. (and pressing q will have it always think it's slot one.)
I also removed the whitespace, and the behaviour changed slightly. Does whitespace matter, or am I missing a semicolon or something?
//tracks what the current slot is
alias +first "echo + slot 1, slot_minus = -first;
alias scrollup "-first;invprev;+third";
alias scrolldn "-first;invnext;+secnd";
alias slot_minus "-first";
"
alias -first "echo - slot 1;
alias lastwpn "slot_minus;lastinv;+first"
"
alias +secnd "echo + slot 2, slot_minus = -secnd;
alias scrollup "-secnd;invprev;+first";
alias scrolldn "-secnd;invnext;+third";
alias slot_minus "-secnd"
"
alias -secnd "echo - slot 2;
alias lastwpn "slot_minus;lastinv;+secnd"
"
alias +third "echo + slot 3, slot_minus = -third;
alias scrollup "-third;invprev;+secnd";
alias scrolldn "-third;invnext;+first";
alias slot_minus "-third"
"
alias -third "echo - slot 3;
alias lastwpn "slot_minus;lastinv;+third"
"
alias REMOVESCRIPT "echo "SlotTracker removed";
bind MWHEELUP "invprev";
bind MWHEELDOWN "invnext";
bind q "lastinv";
bind \
"
+first;
-secnd;
bind MWHEELUP "scrollup"
bind MWHEELDOWN "scrolldn"
bind q "lastwpn"
bind \ "REMOVESCRIPT"
1
Upvotes
View all comments
Show parent comment
1
u/DeltaTroopa Mar 25 '17
They might sometimes work, but they often don't and its better to avoid them, lots of other info about what works and what doesn't on the TF2ScriptHelp Wiki including some examples that do similar things to what you're attempting that you can use for reference.