( Wizards/HelpStaff Lister by Ginger@FurToonia ) ( ) ( Setup: @open wizards;wizzes;wizlist;wizardlist;staff;helpstaff=# ) ( Freely portable provided headers intact--no saying you wrote this! ) ( . . . . Who would *want* to say they wrote this? ) ( ) ( Am I broken? Contact fever@netcom.com 09/20/1997 ) $include $lib/edit $include $lib/lmgr $include $lib/reflist $include $lib/case lvar arg (argument passed with command) lvar all? (show all staff?) lvar list (show wizards or staff?) lvar temp lvar temp2 lvar count (count of all wiz/staff online) : get_list ( -- ) command @ trig "_remaps/" rot strcat getpropstr dup "" stringcmp 0 = if pop command @ "w" stringpfx if "wizards" else "staff" then then dup "staff" stringcmp 0 = over "wizards" stringcmp 0 = or not if pop "wizards" then list ! ; : on_duty ( -- ) trig "_wizards" me @ ref-inlist? trig "_staff" me @ ref-inlist? or not if "Are you really that bored? You're neither Wizard nor HelpStaff." .tell exit then me @ "_off_duty?" "no" 1 addprop me @ "_prefs/duty/onmesg" list @ 0 parseprop dup "" stringcmp 0 = if pop "You go on duty." .tell else .tell then me @ "_prefs/duty/oxmesg" list @ 0 parseprop dup "" stringcmp 0 = not if me @ name " " strcat swap strcat me @ location swap me @ swap notify_except then ; : off_duty ( -- ) trig "_wizards" me @ ref-inlist? trig "_staff" me @ ref-inlist? or not if "Are you really that bored? You're neither Wizard nor HelpStaff." .tell exit then me @ "_off_duty?" "yes" 1 addprop me @ "_prefs/duty/ofmesg" list @ 0 parseprop dup "" stringcmp 0 = if pop "You go off duty." .tell else .tell then me @ "_prefs/duty/ozmesg" list @ 0 parseprop dup "" stringcmp 0 = not if me @ name " " strcat swap strcat me @ location swap me @ swap notify_except then ; : add_name ( d -- ) me @ "W" flag? not if "Only wizards may edit the listing." .tell exit then arg @ " " explode pop pop strip dup "=" instr 0 = if pop "Format: #add = ['wizards' or 'staff']" .tell "Example: #add Ginger=wizards".tell exit then "=" explode 2 = not if "Format: #add = ['wizards' or 'staff']" .tell "Example: #add Ginger=wizards".tell exit then temp ! list ! list @ dup "wizards" stringcmp 0 = over "staff" stringcmp 0 = or not if pop " needs to be either 'wizards' or 'staff'." .tell exit then temp @ number? if temp @ atoi dbref temp ! else temp @ .pmatch temp ! then temp @ player? not if "Unknown player." .tell exit then trig "_" list @ strcat temp @ ref-inlist? if temp @ name " is already in that list." strcat .tell exit then trig "_" list @ strcat temp @ ref-add temp @ name " added to " strcat list @ strcat " list." strcat .tell ; : del_name ( d -- ) me @ "W" flag? not if "Only wizards may edit the listing." .tell exit then arg @ " " explode pop pop strip dup "=" instr 0 = if pop "Format: #del = ['wizards' or 'staff']" .tell "Example: #del Ginger=wizards" .tell exit then "=" explode 2 = not if "Format: #del = ['wizards' or 'staff']" .tell "Example: #del Ginger=wizards" .tell exit then temp ! list ! list @ dup "wizards" stringcmp 0 = over "staff" stringcmp 0 = or not if pop " needs to be either 'wizards' or 'staff'." .tell exit then temp @ number? if temp @ atoi dbref temp ! else temp @ .pmatch temp ! then temp @ player? not if "Unknown player." .tell exit then trig "_" list @ strcat temp @ ref-inlist? not if temp @ name " is not in that list." strcat .tell exit then trig "_" list @ strcat temp @ ref-delete temp @ name " removed from " strcat list @ strcat " list." strcat .tell ; : remap ( s -- ) me @ "W" flag? not if "Only wizards may remap aliases." .tell exit then arg @ dup " " instr strcut swap pop strip dup "#li" stringpfx if pop "Remaps:" .tell trig "_remaps/" nextprop begin dup "" stringcmp 0 = not while dup dup trig swap getpropstr swap dup "/" rinstr strcut swap pop swap " shows the " swap strcat strcat " list." strcat .tell trig swap nextprop repeat "Done." .tell exit then dup " " instr strcut swap pop "=" explode 2 > if "Format: #remap =<'wizards' or 'staff'>" .tell "Example: #remap wizlist=wizards" .tell exit then swap dup "" stringcmp 0 = if pop trig "_remaps/" swap strcat remove_prop "Remap cleared." .tell else trig rot "_remaps/" swap strcat rot 1 addprop "Remap added." .tell then ; : wizhelp ( -- ) "Wizards/Staff Lister -- v 1.0 -- Ginger@FurToonia" .tell " " .tell "Commands:" .tell " wizzes Show which Wizards are online." .tell " staff See which HelpStaff are online." .tell " #all Show all Wizzes or Staff, not just those online." .tell " #onduty/#offduty Toggles '[On Duty]/[Off Duty]' flag." .tell " #add = Add to -- wizards or staff" .tell " #del = Delete from " .tell " #remap = Have call either staff or wizards list" .tell " #remap #list Show all defined remaps." .tell " " .tell "Properties on trigger action:" .tell " __ForceFull? 'yes' forces '#all' suffix for ''." .tell " header- Lsedit list displayed before listing." .tell " tail- Lsedit list displayed after listing." .tell " " .tell "@set me=_helpstuff: will set your 'Problems Handled' field." .tell "The _helpstuff property takes MPI and may be no longer than 50 characters." .tell "Type " command @ " #help2 for info on setting duty #on and duty #off mesgs." strcat strcat .tell ; : plebehelp ( -- ) " " .tell "Wizards/Staff Lister -- v 1.0 -- Ginger@FurToonia" .tell " " .tell "Commands:" .tell " wizzes See which wizards are online and on-duty." .tell " staff See which helpstaff are online." .tell " #all See all wizzes or staff, not just those online." .tell " #onduty/#offduty Toggles your [On Duty]/[Off Duty] status." .tell " #help The magic screen." .tell " " .tell "@set me=_helpstuff: will set your 'Problems Handled' field." .tell "The _helpstuff property takes MPI and may be no longer than 50 characters." .tell "Type " command @ " #help2 for info on setting duty #on and duty #off mesgs." strcat strcat .tell " " .tell ; : help2 ( -- ) " " .tell "Wizards/Staff Lister -- v 1.0 -- Ginger@FurToonia" .tell " " .tell "You can set messages which may be seen by you and by others when you go on" .tell "or off duty. By default, only you are notified when you go on or off duty." .tell "On FurToonia, #1117 takes care of these messages. That will not interfere" .tell "with this program--although you may get one line of extra spam. *smile*" .tell " " .tell "Examples:" .tell "@set me=_prefs/duty/onmesg:You go on duty. [Shown only to you]" .tell "@set me=_prefs/duty/oxmesg:goes on duty. [Shown to others in the room]" .tell "@set me=_prefs/duty/ofmesg:You go off duty. [Shown only to you]" .tell "@set me=_prefs/duty/ozmesg:goes off duty. [Shown to others in the room]" .tell " " .tell "Obviously, oxmesg and ozmesg are prefixed with your name when displayed." .tell " " .tell ; : show_header ( -- ) "header-" list @ strcat trig lmgr-getlist editdisplay ; : show_footer ( -- ) "tail-" list @ strcat trig lmgr-getlist editdisplay ; : status ( d -- s ) dup "W" flag? over "D" flag? and over awake? not or if pop "[Asleep]" exit then dup "_off_duty?" getpropstr "y" stringpfx over "_lists/" list @ strcat "/duty" strcat getpropstr "off" stringcmp 0 = or if pop "[Off Duty]" exit then descriptors dup if 1 - swap descrcon dup if conidle then temp ! else 0 temp ! then begin dup if 1 - swap descrcon dup if conidle then dup temp @ > if temp ! else pop then then dup not until pop temp @ 180 < if "[On Duty]" exit then "[Idle |]" temp @ dup 3600 > if 3600 "h" else 60 "m" then rot rot / intostr swap strcat "|" subst ; : show_list show_header trig "_" list @ "_ForceFull?" strcat strcat getpropstr "y" stringpfx 1 = if 1 all? ! then trig "_" list @ strcat ref-first begin dup #-1 dbcmp not while temp2 ! temp2 @ player? temp2 @ awake? 1 >= all? @ or and if temp2 @ status " " strcat 10 strcut pop " " strcat temp2 @ name " " strcat 16 strcut pop " " strcat strcat temp2 @ "_helpstuff" list @ 1 parseprop 50 strcut pop strcat strip .tell then temp2 @ awake? if count @ 1 + count ! then trig "_" list @ strcat temp2 @ ref-next repeat count @ 0 = all? @ 0 = and if "There is currently no-one available." .tell then show_footer ; : main ( s -- ) strip dup arg ! 0 all? ! 0 count ! get_list case "#al" stringpfx 1 = when 1 all? ! show_list end "#ad" stringpfx 1 = when add_name end "#de" stringpfx 1 = when del_name end "#h" stringcmp 0 = when me @ "W" flag? if wizhelp else plebehelp then end "#help" stringcmp 0 = when me @ "W" flag? if wizhelp else plebehelp then end "#help2" stringcmp 0 = when help2 end "#h2" stringcmp 0 = when help2 end "#on" stringpfx 1 = when on_duty end "#of" stringpfx 1 = when off_duty end "#re" stringpfx 1 = when remap end default show_list end endcase ;