@888: what?
---
"Auto-switch" to secondary weapon if your primary has no ammunition script:
[cubescript]bind MOUSE1 [ if (&& (= (curweapon) (currentprimary)) (&& (! (magcontent (currentprimary))) (! (magreserve (currentprimary))))) secondary; attack ]
[/cubescript]
...same as above but with "auto-switch" back to primary once ammunition is detected:
[cubescript]bind MOUSE1 [
if (&& (= (curweapon) (currentprimary)) (&& (! (magcontent (currentprimary))) (! (magreserve (currentprimary))))) secondary
if (&& (= (curweapon) 1) (|| (magcontent (currentprimary)) (magreserve (currentprimary)))) primary
attack
][/cubescript]
...same as above but only "auto-switches" back to primary if the script forced you to switch to your secondary to begin with:
[cubescript]thisplayerdead = 0
forcedsecondaryswitch = 0
checkalive = [
if (&& (! (alive)) (! $thisplayerdead)) [ thisplayerdead = 1 ]
if (&& (alive) $thisplayerdead) [ thisplayerdead = 0; if (checkalias onSpawnp) onSpawnp ]
sleep 0 checkalive
]
if (! (checkalias mapstartalways)) [ mapstartalways = [] ]
if (! (strstr $mapstartalways checkalive)) [ add2alias mapstartalways checkalive ]
onSpawnp = [ forcedsecondaryswitch = 0 ]
bind MOUSE1 [
if (&& (= (curweapon) (currentprimary)) (&& (! (magcontent (currentprimary))) (! (magreserve (currentprimary))))) [ secondary; forcedsecondaryswitch = 1 ]
if (&& (&& (= (curweapon) 1) (|| (magcontent (currentprimary)) (magreserve (currentprimary)))) $forcedsecondaryswitch) [ primary; forcedsecondaryswitch = 0 ]
attack
][/cubescript]
---
"Auto-switch" to secondary weapon if your primary has no ammunition script:
[cubescript]bind MOUSE1 [ if (&& (= (curweapon) (currentprimary)) (&& (! (magcontent (currentprimary))) (! (magreserve (currentprimary))))) secondary; attack ]
[/cubescript]
...same as above but with "auto-switch" back to primary once ammunition is detected:
[cubescript]bind MOUSE1 [
if (&& (= (curweapon) (currentprimary)) (&& (! (magcontent (currentprimary))) (! (magreserve (currentprimary))))) secondary
if (&& (= (curweapon) 1) (|| (magcontent (currentprimary)) (magreserve (currentprimary)))) primary
attack
][/cubescript]
...same as above but only "auto-switches" back to primary if the script forced you to switch to your secondary to begin with:
[cubescript]thisplayerdead = 0
forcedsecondaryswitch = 0
checkalive = [
if (&& (! (alive)) (! $thisplayerdead)) [ thisplayerdead = 1 ]
if (&& (alive) $thisplayerdead) [ thisplayerdead = 0; if (checkalias onSpawnp) onSpawnp ]
sleep 0 checkalive
]
if (! (checkalias mapstartalways)) [ mapstartalways = [] ]
if (! (strstr $mapstartalways checkalive)) [ add2alias mapstartalways checkalive ]
onSpawnp = [ forcedsecondaryswitch = 0 ]
bind MOUSE1 [
if (&& (= (curweapon) (currentprimary)) (&& (! (magcontent (currentprimary))) (! (magreserve (currentprimary))))) [ secondary; forcedsecondaryswitch = 1 ]
if (&& (&& (= (curweapon) 1) (|| (magcontent (currentprimary)) (magreserve (currentprimary)))) $forcedsecondaryswitch) [ primary; forcedsecondaryswitch = 0 ]
attack
][/cubescript]