@q @program asys-reset 1 99999 d i ( asys-reset v1.2 Jessy @ FurryMUCK 6/97, 2/99 asys-reset runs the Argo +reset commands, which returns your character to default Argo values. INSTALLATION: asys-reset uses the default Argo installation method. Port and install lib-argo. Set asys-Spells W. Type '+install asys-spells' to install this program and its action. USAGE: +reset, confirm at prompt See lib-argo and the Argo manual for further information. asys-reset may be freely ported. Please comment any changes. ) (2345678901234567890123456789012345678901234567890123456789012345678901) $def thisVersion "1.2" $define Tell me @ owner swap notify $enddef $include $lib/argo lvar scratch (* workspace var *) lvar ourCounter (* misc. counter var *) lvar ourDataObj (* dbref: object holding system-wide data *) lvar ourArg (* inital arg string, unmodified *) lvar ourCom (* string: 'official' name of command *) lvar ourPlayer (* player to be reset *) lvar ourBoolean (* i: flow control var *) : DoInstall ( -- ) (* install program into Argo system *) caller program? not if (* confirm installation method *) ">> Programs must be installed via the " "+install" GetCommandName strcat " command." strcat Tell exit then prog "@a/version" getpropstr if (* confirm re-install *) ">> Reinstalling..." tell else ">> Installing..." Tell then (* record 'official' name of prog; remove old links *) prog "@a/name" "asys-reset" setprop RecOldActions #0 "+reset" newexit dup scratch ! (* create command *) prog setlink prog "@a/version" thisVersion setprop (* set version *) scratch @ "@a/version" thisVersion setprop #0 "@a/comm_list/+reset" scratch @ setprop (* register command *) #0 "@a/prog_list/" prog name strcat prog setprop scratch @ "@a/name" "+reset" setprop ">> Installed." Tell ; : DoUninstall (* uninstall program from Argo *) prog "@a/name" getpropstr if #0 "@a/prog_list/" prog "@a/name" getpropstr strcat getprop not if ">> " prog name strcat " is not currently installed." strcat Tell pid kill then else ">> " prog name strcat " is not currently installed." strcat Tell pid kill then ">> Please confirm: You wish to uninstall " prog name strcat "?" strcat Tell ReadYesNo not if ">> Aborted." Tell pid kill Then background "@a/comm_list/+reset" RemoveCommand #0 "@a/prog_list/" prog "@a/name" getpropstr strcat remove_prop RecOldActions ">> Uninstalled. Please edit the online manual as appropriate." Tell ; : DoHelp ( -- ) (* display help screen *) " " Tell "asys-Reset \(#" prog intostr strcat "\)" strcat Tell " " Tell "USE WITH CAUTION" Tell " " Tell "The " command @ strcat " command resets all your properties to default values, allowing you " "to start as a new Argo character." strcat strcat Tell ; : DoReset ( -- ) (* reset all Argo props to default *) ourArg @ if StaffCheck not if ">> Permission denied." Tell exit then ourArg @ FindOther ourPlayer ! else me @ ourPlayer ! then ">> This command resets all Argo properties to default values and" Tell " recycles all Argo objects." Tell ">> Please Confirm: You want to reset completely?" Tell ">> [Enter 'yes' to confirm, or any other string to abort]" Tell ReadLine strip "yes" smatch not if ">> Aborted." Tell exit then ">> Resetting props... " Tell (* store state info about status: will reset 'suspended if applicable *) ourPlayer @ "@a/status" getpropstr dup if "suspended" smatch if 1 ourBoolean ! then else pop then ourPlayer @ ClearBank (* reset props *) ourPlayer @ "@a/" RemoveDir-r ourPlayer @ SetArgoDefaults ourPlayer @ prog owner dbcmp if ">> Reset." Tell exit then ourPlayer @ "W" flag? not if ">> Scanning the dbase for Argo objects, recycling... " Tell #2 begin (* begin object-recyling loop *) dup dbtop dbcmp not while dup ok? if dup thing? if dup "@a/version" getpropstr if dup owner ourPlayer @ dbcmp if ">> Recycling " over name strcat "..." strcat Tell dup recycle then then then then 1 + repeat (* end object-recyling loop *) then ourBoolean @ if ourPlayer @ "@a/status" "suspended" setprop then ">> Reset." Tell ; : main "me" match me ! (* initialize *) GetDataObj ourDataObj ! strip ourArg ! trig "@a/name" getpropstr ourCom ! ourArg @ if ourArg @ "#" stringpfx if "#help" ourArg @ stringpfx if DoHelp else "#enable" ourArg @ stringpfx if DoEnable else "#version" ourArg @ stringpfx if DoVersion else "#disable" ourArg @ stringpfx if DoDisable else "#install" ourArg @ stringpfx if DoInstall else "#uninstall" ourArg @ stringpfx if DoUninstall else ">> #Argument not understood." Tell then then then then then then exit then then me @ ArgoPermCheck Disabled? DoReset ; . c q @set asys-reset=W