It makes extensive use of simple math. It has an execution stack. Weapons currently fired (by holding down the button) are being saved in a cvar. If button gets released, the weapon is deleted from the stack. It will always pop the latest weapon of the stack into your hand while firing. It will never block and cease firing when weapon-button is pressed.
An example for what it really does:
You can press and HOLD the buttons in a row:
First, you press RL, hold it, it fires RL.
Then press LG, hold it, it fires LG.
Then press GL, hold it, it fires GL.
Then press SNG, hold it, it fires SNG now.
At this time, you hold 4 buttons! - this won't happen in real, but the script can even handle 9 firing-buttons pressed at a time.
Now.. to the proof:
Release SNG button. It fires GL now - because it remembered the series .. remember, you still hold RL, LG and GL
Now, release LG, it still fires GL, because it's the last button in the series that is still active and you still hold it.
Release GL, and then it fires RL..
Whilst the whole process it never blocked the firing!
So .. why all the hassle? Because I can. It's the best non-blocking weapon script ever made.
For more info on crazyness, set h_debug 1 in the script there.
Now, to the .. history:
First it looked more like this... (warning, the following snippet does not work by copy&paste)
alias +h_quick5 "h_weapon5; set h_firing 5; +attack"
alias -h_quick5 "if $h_firing == 5 h_quick5over"
alias h_quick5over "-attack; h_3backweapon"
bind alt "+h_quick5"
alias +h_quick4 "noaim 0; h_weapon3; set h_firing 3; +attack"
alias -h_quick4 "if $h_firing == 3 h_quick4over"
alias h_quick4over "-attack; h_3backweapon; noaim 1"
bind shift "+h_quick4"
alias +h_quick3 "h_weapon8; set h_firing 8; h_shaftzoom; h_shaftsens; h_shaftcross; h_shaftcrosssize; h_debugsens; +attack"
alias -h_quick3 "if $h_firing == 8 h_quick3over; h_normsens; h_normfov; h_normcross; h_normcrosssize; h_debugsens"
alias h_quick3over "-attack; h_8backweapon"
bind ctrl "+h_quick3"
alias +h_quick2 "h_weapon6; set h_firing 6; +attack"
alias -h_quick2 "if $h_firing == 6 h_quick2over"
alias h_quick2over "-attack; h_6backweapon"
bind space "+h_quick2"
alias +h_quick1 "h_weapon7; set h_firing 7; +attack"
alias -h_quick1 "if $h_firing == 7 h_quick1over"
alias h_quick1over "-attack; h_7backweapon"
bind mouse1 "+h_quick1"
..But then, I thought, this can be real great stuff! Fuck mordor, I simply walk there and pitch a tent!:
// weapons
alias h_weapon "" // fake alias
alias h_weapon1 "impulse 1 2 3 5 8 4"
alias h_weapon2 "impulse 2 3 8 1"
alias h_weapon3 "impulse 3 2 8 1"
alias h_weapon4 "impulse 4 5 8 3 2 1"
alias h_weapon5 "impulse 5 3 8 4 2 1"
alias h_weapon6 "impulse 6 8 5 3 4 2 1" // insecure
alias h_weapon7 "impulse 7 8 5 3 4 2 1" // insecure
alias h_weapon8 "impulse 8 5 3 4 2 1"
///////////////////////////////////////////////////////////////////////
set h_debug 0 // for debug
set pushstr "0" // for debug always init with 0
// calculates h_multi which is the multiplyer for addition or deletion
alias h_calcmulti "if %1 == 0 then set h_multi 1; if %1 == 1 then set h_multi 10; if %1 == 2 then set h_multi 100; if %1 == 3 then set h_multi 1000; if %1 == 4 then set h_multi 10000; if %1 == 5 then set h_multi 100000; if %1 == 6 then set h_multi 1000000; if %1 == 7 then set h_multi 10000000; if %1 == 8 then set h_multi 100000000"
// pushes a value to %1
alias h_push "set_calc h_tmp strlen $%1; h_calcmulti $h_tmp; set_calc h_tmp $h_multi * %2; set_calc %1 $%1 + $h_tmp; if $h_debug == 1 echo pushed %2 into %1, now: $%1"
// saves pop value to h_popped
alias h_pop "set_calc h_popped substr %1 0 2; set_calc h_tmp strlen $%1; set_calc h_tmp $h_tmp - 1; h_calcmulti $h_tmp; set_calc h_tmp $h_multi * $h_popped; set_calc %1 $%1 - $h_tmp; if $h_debug == 1 echo popped $h_popped from %1. %1 now $%1"
// saves topmost value to h_topped
alias h_top "set_calc h_topped substr %1 0 2"
// decrease by "50" or "500" .. or whatever
alias h_replace "set_calc h_tmppos pos %1 %2; set_calc h_tmplen strlen $%1; set_calc h_tmp $h_tmplen - $h_tmppos; set_calc h_tmp $h_tmp - 1; h_calcmulti $h_tmp; set_calc h_tmpval $h_multi * %2; set_calc %1 $%1 - $h_tmpval; set h_npos $h_tmppos; if $h_npos > 0 then h_priv_replacenext %1"
alias h_priv_replacenext "set_calc h_npos $h_npos - 1; set_calc h_nnum substr %1 $h_npos 2; set_calc h_tmplen strlen $%1; set_calc h_tmp $h_tmplen - $h_npos; set_calc h_tmp $h_tmp - 1; h_calcmulti $h_tmp; set_calc h_tmpval $h_multi * $h_nnum; set_calc %1 $%1 - $h_tmpval; set_calc h_tmp $h_tmp - 1; h_calcmulti $h_tmp; set_calc h_tmpval $h_multi * $h_nnum; set_calc %1 $%1 + $h_tmpval; if $h_npos > 0 then h_priv_replacenext %1 else if $h_debug == 1 then echo deleted %2 so %1 now: $%1"
h_push pushstr 7 // for debug
h_push pushstr 5 // for debug
h_push pushstr 6 // for debug
h_push pushstr 9 // for debug
//h_pop pushstr // for debug
//echo pop: $h_popped // for debug
//h_push pushstr 9 // for debug
//h_pop pushstr // for debug
//echo pop: $h_popped // for debug
alias h_weaponpop "h_top h_firingstack; h_weapon$h_topped"
set h_firing 0
set h_firingstack "0"
alias +h_quick5 "h_weapon5; inc h_firing 1; h_push h_firingstack 5; +attack"
alias -h_quick5 "inc h_firing -1; h_replace h_firingstack 5; h_weaponpop; if $h_firing == 0 then h_quick5over"
alias h_quick5over "-attack; h_3backweapon"
alias +h_quick4 "noaim 0; h_weapon3; inc h_firing 1; h_push h_firingstack 3; +attack"
alias -h_quick4 "inc h_firing -1; h_replace h_firingstack 3; h_weaponpop; if $h_firing == 0 then h_quick4over"
alias h_quick4over "-attack; h_3backweapon; noaim 1"
alias +h_quick3 "h_weapon8; inc h_firing 1; h_shaftzoom; h_shaftsens; h_shaftcross; h_shaftcrosssize; h_debugsens; h_push h_firingstack 8; +attack"
alias -h_quick3 "inc h_firing -1; h_replace h_firingstack 8; h_weaponpop; if $h_firing == 0 h_quick3over; h_normsens; h_normfov; h_normcross; h_normcrosssize; h_debugsens"
alias h_quick3over "-attack; h_8backweapon"
alias +h_quick2 "h_weapon6; inc h_firing 1; h_push h_firingstack 6; +attack"
alias -h_quick2 "inc h_firing -1; h_replace h_firingstack 6; h_weaponpop; if $h_firing == 0 then h_quick2over"
alias h_quick2over "-attack; h_6backweapon"
alias +h_quick1 "h_weapon7; inc h_firing 1; h_push h_firingstack 7; +attack"
alias -h_quick1 "inc h_firing -1; h_replace h_firingstack 7; h_weaponpop; if $h_firing == 0 then h_quick1over"
alias h_quick1over "-attack; h_7backweapon"
bind alt "+h_quick5" // SNG, NG .. see h_weapon5 above.
bind mouse1 "+h_quick1" // RL .. see h_weapon7 above.
bind space "+h_quick2" // GL h_weapon6
bind ctrl "+h_quick3" // LG h_weapon8
bind shift "+h_quick4" // SG, SSG h_weapon 3
bind mouse2 "+jump"
///////////////////////////////////////////////////////////////////////
sensitivity "1"
///////////////////////////////////////////////////////////////////////
alias h_debugsens "if $h_debug == 1 echo fov: $fov m_pitch: $m_pitch m_yaw: $m_yaw"
crosshairimage haudrauf
alias h_shaftcross "crosshair 3"
alias h_normcross "crosshair 3"
alias h_shaftcrosssize "crosshairsize 1"
alias h_normcrosssize "crosshairsize 1"
alias h_shaftzoom "fov 125" // - SHAFT FOV (zoom) //
alias h_shaftsens "m_pitch 0.044; m_yaw 0.039" // - WELCHE SENS BEI SHAFT? //
alias h_normfov "fov 125" // - NORMAL FOV //
alias h_normsens "m_pitch 0.085; m_yaw 0.048" // - WELCHE SENS NORMAL // -> sens 7 m_pitch 0.022 = m_pitch 0.154 bei sens 1
////////////////////////////////////////////////////////////////////////////////////////
alias dmm3-8backweapon "h_weapon5" //
alias dmm3-7backweapon "h_weapon2" // which weapon after firing in hand on DMM3?
alias dmm3-6backweapon "h_weapon5" //
alias dmm3-3backweapon "h_weapon2" //
////////////////////////////////////////////////////////////////////////////////////////
alias dmm1-8backweapon "h_weapon2" //
alias dmm1-7backweapon "h_weapon2" // which weapon after firing in hand on DMM1?
alias dmm1-6backweapon "h_weapon2" //
alias dmm1-3backweapon "h_weapon2" //
////////////////////////////////////////////////////////////////////////////////////////
alias h_8backweapon dmm1-8backweapon // for defaults
alias h_7backweapon dmm1-7backweapon
alias h_6backweapon dmm1-6backweapon
alias h_3backweapon dmm1-3backweapon
/////////////
And then, it came to my mind ... it's all easier using TCL. So, I implemented the same functionality with a TCL script. So, you can forget all the code above (although it's the cool part with a lot of brainfuck)!
Put the following contents into a .TCL file.
For a nicer look at the TCL visit: http://pastebin.com/2Jqekx55
set weaponstack ""
proc lremove {thelist value} {
set idx [lsearch -exact -all $thelist $value]
set idx [lsort -decreasing -integer $idx]
foreach _idx $idx {
set thelist [lreplace $thelist $_idx $_idx]
}
return $thelist
}
alias +h_quick {weapon} {
global weaponstack
lappend weaponstack $weapon
cmd h_weapon$weapon
if {$::h_debug == 1} {
cmd echo w: $weapon stack: $weaponstack
}
cmd +attack
}
alias -h_quick {weapon} {
global weaponstack
set weaponstack [lremove "$weaponstack" "$weapon"]
if {$::h_debug == 1} {
cmd echo "released w: $weapon stack: $weaponstack"
}
set itemcnt [llength $weaponstack]
if {$itemcnt == 0} {
cmd -attack
} else {
set next_in_stack [lindex $weaponstack end]
if {$::weaponnum != $next_in_stack} {
cmd h_weapon$next_in_stack
}
}
}
Then, still, the h_weapon1-8 aliases are missing. The TCL-script will call the h_weapon1-8 aliases according to the binds.
Put these h_weapon1-8 aliases into a normal config and have that config exec the TCL script:
// weapons
alias h_weapon "" // fake alias
alias h_weapon1 "impulse 1 2 3 5 8 4"
alias h_weapon2 "impulse 2 3 8 1"
alias h_weapon3 "impulse 3 2 8 1"
alias h_weapon4 "impulse 4 5 8 3 2 1"
alias h_weapon5 "impulse 5 3 8 4 2 1"
alias h_weapon6 "impulse 6 8 5 3 4 2 1" // insecure
alias h_weapon7 "impulse 7 8 5 3 4 2 1" // insecure
alias h_weapon8 "impulse 8 5 3 4 2 1"
// EXEC the TCL script
set h_debug 1
tcl_exec weapons.tcl
//////// BINDINGS
// SNG, NG .. see h_weapon5 above.
bind alt "+h_quick 5"
// RL .. see h_weapon7 above.
bind mouse1 "+h_quick 7"
// GL h_weapon6
bind space "+h_quick 6"
// LG h_weapon8
bind ctrl "+h_quick 8"
// SG, SSG h_weapon 3
cmd bind shift "+h_quick 3"
////////// So, when you press mouse1, the TCL script will call the alias "h_weapon7". And, on ctrl it starts "h_weapon8", and so on.
Of course, you may as well use your own weapon-switcher impulses on h_weapon1-8.
Now it's all set. You probably only need to re-bind the functions to your needs.
If you can make any sense out of this, you're quite entitled to use this script.
Have fun.
edit: Updated this first post to have every explanation needed to use it.
(Edited 2012-10-22, 22:51)
An example for what it really does:
You can press and HOLD the buttons in a row:
First, you press RL, hold it, it fires RL.
Then press LG, hold it, it fires LG.
Then press GL, hold it, it fires GL.
Then press SNG, hold it, it fires SNG now.
At this time, you hold 4 buttons! - this won't happen in real, but the script can even handle 9 firing-buttons pressed at a time.
Now.. to the proof:
Release SNG button. It fires GL now - because it remembered the series .. remember, you still hold RL, LG and GL
Now, release LG, it still fires GL, because it's the last button in the series that is still active and you still hold it.
Release GL, and then it fires RL..
Whilst the whole process it never blocked the firing!
So .. why all the hassle? Because I can. It's the best non-blocking weapon script ever made.
For more info on crazyness, set h_debug 1 in the script there.
Now, to the .. history:
First it looked more like this... (warning, the following snippet does not work by copy&paste)
alias +h_quick5 "h_weapon5; set h_firing 5; +attack"
alias -h_quick5 "if $h_firing == 5 h_quick5over"
alias h_quick5over "-attack; h_3backweapon"
bind alt "+h_quick5"
alias +h_quick4 "noaim 0; h_weapon3; set h_firing 3; +attack"
alias -h_quick4 "if $h_firing == 3 h_quick4over"
alias h_quick4over "-attack; h_3backweapon; noaim 1"
bind shift "+h_quick4"
alias +h_quick3 "h_weapon8; set h_firing 8; h_shaftzoom; h_shaftsens; h_shaftcross; h_shaftcrosssize; h_debugsens; +attack"
alias -h_quick3 "if $h_firing == 8 h_quick3over; h_normsens; h_normfov; h_normcross; h_normcrosssize; h_debugsens"
alias h_quick3over "-attack; h_8backweapon"
bind ctrl "+h_quick3"
alias +h_quick2 "h_weapon6; set h_firing 6; +attack"
alias -h_quick2 "if $h_firing == 6 h_quick2over"
alias h_quick2over "-attack; h_6backweapon"
bind space "+h_quick2"
alias +h_quick1 "h_weapon7; set h_firing 7; +attack"
alias -h_quick1 "if $h_firing == 7 h_quick1over"
alias h_quick1over "-attack; h_7backweapon"
bind mouse1 "+h_quick1"
..But then, I thought, this can be real great stuff! Fuck mordor, I simply walk there and pitch a tent!:
// weapons
alias h_weapon "" // fake alias
alias h_weapon1 "impulse 1 2 3 5 8 4"
alias h_weapon2 "impulse 2 3 8 1"
alias h_weapon3 "impulse 3 2 8 1"
alias h_weapon4 "impulse 4 5 8 3 2 1"
alias h_weapon5 "impulse 5 3 8 4 2 1"
alias h_weapon6 "impulse 6 8 5 3 4 2 1" // insecure
alias h_weapon7 "impulse 7 8 5 3 4 2 1" // insecure
alias h_weapon8 "impulse 8 5 3 4 2 1"
///////////////////////////////////////////////////////////////////////
set h_debug 0 // for debug
set pushstr "0" // for debug always init with 0
// calculates h_multi which is the multiplyer for addition or deletion
alias h_calcmulti "if %1 == 0 then set h_multi 1; if %1 == 1 then set h_multi 10; if %1 == 2 then set h_multi 100; if %1 == 3 then set h_multi 1000; if %1 == 4 then set h_multi 10000; if %1 == 5 then set h_multi 100000; if %1 == 6 then set h_multi 1000000; if %1 == 7 then set h_multi 10000000; if %1 == 8 then set h_multi 100000000"
// pushes a value to %1
alias h_push "set_calc h_tmp strlen $%1; h_calcmulti $h_tmp; set_calc h_tmp $h_multi * %2; set_calc %1 $%1 + $h_tmp; if $h_debug == 1 echo pushed %2 into %1, now: $%1"
// saves pop value to h_popped
alias h_pop "set_calc h_popped substr %1 0 2; set_calc h_tmp strlen $%1; set_calc h_tmp $h_tmp - 1; h_calcmulti $h_tmp; set_calc h_tmp $h_multi * $h_popped; set_calc %1 $%1 - $h_tmp; if $h_debug == 1 echo popped $h_popped from %1. %1 now $%1"
// saves topmost value to h_topped
alias h_top "set_calc h_topped substr %1 0 2"
// decrease by "50" or "500" .. or whatever
alias h_replace "set_calc h_tmppos pos %1 %2; set_calc h_tmplen strlen $%1; set_calc h_tmp $h_tmplen - $h_tmppos; set_calc h_tmp $h_tmp - 1; h_calcmulti $h_tmp; set_calc h_tmpval $h_multi * %2; set_calc %1 $%1 - $h_tmpval; set h_npos $h_tmppos; if $h_npos > 0 then h_priv_replacenext %1"
alias h_priv_replacenext "set_calc h_npos $h_npos - 1; set_calc h_nnum substr %1 $h_npos 2; set_calc h_tmplen strlen $%1; set_calc h_tmp $h_tmplen - $h_npos; set_calc h_tmp $h_tmp - 1; h_calcmulti $h_tmp; set_calc h_tmpval $h_multi * $h_nnum; set_calc %1 $%1 - $h_tmpval; set_calc h_tmp $h_tmp - 1; h_calcmulti $h_tmp; set_calc h_tmpval $h_multi * $h_nnum; set_calc %1 $%1 + $h_tmpval; if $h_npos > 0 then h_priv_replacenext %1 else if $h_debug == 1 then echo deleted %2 so %1 now: $%1"
h_push pushstr 7 // for debug
h_push pushstr 5 // for debug
h_push pushstr 6 // for debug
h_push pushstr 9 // for debug
//h_pop pushstr // for debug
//echo pop: $h_popped // for debug
//h_push pushstr 9 // for debug
//h_pop pushstr // for debug
//echo pop: $h_popped // for debug
alias h_weaponpop "h_top h_firingstack; h_weapon$h_topped"
set h_firing 0
set h_firingstack "0"
alias +h_quick5 "h_weapon5; inc h_firing 1; h_push h_firingstack 5; +attack"
alias -h_quick5 "inc h_firing -1; h_replace h_firingstack 5; h_weaponpop; if $h_firing == 0 then h_quick5over"
alias h_quick5over "-attack; h_3backweapon"
alias +h_quick4 "noaim 0; h_weapon3; inc h_firing 1; h_push h_firingstack 3; +attack"
alias -h_quick4 "inc h_firing -1; h_replace h_firingstack 3; h_weaponpop; if $h_firing == 0 then h_quick4over"
alias h_quick4over "-attack; h_3backweapon; noaim 1"
alias +h_quick3 "h_weapon8; inc h_firing 1; h_shaftzoom; h_shaftsens; h_shaftcross; h_shaftcrosssize; h_debugsens; h_push h_firingstack 8; +attack"
alias -h_quick3 "inc h_firing -1; h_replace h_firingstack 8; h_weaponpop; if $h_firing == 0 h_quick3over; h_normsens; h_normfov; h_normcross; h_normcrosssize; h_debugsens"
alias h_quick3over "-attack; h_8backweapon"
alias +h_quick2 "h_weapon6; inc h_firing 1; h_push h_firingstack 6; +attack"
alias -h_quick2 "inc h_firing -1; h_replace h_firingstack 6; h_weaponpop; if $h_firing == 0 then h_quick2over"
alias h_quick2over "-attack; h_6backweapon"
alias +h_quick1 "h_weapon7; inc h_firing 1; h_push h_firingstack 7; +attack"
alias -h_quick1 "inc h_firing -1; h_replace h_firingstack 7; h_weaponpop; if $h_firing == 0 then h_quick1over"
alias h_quick1over "-attack; h_7backweapon"
bind alt "+h_quick5" // SNG, NG .. see h_weapon5 above.
bind mouse1 "+h_quick1" // RL .. see h_weapon7 above.
bind space "+h_quick2" // GL h_weapon6
bind ctrl "+h_quick3" // LG h_weapon8
bind shift "+h_quick4" // SG, SSG h_weapon 3
bind mouse2 "+jump"
///////////////////////////////////////////////////////////////////////
sensitivity "1"
///////////////////////////////////////////////////////////////////////
alias h_debugsens "if $h_debug == 1 echo fov: $fov m_pitch: $m_pitch m_yaw: $m_yaw"
crosshairimage haudrauf
alias h_shaftcross "crosshair 3"
alias h_normcross "crosshair 3"
alias h_shaftcrosssize "crosshairsize 1"
alias h_normcrosssize "crosshairsize 1"
alias h_shaftzoom "fov 125" // - SHAFT FOV (zoom) //
alias h_shaftsens "m_pitch 0.044; m_yaw 0.039" // - WELCHE SENS BEI SHAFT? //
alias h_normfov "fov 125" // - NORMAL FOV //
alias h_normsens "m_pitch 0.085; m_yaw 0.048" // - WELCHE SENS NORMAL // -> sens 7 m_pitch 0.022 = m_pitch 0.154 bei sens 1
////////////////////////////////////////////////////////////////////////////////////////
alias dmm3-8backweapon "h_weapon5" //
alias dmm3-7backweapon "h_weapon2" // which weapon after firing in hand on DMM3?
alias dmm3-6backweapon "h_weapon5" //
alias dmm3-3backweapon "h_weapon2" //
////////////////////////////////////////////////////////////////////////////////////////
alias dmm1-8backweapon "h_weapon2" //
alias dmm1-7backweapon "h_weapon2" // which weapon after firing in hand on DMM1?
alias dmm1-6backweapon "h_weapon2" //
alias dmm1-3backweapon "h_weapon2" //
////////////////////////////////////////////////////////////////////////////////////////
alias h_8backweapon dmm1-8backweapon // for defaults
alias h_7backweapon dmm1-7backweapon
alias h_6backweapon dmm1-6backweapon
alias h_3backweapon dmm1-3backweapon
/////////////
And then, it came to my mind ... it's all easier using TCL. So, I implemented the same functionality with a TCL script. So, you can forget all the code above (although it's the cool part with a lot of brainfuck)!
Put the following contents into a .TCL file.
For a nicer look at the TCL visit: http://pastebin.com/2Jqekx55
set weaponstack ""
proc lremove {thelist value} {
set idx [lsearch -exact -all $thelist $value]
set idx [lsort -decreasing -integer $idx]
foreach _idx $idx {
set thelist [lreplace $thelist $_idx $_idx]
}
return $thelist
}
alias +h_quick {weapon} {
global weaponstack
lappend weaponstack $weapon
cmd h_weapon$weapon
if {$::h_debug == 1} {
cmd echo w: $weapon stack: $weaponstack
}
cmd +attack
}
alias -h_quick {weapon} {
global weaponstack
set weaponstack [lremove "$weaponstack" "$weapon"]
if {$::h_debug == 1} {
cmd echo "released w: $weapon stack: $weaponstack"
}
set itemcnt [llength $weaponstack]
if {$itemcnt == 0} {
cmd -attack
} else {
set next_in_stack [lindex $weaponstack end]
if {$::weaponnum != $next_in_stack} {
cmd h_weapon$next_in_stack
}
}
}
Then, still, the h_weapon1-8 aliases are missing. The TCL-script will call the h_weapon1-8 aliases according to the binds.
Put these h_weapon1-8 aliases into a normal config and have that config exec the TCL script:
// weapons
alias h_weapon "" // fake alias
alias h_weapon1 "impulse 1 2 3 5 8 4"
alias h_weapon2 "impulse 2 3 8 1"
alias h_weapon3 "impulse 3 2 8 1"
alias h_weapon4 "impulse 4 5 8 3 2 1"
alias h_weapon5 "impulse 5 3 8 4 2 1"
alias h_weapon6 "impulse 6 8 5 3 4 2 1" // insecure
alias h_weapon7 "impulse 7 8 5 3 4 2 1" // insecure
alias h_weapon8 "impulse 8 5 3 4 2 1"
// EXEC the TCL script
set h_debug 1
tcl_exec weapons.tcl
//////// BINDINGS
// SNG, NG .. see h_weapon5 above.
bind alt "+h_quick 5"
// RL .. see h_weapon7 above.
bind mouse1 "+h_quick 7"
// GL h_weapon6
bind space "+h_quick 6"
// LG h_weapon8
bind ctrl "+h_quick 8"
// SG, SSG h_weapon 3
cmd bind shift "+h_quick 3"
////////// So, when you press mouse1, the TCL script will call the alias "h_weapon7". And, on ctrl it starts "h_weapon8", and so on.
Of course, you may as well use your own weapon-switcher impulses on h_weapon1-8.
Now it's all set. You probably only need to re-bind the functions to your needs.
If you can make any sense out of this, you're quite entitled to use this script.
Have fun.
edit: Updated this first post to have every explanation needed to use it.
(Edited 2012-10-22, 22:51)
The guy from #qwnet with the ServeMe bots. Also, #aq2world in case anyone cares. ;-)