The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire - for Free!

Maps, modifications, add-ons, projects, and other releases for Zandronum. Also includes announcers.
Post Reply
MaxRideWizardLord
Registered just to make one post
Posts: 1
Joined: Sat Jul 11, 2015 9:07 pm

The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire - for Free!

#1

Post by MaxRideWizardLord » Sun Jul 12, 2015 12:07 am

Hello people of Zandronum.

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
Just copy the text in the quotes, open your zandronum-username.ini in your ZandroDev folder, and paste it under your [Doom.ConsoleAliases] paragraph (use ctrl+f if you struggle to find it). Click "Save the Changes" and now you have the script installed. Make sure you're not in the game while doing this process, though.

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.
Last edited by MaxRideWizardLord on Mon Aug 17, 2015 10:14 pm, edited 1 time in total.

User avatar
Ænima
Addicted to Zandronum
Posts: 3523
Joined: Tue Jun 05, 2012 6:12 pm

RE: The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire - for Free!

#2

Post by Ænima » Sun Jul 12, 2015 3:27 am

Neato. I'm gonna bind these to my PS3 controller so it'll feel like the good old days of turbo controllers. Then I'll try it with every mod that uses +Weapon.NOAUTOFIRE, including my own.
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !


ZandroSkins
: a pack made by our community

Lord Smash
 
Posts: 39
Joined: Sat May 09, 2015 10:39 pm
Location: In the magical land of Whatever

RE: The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire

#3

Post by Lord Smash » Sun Jul 12, 2015 4:01 pm

This will surely be useful
Thanks a lot :razz:

User avatar
Ivan
Addicted to Zandronum
Posts: 2219
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire - for Free!

#4

Post by Ivan » Sun Jul 12, 2015 5:57 pm

tl;dr it makes you fire constantly? That's already possible. Click fire while pressing your talk key and press ESC. You'll keep firing.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
Empyre
Zandrone
Posts: 1316
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

RE: The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire - for Free!

#5

Post by Empyre » Sun Jul 12, 2015 6:37 pm

No, this will act like you're pressing fire repeatedly several time a second for as long as you hold the fire button, useful for those mods with weapons that don't repeat when you hold the fire button.
"For the world is hollow, and I have touched the sky."

User avatar
Dastan
 
Posts: 63
Joined: Sun Jun 22, 2014 5:44 pm
Clan: Lost Faction
Clan Tag: LF

RE: The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire - for Free!

#6

Post by Dastan » Wed Jul 15, 2015 12:35 am

Thanks a lot for making this, it's helpful!
Wish you the best with your next projects. :wink:
I'm dangerous, passionate.
Watch your back they're stabbing it.

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

Possible workaround

#7

Post by Klofkac » Wed Jul 15, 2015 12:45 pm

I have found a way how to get 1 tic delay even through this wait bug. The downside is though that the initial command delay will always be 2 tics no matter what.
Zandronum has an "exec" command, that parses a file and reads it as commands. All commands on their respective lines are run independently, the semicolon still works like in aliases.

So, with this knowledge, I created slightly different version of the autofiring aliases:

Code: Select all

name=+autoattack
command=set is_firing 1;+attack;exec attack.txt
name=-autoattack
command=set is_firing 0;wait;-attack
name=+autoaltattack
command=set is_altfiring 1;+altattack;exec altattack.txt
name=-autoaltattack
command=set is_altfiring 0;wait;-altattack

Code: Select all

wait;-attack; test $is_firing "exec attack.txt" 
wait 2;+attack

Code: Select all

wait;-altattack; test $is_altfiring "exec altattack.txt" 
wait 2;+altattack
The difference between +attack and -attack will be 1 tic. Delay between first and second attack should be 2 tics.
So, this should work just like the code in OP, but slightly less complicated coding-wise.

Only downside is, you need an external file for this to work.

It is (or should be) compatibile with the above toggler aliases.
Last edited by Klofkac on Wed Jul 15, 2015 1:28 pm, edited 1 time in total.
𝕂𝕝𝕠𝕗𝕜𝕒𝕔

User avatar
agaures
Forum Regular
Posts: 591
Joined: Mon Dec 10, 2012 6:34 am
Location: New Zealand

RE: The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire - for Free!

#8

Post by agaures » Wed Jul 15, 2015 2:54 pm

You know... autoclicker is a thing...
<agaures> I'm guessing you haven't played many doom mods before huh? :p
<Zuplin> i have played master of puppets zombies doom center and a couple more
<agaures> so not many
<Zuplin> i thought that was everything

User avatar
Ænima
Addicted to Zandronum
Posts: 3523
Joined: Tue Jun 05, 2012 6:12 pm

RE: The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire - for Free!

#9

Post by Ænima » Wed Jul 15, 2015 5:06 pm

agaures wrote: You know... autoclicker is a thing...
Oh yeah. Input macro software works too.
­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !


ZandroSkins
: a pack made by our community

Zanieon
Forum Regular
Posts: 227
Joined: Tue Jun 05, 2012 1:17 am
Location: Somewhere in the future
Contact:

RE: The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire - for Free!

#10

Post by Zanieon » Sun Aug 16, 2015 10:51 pm

Hum, bumping this to say that this script doesn't work like Autoclicker or either Input Macro, the script only executes while you hold the button and is switchable.

For me, this is more flexible and better controlled by the user than Autoclicker.

Also welcome to the forums dude (1 post epic-win title)
Image

[DD]Aladdin
New User
Posts: 5
Joined: Tue Aug 07, 2012 12:20 pm

RE: The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire - for Free!

#11

Post by [DD]Aladdin » Mon Aug 17, 2015 12:29 am

Nice Work body keep going
Last edited by [DD]Aladdin on Mon Aug 17, 2015 12:29 am, edited 1 time in total.

Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

RE: The Perfect-Working Zandronum Toggleable Turbo Button Script For Autofire - for Free!

#12

Post by Konda » Mon Aug 17, 2015 2:02 am

Klofkac wrote: I have found a way how to get 1 tic delay even through this wait bug. The downside is though that the initial command delay will always be 2 tics no matter what.
Zandronum has an "exec" command, that parses a file and reads it as commands. All commands on their respective lines are run independently, the semicolon still works like in aliases.

So, with this knowledge, I created slightly different version of the autofiring aliases:

Code: Select all

name=+autoattack
command=set is_firing 1;+attack;exec attack.txt
name=-autoattack
command=set is_firing 0;wait;-attack
name=+autoaltattack
command=set is_altfiring 1;+altattack;exec altattack.txt
name=-autoaltattack
command=set is_altfiring 0;wait;-altattack

Code: Select all

wait;-attack; test $is_firing "exec attack.txt" 
wait 2;+attack

Code: Select all

wait;-altattack; test $is_altfiring "exec altattack.txt" 
wait 2;+altattack
The difference between +attack and -attack will be 1 tic. Delay between first and second attack should be 2 tics.
So, this should work just like the code in OP, but slightly less complicated coding-wise.

Only downside is, you need an external file for this to work.

It is (or should be) compatibile with the above toggler aliases.
Another advantage of this script is the fact that it doesn't automatically bind the user's controls like in OP. I think I'll take both scripts posted here and use yours until the bug it utilizes is fixed, hopefully the wait bug will also be fixed around the same time.

Also I'm wondering if something like this can contribute to being kicked for client command flood.

Code: Select all

<Synert> fuck
<Synert> plugged in my memory stick and got a bsod

Post Reply