( Staff Manager 1.2 by Ginger@FurToonia ) ( ) ( Setup: ) ( Open an exit linked to this program on a room [an env room if you ) ( want a global, or just one room; it works either way]. ) ( @set =staffname:Staff Members [what you call ppl on list] ) ( @set =staffheader:Specialty [header for the #comments] ) ( @set =stafffooter: [txt to appear after listing] ) ( #help for help on usage. ) lvar player lvar arg lvar propname lvar ref lvar number : delete trig owner me @ dbcmp not if "You are not authorised to remove furs from this list." .tell exit then arg @ " " explode begin dup 0 = not while 1 - swap .pmatch intostr trig swap "_refs/" swap strcat remove_prop "Removed." .tell repeat ; : add trig owner me @ dbcmp not if "You are not authorised to add furs to this list." .tell exit then arg @ " " explode begin dup 0 = not while 1 - swap player ! player @ .pmatch dup #-1 dbcmp if pop "No match found for " player @ strcat "." strcat .tell continue then #-2 dbcmp if "Multiple matches found for " player @ strcat "." strcat .tell continue then trig "_refs/" player @ .pmatch intostr strcat getpropstr "" stringcmp 0 = if trig player @ .pmatch intostr "_refs/" player @ .pmatch intostr strcat swap 1 addprop player @ .pmatch name " added." strcat .tell continue else pop player @ .pmatch name " is already registered." strcat .tell then repeat ; : idlecount ref @ awake? not if "[Asleep]" exit then ref @ descriptors begin dup 1 = not while swap pop 1 - repeat pop descrcon conidle dup 120 < if pop "[On Duty]" exit then dup 3600 < if 60 / intostr "m" strcat "[Idle " swap strcat "]" strcat exit then 3600 / intostr "h" strcat "[Idle " swap strcat "]" strcat ; : show "Status " trig "staffname" getpropstr 1 strcut swap toupper swap strcat strcat " " strcat 28 strcut pop " " strcat trig "staffheader" getpropstr strcat 78 strcut pop .tell trig "_refs/" nextprop dup "" stringcmp 0 = if pop "There are no " trig "staffname" getpropstr strcat " registered now." strcat .tell exit then begin propname ! propname @ "" stringcmp 0 = not while trig propname @ getpropstr atoi dbref ref ! ref @ player? not if continue then ref @ "_off_duty?" getpropstr "yes" stringcmp 0 = if "[Off Duty]" else idlecount then " " strcat 11 strcut pop ref @ name " " strcat 18 strcut pop strcat ref @ "_spurhelp" getpropstr strcat .tell trig propname @ nextprop repeat trig "stafffooter" getpropstr .tell ; : comment trig "_refs/" me @ intostr strcat getpropstr dup "" stringcmp 0 = if "You are not registered with this list." .tell exit then me @ "_spurhelp" arg @ 1 addprop me @ "'" arg @ "' set as comment." strcat strcat .tell "Only 48 characters will show. To set this property by hand, use" .tell "'@set me=_spurhelp:'." .tell ; : duty arg @ strip tolower "on" stringcmp 0 = if me @ "_off_duty?" "no" 1 addprop "You go on duty." .tell exit then arg @ strip tolower "off" stringcmp 0 = if me @ "_off_duty?" "yes" 1 addprop "You go off duty." .tell exit then ; : help "Staff Manager 1.2 by Ginger@FurToonia" .tell " " .tell "Keeps a list of staff (like helpstaff or wizzes) for an organisation." .tell " -- List all people in staff registry" .tell " #help -- This screen" .tell " #add -- add players to list" .tell " #del -- remove players from list" .tell " #duty on/off -- go on/off duty for this list" .tell " #comment -- add a comment to your listing" .tell " " .tell "Only the owner of the exit can #add/#delete ... from" .tell "or to the list." .tell " " .tell "@view #" prog intostr strcat " for setup instructions." strcat .tell ; : main arg ! arg @ "" stringcmp 0 = if show exit then arg @ "#help" stringpfx if help exit then arg @ "#add" stringpfx if arg @ 5 strcut swap pop arg ! add exit then arg @ "#del " stringpfx if arg @ 5 strcut swap pop arg ! delete exit then arg @ "#delete" stringpfx if arg @ 8 strcut swap pop arg ! delete exit then arg @ "#comment" stringpfx if arg @ 9 strcut swap pop arg ! comment exit then arg @ "#com " stringpfx if arg @ 5 strcut swap pop arg ! comment exit then arg @ "#duty" stringpfx if arg @ 6 strcut swap pop arg ! duty exit then ;