A Useful Extension For Romano's Lastinv
Uzguz
Join Date: 2003-06-05 Member: 17016Members, Constellation
Until quite recently, I had been using a lastinv script of my own designing. However, eventually, I had to concede that, because of its layout, it was simply too slow (it has a good coding structure, but runs too many commands). Thus, I decided to make the switch to romano's, which, while perhaps lacking in programming ethics, proved to be noticeably faster. However, I had become quite accustomed to an extra feature of my lastinv script not featured in romano's - a reset function. So, when I installed it, I added this feature to the existing script. While I was at it, I changed all of the commands that are actually bound to keys to use the +/- structure, to prevent the commands from being spammed when the key is held down for too long. Here's the result:
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->// Romano's Lastinv script without mousewheel support
// Extended to include +/- floodguards and the reset functionality from my lastinv script
// Executing this config will setup all necessary binds
alias +kk1a "kkslot1"
alias +kk1b "kkslot1; bind q +kk2a"
alias +kk1c "kkslot1; bind q +kk3a"
alias +kk1d "kkslot1; bind q +kk4a"
alias -kk1a ""
alias -kk1b ""
alias -kk1c ""
alias -kk1d ""
alias kkslot1 "slot1; bind 1 +kk1a; bind 2 +kk2a; bind 3 +kk3a; bind 4 +kk4a"
alias +kk2a "kkslot2; bind q +kk1b"
alias +kk2b "kkslot2"
alias +kk2c "kkslot2; bind q +kk3b"
alias +kk2d "kkslot2; bind q +kk4b"
alias -kk2a ""
alias -kk2b ""
alias -kk2c ""
alias -kk2d ""
alias kkslot2 "slot2; bind 1 +kk1b; bind 2 +kk2b; bind 3 +kk3b; bind 4 +kk4b"
alias +kk3a "kkslot3; bind q +kk1c"
alias +kk3b "kkslot3; bind q +kk2c"
alias +kk3c "kkslot3"
alias +kk3d "kkslot3; bind q +kk4c"
alias -kk3a ""
alias -kk3b ""
alias -kk3c ""
alias -kk3d ""
alias kkslot3 "slot3; bind 1 +kk1c; bind 2 +kk2c; bind 3 +kk3c; bind 4 +kk4c"
alias +kk4a "kkslot4; bind q +kk1d"
alias +kk4b "kkslot4; bind q +kk2d"
alias +kk4c "kkslot4; bind q +kk3d"
alias +kk4d "kkslot4"
alias -kk4a ""
alias -kk4b ""
alias -kk4c ""
alias -kk4d ""
alias kkslot4 "slot4; bind 1 +kk1d; bind 2 +kk2d; bind 3 +kk3d; bind 4 +kk4d"
// Uzguz's awesome reset feature
alias kkra "kkslot1; bind q +kk1a"
alias kkrb "kkslot1; bind q +kk2a"
alias kkrc "kkslot1; bind q +kk3a"
alias kkrd "kkslot1; bind q +kk4a"
alias +kkrsa "alias +lastinv_reset kkra; alias lastinv_reset kkra"
alias +kkrsb "alias +lastinv_reset kkrb; alias lastinv_reset kkrb"
alias +kkrsc "alias +lastinv_reset kkrc; alias lastinv_reset kkrc"
alias +kkrsd "alias +lastinv_reset kkrd; alias lastinv_reset kkrd"
alias -kkrsa ""
alias -kkrsb ""
alias -kkrsc ""
alias -kkrsd ""
alias kkrsa "alias +lastinv_reset kkra; alias lastinv_reset kkra"
alias kkrsb "alias +lastinv_reset kkrb; alias lastinv_reset kkrb"
alias kkrsc "alias +lastinv_reset kkrc; alias lastinv_reset kkrc"
alias kkrsd "alias +lastinv_reset kkrd; alias lastinv_reset kkrd"
// The actual reset alias is given a generic name for compatibility with
// Uzguz's team-join configs (they rebind mouse2, which, for Aliens, is +lastinv_reset).
alias +lastinv_reset "kkrb"
alias -lastinv_reset ""
alias lastinv_reset "kkrb" // Standalone version for other weapon-switch-related configs
alias lastinv_reinit "kkrb; alias +lastinv_reset kkrb; alias lastinv_reset kkrb" // For use in team-join configs
bind q "+kk2a"
bind 1 "+kk1a"
bind 2 "+kk2a"
bind 3 "+kk3a"
bind 4 "+kk4a"
bind DefaultBufferChangeKey1 "+kkrsa"
bind DefaultBufferChangeKey2 "+kkrsb"
bind DefaultBufferChangeKey3 "+kkrsc"
bind DefaultBufferChangeKey4 "+kkrsd"
bind ResetKey "+lastinv_reset"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Of course, you'll need to change the last five keys yourself. As the comment suggests, binding a mouse button to +lastinv_reset is quite handy.
As for how the reset function works, it's really quite simple. When the config is executed, or whenever +lastinv_reset or lastinv_reset are called, the current weapon is changed to slot1, and the buffered weapon is set to whatever the current default buffer is - the default default buffer (<!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin-fix.gif' border='0' style='vertical-align:middle' alt='biggrin-fix.gif' /><!--endemo-->) is slot2, so this calls kkrb, which changes to slot1 and rebinds the keys as though slot2 was the previous weapon. The default buffer can be changed with the +kkrsa - +kkrsd commands, which should be mapped to the keyboard somewhere convenient. Changing the default buffer doesn't affect the current setup, only what happens when +lastinv_reset or lastinv_reset is called. Finally, if you use team-join configs, they should call kkrb, and alias +lastinv_reset and lastinv_reset to the same - this will reset the script whenever you join a team.
If you need to ask anything, feel free to do so; otherwise, enjoy! <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin-fix.gif' border='0' style='vertical-align:middle' alt='biggrin-fix.gif' /><!--endemo-->
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->// Romano's Lastinv script without mousewheel support
// Extended to include +/- floodguards and the reset functionality from my lastinv script
// Executing this config will setup all necessary binds
alias +kk1a "kkslot1"
alias +kk1b "kkslot1; bind q +kk2a"
alias +kk1c "kkslot1; bind q +kk3a"
alias +kk1d "kkslot1; bind q +kk4a"
alias -kk1a ""
alias -kk1b ""
alias -kk1c ""
alias -kk1d ""
alias kkslot1 "slot1; bind 1 +kk1a; bind 2 +kk2a; bind 3 +kk3a; bind 4 +kk4a"
alias +kk2a "kkslot2; bind q +kk1b"
alias +kk2b "kkslot2"
alias +kk2c "kkslot2; bind q +kk3b"
alias +kk2d "kkslot2; bind q +kk4b"
alias -kk2a ""
alias -kk2b ""
alias -kk2c ""
alias -kk2d ""
alias kkslot2 "slot2; bind 1 +kk1b; bind 2 +kk2b; bind 3 +kk3b; bind 4 +kk4b"
alias +kk3a "kkslot3; bind q +kk1c"
alias +kk3b "kkslot3; bind q +kk2c"
alias +kk3c "kkslot3"
alias +kk3d "kkslot3; bind q +kk4c"
alias -kk3a ""
alias -kk3b ""
alias -kk3c ""
alias -kk3d ""
alias kkslot3 "slot3; bind 1 +kk1c; bind 2 +kk2c; bind 3 +kk3c; bind 4 +kk4c"
alias +kk4a "kkslot4; bind q +kk1d"
alias +kk4b "kkslot4; bind q +kk2d"
alias +kk4c "kkslot4; bind q +kk3d"
alias +kk4d "kkslot4"
alias -kk4a ""
alias -kk4b ""
alias -kk4c ""
alias -kk4d ""
alias kkslot4 "slot4; bind 1 +kk1d; bind 2 +kk2d; bind 3 +kk3d; bind 4 +kk4d"
// Uzguz's awesome reset feature
alias kkra "kkslot1; bind q +kk1a"
alias kkrb "kkslot1; bind q +kk2a"
alias kkrc "kkslot1; bind q +kk3a"
alias kkrd "kkslot1; bind q +kk4a"
alias +kkrsa "alias +lastinv_reset kkra; alias lastinv_reset kkra"
alias +kkrsb "alias +lastinv_reset kkrb; alias lastinv_reset kkrb"
alias +kkrsc "alias +lastinv_reset kkrc; alias lastinv_reset kkrc"
alias +kkrsd "alias +lastinv_reset kkrd; alias lastinv_reset kkrd"
alias -kkrsa ""
alias -kkrsb ""
alias -kkrsc ""
alias -kkrsd ""
alias kkrsa "alias +lastinv_reset kkra; alias lastinv_reset kkra"
alias kkrsb "alias +lastinv_reset kkrb; alias lastinv_reset kkrb"
alias kkrsc "alias +lastinv_reset kkrc; alias lastinv_reset kkrc"
alias kkrsd "alias +lastinv_reset kkrd; alias lastinv_reset kkrd"
// The actual reset alias is given a generic name for compatibility with
// Uzguz's team-join configs (they rebind mouse2, which, for Aliens, is +lastinv_reset).
alias +lastinv_reset "kkrb"
alias -lastinv_reset ""
alias lastinv_reset "kkrb" // Standalone version for other weapon-switch-related configs
alias lastinv_reinit "kkrb; alias +lastinv_reset kkrb; alias lastinv_reset kkrb" // For use in team-join configs
bind q "+kk2a"
bind 1 "+kk1a"
bind 2 "+kk2a"
bind 3 "+kk3a"
bind 4 "+kk4a"
bind DefaultBufferChangeKey1 "+kkrsa"
bind DefaultBufferChangeKey2 "+kkrsb"
bind DefaultBufferChangeKey3 "+kkrsc"
bind DefaultBufferChangeKey4 "+kkrsd"
bind ResetKey "+lastinv_reset"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Of course, you'll need to change the last five keys yourself. As the comment suggests, binding a mouse button to +lastinv_reset is quite handy.
As for how the reset function works, it's really quite simple. When the config is executed, or whenever +lastinv_reset or lastinv_reset are called, the current weapon is changed to slot1, and the buffered weapon is set to whatever the current default buffer is - the default default buffer (<!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin-fix.gif' border='0' style='vertical-align:middle' alt='biggrin-fix.gif' /><!--endemo-->) is slot2, so this calls kkrb, which changes to slot1 and rebinds the keys as though slot2 was the previous weapon. The default buffer can be changed with the +kkrsa - +kkrsd commands, which should be mapped to the keyboard somewhere convenient. Changing the default buffer doesn't affect the current setup, only what happens when +lastinv_reset or lastinv_reset is called. Finally, if you use team-join configs, they should call kkrb, and alias +lastinv_reset and lastinv_reset to the same - this will reset the script whenever you join a team.
If you need to ask anything, feel free to do so; otherwise, enjoy! <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin-fix.gif' border='0' style='vertical-align:middle' alt='biggrin-fix.gif' /><!--endemo-->
Comments
Lets say I press 2-1-2 as a skulk, I parasite the enemy, lastinv, I get : LEAP!
Whatever
<a href='http://www.unknownworlds.com/forums/index.php?showtopic=84353&view=findpost&p=1312710' target='_blank'>http://www.unknownworlds.com/forums/index....dpost&p=1312710</a>
I would add something relevant and interesting to this discussion but I have never used, and do not intend to, use romano's lastinv. I never use lastinv because it's not flexible enough in my opinion.
I just use hud_fastswitch 1 and slot keys.
oh and :
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
alias +s3 "slot3"
alias -s3 "lastinv"
bind mouse2 +s3
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
good for leaping and the occasional knife slash
also in servers where i get 300 ping i notice even in beta 5 that the lastinv command lags for me.
romanos is good in combination with things, like for fade having a key to meta and lastinv w/o breaking your current two lastinv keys ( blink/swipe )