So I wanted a multifunctional sticky launcher script. Holding down mouse1 results in charging a sticky, quickly releasing and pressing mouse1 would autofire stickies.
This is what I have:
// Bind agnostic :)
bind mouse1 "+primfire"
// This enables stickyfiring when I equip the weapon
alias stickyfire "alias +primfire +stickyfire; alias -primfire -stickyfire; +reload"
// Fire either normal (sfar) or rapid (+rapidfire)
alias +stickyfire "sfar"
// When you press mouse1 again within 20 frames, rapid sticky will start, otherwise change back to normal fire.
alias -stickyfire "-attack; -rapidfire; alias +stickyfire +rapidfire; wait 20; alias +stickyfire sfar"
// Standard autoreload
alias sfar "-reload; +attack"
// Standard auto fire script
alias +rapidfire "-reload; alias rfrepeat rfloop; rfloop"
alias -rapidfire "alias rfrepeat +reload"
alias rfrepeat "+attack; wait 15; -attack; wait 5; rfrepeat"
The autofiring works perfect however when I want to launch a single sticky or charge one, it gets 'stuck' on charging (I let go of mouse1 but it keeps charging instead of launching the sticky). The only way to unstuck it is to make it rapidfire the stickylauncher by doubleclicking.
After about 4 hours of testing I give up... Does anyone see any errors that might cause this?
EDIT: Added comments and made thread title and description better