• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code [Help] Simple bind in User.ini

Eisbaer

Grizzled Veteran
Nov 10, 2012
116
0
First of all: Hello and thanks for taking the time. :)

What I want to do:
I want to run with the knife out and on keystroke throw away every weapon, all my dosh, switch to the 9mm pistol and then issue the suicide command.

Old Idea:
Spoiler!

Algorithm:
1. Throw all the cash (which should never be more than 9999).
2. Switch to best weapon which is either the strongest onperk weapon or if there is no onperk weapon the strongest offperk weapon (If you only have the knife and 9mm pistol it will select the pistol).
6. Throw away every throwable weapon until the 9mm pistol is selected.
7. Suicide.

Code:
<keyhere>=tosscash 9999 | SwitchToBestWeapon | throwweapon | throwweapon | throwweapon | throwweapon | throwweapon | throwweapon | throwweapon | throwweapon | throwweapon | throwweapon | suicide

Reasoning for new algorithm:
Spoiler!


Problem:
It seems like the switching animation is taking too long and the suicide and throw dosh commands are issued before the switch is complete. When I have the knife out while pressing the key, no weapons will be thrown and the last weapon in my hand is the knife. Therefore it will be dropped instead of the 9mm pistol.

Any idea for a workaround or a better algorithm? Maybe a method to wait for example one second for the next command would solve the problem, but I have not found any.
And yes, I could manually switch to a throwable weapon and then press the key or if I don't have any to the 9mm pistol, but that takes longer. Ideally I want it to do every scenario automatically just by pressing one button.

Any feedback is greatly appreciated!
 
Last edited:
lol'd at the usage of the word "algorithm" instead of just key binding.

Anyways, there's a maximum to what you can do per key bind. This is because your client (and the server) will interpret the command very quickly.

Your best option would be to do something like this:
Code:
throwweapon | SwitchToBestWeapon
and change your suicide bind to
Code:
tosscash 100000 | suicide
.

All you have to do then is mash your weapon dropper then suicide when you've dropped all of your good stuff.

I'm not 100% sure of the behaviour of throwweapon and SwitchToBestWeapon so you may want to switch the order back around if what I wrote doesn't work correctly.
 
Upvote 0
lol'd at the usage of the word "algorithm" instead of just key binding.
Algorithm means describing what you want the code to do with words or am I wrong?


Thanks for the other input, I actually found some kind of way to do it...
Code:
<keyhere>=SwitchToBestWeapon | OnRelease throwweapon | OnRelease throwweapon | OnRelease throwweapon | OnRelease throwweapon | OnRelease throwweapon | OnRelease throwweapon | OnRelease throwweapon | OnRelease throwweapon | OnRelease throwweapon | OnRelease throwweapon | OnRelease tosscash 9999 |  OnRelease suicide
It works, but not perfectly. Now when you press and hold the button it changes to the best weapon, then you release it and it throws the weapon and changes to the next... and so forth. That works, but only for one throwable weapon. When I have more than one (i.e. dual handcannons) it will throw the first handcannon, change to the second but the suicide command is executed before the animation finishes again but it is the last weapon I have in my hands so I drop it anyways on death. That way the 9mm pistol won't be dropped though. So basically I could just remove all extra "throwweapon" commands and just leave a single one in there... There will never be more than one weapon thrown.
(I have not tested with huge numbers of throwweapon commands... But if it is like you say and you can bind only a couple of commands then I guess the testing is not even needed. And that way would be a huge spam anyways.)

Edit: For the weapon drop on death the switchweapon animation does not need to be finished, it works anyways.
 
Last edited:
Upvote 0
Gotta love me some constructive feedback.
Here let me quote myself from the first post since you apparently did not read it:
And yes, I could manually switch to a throwable weapon and then press the key or if I don't have any to the 9mm pistol, but that takes longer. Ideally I want it to do every scenario automatically just by pressing one button.
 
Upvote 0