@q @program asys-approve 1 99999 d i ( asys-approve v1.2 Jessy @ FurryMUCK 6/97, 2/99 asys-approve runs Argo +approve and +unapprove commands, which are used to modify a character's Argo approval and chargen status. An unapproved character may modify stats at a reduced rate, may lower as well as raise ability levels, and may select options such as Advantages, Disadvantages, and Templates, which are only avail- able during chargen. An approved character may not, but has full access to Argo game commands. INSTALLATION: asys-approve uses the default Argo installation method. Port and install lib-argo. Set asys-approve W. Type '+install asys-approve' to install this program and its actions. USAGE: +approve ........ Set as 'approved' +unapprove ...... Set as 'not approved' See lib-argo and the Argo manual for further information. asys-skills 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 *) : 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-approve" setprop RecOldActions #0 "+approve" newexit dup scratch ! (* create command *) prog setlink prog "@a/version" thisVersion setprop (* set version *) scratch @ "@a/version" thisVersion setprop #0 "@a/comm_list/+approve" scratch @ setprop #0 "@a/prog_list/" prog name strcat prog setprop scratch @ "@a/name" "+approve" setprop #0 "+unapprove" newexit dup scratch ! (* create command *) prog setlink prog "@a/version" thisVersion setprop (* set version *) scratch @ "@a/version" thisVersion setprop (* register command *) #0 "@a/comm_list/+unapprove" scratch @ setprop #0 "@a/prog_list/" prog name strcat prog setprop scratch @ "@a/name" "+unapprove" 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/+approve" RemoveCommand "@a/comm_list/+unapprove" 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-approve (#" prog intostr strcat ")" strcat Tell " " Tell ourCom @ "+approve" smatch if "The " command @ strcat " command sets a player's chargen status as 'approved'." strcat Tell " " Tell "Syntax: " command @ strcat " " strcat Tell else "The " command @ strcat " command sets a player's chargen status as 'not approved'." strcat Tell " " Tell "Syntax: " command @ strcat " " strcat Tell then " " Tell "An unapproved character may modify stats at a reduced rate, may " "lower as well as raise ability levels, and may select options such " "as Advantages, Disadvantages, and Templates, which are only avail" "able during chargen. An approved character may not, but has full " "access to Argo game commands." strcat strcat strcat strcat Tell " " Tell "This is a staff-only command." Tell ; : DoUnapprove ( -- ) (* set a player 'not approved' *) StaffCheck not if (* check permission *) ">> Permission denied." Tell exit then ourArg @ not if ">> Syntax: " command @ strcat " " strcat Tell exit then ourArg @ .pmatch dup if dup "@a/status" "na" setprop ">> " swap name strcat " unapproved." strcat Tell else ourArg @ match dup if dup #-2 dbcmp not if dup "Z" flag? if dup "@a/stats/dex" getpropstr if dup "@a/status" "na" setprop ">> Puppet $name unapproved." swap name "$name" subst Tell then then then else ">> Player '" ourArg @ strcat "' not found." strcat Tell pop exit then then ; : DoApprove ( -- ) (* set a player 'approved' *) StaffCheck not if (* check permission *) ">> Permission denied." Tell exit then ourArg @ not if ">> Syntax: " command @ strcat " " strcat Tell exit then ourArg @ .pmatch dup if dup "@a/status" "approved" setprop ">> " swap name strcat " approved." strcat Tell else ourArg @ match dup if dup #-2 dbcmp not if dup "Z" flag? if dup "@a/stats/dex" getpropstr if dup "@a/status" "approved" setprop ">> Puppet $name approved." swap name "$name" subst Tell exit then then then else ">> Player '" ourArg @ strcat "' not found." strcat Tell pop exit then then ; : 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 "#disable" ourArg @ stringpfx if DoDisable else "#version" ourArg @ stringpfx if DoVersion 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? ourCom @ "+approve" smatch if DoApprove else DoUnapprove then ; . c q @set asys-approve=W