r/Tf2Scripts • • Aug 06 '18

Answered +attack not working with MWHEELUP/DOWN

+attack and other +/- commands don't seem to work with MWHEELUP/MWHEELDOWN when referenced via an alias.

These both work. I attack when I move the mouse wheel down, and I jump when I move it up:

bind MWHEELDOWN +attack
bind MWHEELUP +jump

This doesn't work, though:

alias +test "+attack; echo foo;"
alias -test "-attack; echo bar;"
bind MWHEELUP +test

The echo calls register, but the +attack doesn't.

Is this something y'all have known about? Can others confirm this behavior?

Here's a screenshot after moving the mouse wheel up. Note that my character didn't jump:

4 Upvotes

12 comments sorted by

View all comments

Show parent comment

1

u/reedworth Aug 06 '18

Thanks for helping me work on this. I think you updated your alias names (now bot and nobot) but not the bindings? Just clarifying that I understand your intention.

The problem with this:

alias bot "+attack"
bind MWHEELUP bot

...is that -attack never gets executed, so you're stuck in a "button held" position. This is why the we're required to make both +/- states for our alias. The Wiki explains more.

So I don't think that this is the answer. Let me know what you think, though.

1

u/LingLingLang Aug 06 '18

I tested it more and I see what you're saying.

bind MWHEELUP +attack

features an implicit -attack that triggers after some kind of cooldown. While:

alias +var +attack
bind MWHEELUP +var

doesn't execute the implicit -attack, and then

alias +var "+attack"
alias -var "-attack"
bind MWHEELUP +var

never even executes the +attack.

I don't know why the introduction of an alias nullifies the implicit -alias on MWHEELUP. I need to tinker with it more when I have time.

That being said, there is an easy workaround if you're willing to use "wait".

alias var "+attack; wait 15; -attack"
bind MWHEELUP var  

1

u/reedworth Aug 06 '18

Yeah I hadn't thought about using wait. I was wondering if maybe it was my mouse/hardware? Maybe we can get more people to confirm this behavior.