This script handles your primary and secondary weapon, shield, and held item. I wrote it to easily handle everything after I remorted and discovered I had broken my portal script which assumed I was always dual wielding. You may find it useful, you might not. I wrote it, I use it, so I put it up here for anyone else who might find it handy.
Please take note that for the portal script to function properly, you'll have to either get my 'fetch' and 'store' hooks, (see here for details) or else replace the fetch and put lines with appropriate get and put lines for your container.
;; Equipment handler - controls wielding, dual wielding, ;; held items, and shield ;; Also has the portal handling code ;; August 2002, Metria ;; By default, we are not dual wielding /set dualwielding 0 ;; Use: /weapon;; Wields and saves your primary weapon /def -wwolf weapon = /if ({#} < 1) \ /echo ** Wield what? %; \ /else \ /set eq_weapon=%* %; \ /send wield %eq_weapon %; \ /eqsave %; \ /endif ;; Use /dual ;; Wields your dual weapon, saves to file ;; Removes shield & held items as appropriate /def -wwolf dual = /if ({#} < 1) \ /echo ** Dual wield what? %; \ /else \ /set eq_dual=%* %; \ /if ({eq_held} !~ "") /send rem %eq_held %; /endif %; \ /if ({eq_shield} !~ "") /send rem %eq_shield %; /endif %; \ /set dualwielding=1 %; \ /send dual %eq_dual %; \ /eqsave %; \ /endif ;; Use: /nodual ;; Removes dual weapon, sets dualwielding off ;; If set, equips shield & held item /def -wwolf nodual = \ /if ({dualwielding}) \ /send dual remove %; \ /set dualwielding=0 %; \ /if ({eq_held} !~ "") /send hold %eq_held %; \ /else /echo ** Warning: Your held item is not set. %; \ /endif %; \ /if ({eq_shield} !~ "") /send wear %eq_shield %; /else \ /echo ** Warning: You are not using a shield. %; \ /endif %; \ /eqsave %; \ /else \ /echo ** nodual: not dual wielding already %; \ /endif ;; Use: /shield ;; Sets your shield item & saves /def -wwolf shield = \ /if ({#} != 1) /echo ** Shield: Use what? %; /else \ /if ({dualwielding}) /echo ** Can't use shield - dual wielding %; /else \ /set eq_shield=%L1 %; \ /send wear %eq_shield %; \ /eqsave %; /endif %; /endif ;; Use: /hold ;; Holds an item, saves the var, warns if dual wielding /def -wwolf hold = \ /if ({#} != 1) /echo ** Hold: Use what? %; /else \ /if ({dualwielding}) /echo ** Can't hold items - dual wielding %; /else \ /set eq_held=%L1 %; \ /send wear %eq_held %; \ /eqsave %; /endif %; /endif %; ;; Use: /nohold ;; Removes your held item /def -wwolf nohold = \ /if ({dualwielding}) /echo ** Dual wielding - no held item to remove %; \ /else rem %eq_held %; \ /endif ;; Use: /noshield ;; Removes your shield, if applicable /def -wwolf noshield = \ /if ({dualwielding}) /echo ** Dual wielding - no shield to remove %; \ /else rem %eq_shield %; \ /endif ;; Usage: /eqsave ;; Saves equipment status to a file /def -wwolf eqsave = /listvar eq_* %| /writefile ~/wolf/eq.status %; \ /listvar dualwielding %| /writefile -a ~/wolf/eq.status %; \ /if ({wolf_debug}) /echo ** Equipment status saved. %; /endif /def -wwolf eqstatus = \ /echo ** Equipment Status ** %; \ /echo Primary weapon: %eq_weapon %; \ /echo Secondary weapon: %eq_dual %; \ /if ({dualwielding}) /echo ** DUAL WEAPONS IN USE ** %; /endif %; \ /echo Held item: %eq_held %; \ /echo Shield: %eq_shield %; \ /echo ** /eqstatus done ** ; Modified to unlock the door in New Vertigo before storing portal again /def -wwolf -mglob -p1 -h'SEND {portal}*' doportal = \ /if ({#} != 2) \ /echo Which portal? %; \ /else \ /let portal=%L1 %; \ fetch %portal %; \ /if ({dualwielding}) second remove %; /endif %; \ hold %portal %; enter %; \ /if ({dualwielding}) /send dual %eq_dual %; \ /else /send hold %eq_held %; \ /endif %; \ /if ({portal} =~ "royale") \ op w %; \ /endif %; store %portal %; \ /endif%; /load ~/wolf/eq.status /echo ** EQ handler loaded