@q @program asys-notes 1 99999 d i ( asys-notes v1.2 Jessy @ FurryMUCK 6/97, 2/99 asys-notes runs Argo +note and +notes staff-only commands, used to record or view staff-to-staff notes regarding players. INSTALLATION: asys-notes uses the default Argo installation method. Port and install lib-argo. Set asys-notes W. Type '+install asys-notes' to install this program and its actions. USAGE: +note ........ Enter editor to make notes for +notes ....... Display notes for See lib-argo and the Argo manual for further information. asys-notes 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-notes" setprop RecOldActions #0 "+notes" newexit dup scratch ! (* create command *) prog setlink prog "@a/version" thisVersion setprop (* set version *) scratch @ "@a/version" thisVersion setprop #0 "@a/comm_list/+notes" scratch @ setprop (* register command *) #0 "@a/prog_list/" prog name strcat prog setprop scratch @ "@a/name" "+notes" setprop #0 "+note" newexit dup scratch ! (* create command *) prog setlink prog "@a/version" thisVersion setprop (* set version *) scratch @ "@a/version" thisVersion setprop #0 "@a/comm_list/+note" scratch @ setprop (* register command *) #0 "@a/prog_list/" prog name strcat prog setprop scratch @ "@a/name" "+note" 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/+note" RemoveCommand "@a/comm_list/+notes" 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-notes (#" prog intostr strcat ")" strcat Tell " " Tell "The staff-only " command @ strcat ourCom @ "+note" smatch if " command is used to make notes, viewable by other staff members, " "regarding players." strcat strcat Tell " " Tell "Syntax: " command @ strcat " ...... Make notes for " strcat Tell else " command is used to read notes made by other staff members " "regarding players." strcat strcat Tell " " Tell "Syntax: " command @ strcat " ...... Read notes for " strcat Tell then " " tell ; : DoNote ( -- ) (* edit notes for a player *) StaffCheck not if ">> Permission denied." Tell then ourArg @ not if ">> Syntax: " command @ strcat " " strcat Tell exit then ourArg @ .pmatch dup not if ">> Player not found." Tell pop exit then "@a/notes" EditList ; : DoNotes ( -- ) (* display notes for a player *) StaffCheck not if ">> Permission denied." Tell then ourArg @ not if ">> Syntax: " command @ strcat " " strcat Tell exit then ourArg @ .pmatch dup not if ">> Player not found." Tell pop exit then ">> Notes for " over name strcat ":" strcat Tell "@a/notes" ShowList ; : 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 @ "+note" smatch if DoNote else DoNotes then ">> Done." Tell ; . c q @set asys-notes=W