Are you tired of heartlessly smashing your computer mouse buttons till your fingers start bleeding, and then buying new computer mouse over and over because of how often some crappy mods like demonsteele requires way too much intense clicking? Not anymore!
I'd like to introduce you to my toggleable turbo button for autofire that works both for primary attack and alt attack and is quite smooth, even on Zandronum!
Code: Select all
Name=toggleautofire
Command=toggleautofireon
Name=toggleautofireon
Command=bind mouse1 "+autoattack";bind mouse2 "+autoaltattack";echo "auto-attack on";alias toggleautofire toggleautofireoff"
Name=toggleautofireoff
Command=bind mouse1 "+attack";bind mouse2 "+altattack";echo "auto-attack off";alias toggleautofire toggleautofireon"
Name=+autoattack
Command=alias autoattack_+fire "+attack;wait;autoattack_+fire";alias autoattack_-fire "-attack;wait;autoattack_-fire";autoattack_+fire;wait 2;autoattack_-fire
Name=-autoattack
Command=alias autoattack_+fire "";alias autoattack_-fire "";wait 2;-attack
Name=+autoaltattack
Command=alias autoaltattack_+fire "+altattack;wait;autoaltattack_+fire";alias autoaltattack_-fire "-altattack;wait;autoaltattack_-fire";autoaltattack_+fire;wait 2;autoaltattack_-fire
Name=-autoaltattack
Command=alias autoaltattack_+fire "";alias autoaltattack_-fire "";wait 2;-altattack
After you've done that, you can simple bind the "toggleautofire" command to any of your buttons through the console. For example - write "bind mouse3 toggleautofire" if you want to bind it to middle wheel mouse button. So now you have it!
Once you push the button you bind with "toggleautofire", at the left top of the screen it will say "auto-attack on", means your left and right mouse buttons are now turbo. If you push the binded button with the "toggleautofire", it will say "auto-attack off", and your left and right mouse button will be set back to default +attack and +altattack with default attack mode.
I've made it to be a toggleable button for a good reason, so in case you have normal classic computer mouse and normal classic keyboard, you wouldn't have much of extra buttons in order to bind this thing. However, in case you have quite expensive mouse with lots of extra buttons, you can bind the turbo attacks to them separately: +autoattack for primary fire and +autoaltattack for secondary fire.
Unfortunately, Zandronum has this unpleasant issue with wait command which causes every wait to have +1 extra tic, which causes the wait command have extra +1 tic for each wait, which results wait to behave like this: wait = 2 tic; wait 2 = 3 tic, wait 3 = 4 tic and etc.
I know I'm not the first one who did attempt at making this turbo script, but often they happened to be lousy as they have way too big delay before each 'fire'. I've spend fairly amount of time to figure out how to make my aliasing be more smooth, but the idea of how to upgrade my script become more clear after I found out about the wait "+1" issue. The script now works pretty smooth and have behavior like this: it 'fires' at 0th tic, 2th tic, 3th tic, 4th tic, 5th tic, 6th tic, 7th tic and every single tic afterwards as long as you hold the 'fire' button. Unfortunately it's impossible to make the script fire at 1th tic due the above mentioned "wait +1" bug.
Note: the 1 tic is 1/35 of one second, wait 1 has = 1 (+1) tic, means that wait 34 = one second delay.
Special thanks goes to #Zandronum IRC channel, specifically Leonard to let me know about this infamous "wait +1" bug that still remain in current Zandronum. However, is it fixed in the last beta version of Gzdoom. I've heard that you may as well fix the "wait +1" bug manually yourself, but this may result of you being unable to connect to most of the modded servers, or result the wait command of certain mods not work as intended, so I'd suggest better to not risk. Once the issue will be fixed, I will try to simplify the script code.