@q @program asys-group 1 99999 d i ( asys-group v1.2 Jessy@FurryMUCK 6/97, 11/99 A staff command to list members of an Argo group. INSTALLATION: Port the program. Set it wizard. Type '+install asys-group.' USAGE: +group asys-group 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 ourBoolean (* int: misc 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-group" setprop RecOldActions (* create and register command; set default props *) #0 "+group" newexit dup scratch ! prog setlink prog "@a/version" thisVersion setprop scratch @ "@a/version" thisVersion setprop #0 "@a/comm_list/+group" scratch @ setprop #0 "@a/prog_list/" prog name strcat prog setprop scratch @ "@a/name" "+group" 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/+group" 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-group (#" prog intostr strcat ")" strcat Tell " " Tell "This staff-only command lists all members of a group." Tell ; : DoGroup ( -- ) me @ StaffCheck not if ">> Permission denied." Tell exit then ourDataObj @ "@a/groups/" ourArg @ strcat getprop not if ">> Group $group not found." ourArg @ "$group" subst Tell exit then background ">> Scanning database for members of the $group group..." ourArg @ Capitalize "$group" subst Tell "@a/skills/$group influence" ourArg @ "$group" subst scratch ! 0 0 ourCounter ! begin dup dbref dbtop dbcmp not while dup dbref ok? if dup dbref player? if dup dbref scratch @ getpropstr if " " over dbref name strcat over dbref "@a/status" getpropstr "approved" smatch if " *" strcat then Tell ourCounter @ 1 + ourCounter ! then then then 1 + repeat ">> Total found: $count (Approved chars marked with asterix *)" ourCounter @ intostr "$count" subst Tell ; : main "me" match me ! (* initialize *) GetDataObj ourDataObj ! strip ourArg ! trig "@a/name" getpropstr ourCom ! Update 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 else ">> Syntax: $command " command @ "$command" subst Tell exit then me @ ArgoPermCheck Disabled? DoGroup ; . c q @set asys-group=W