@q @program asys-suspend 1 99999 d i (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-suspend" setprop RecOldActions #0 "+suspend" newexit dup scratch ! (* create command *) prog setlink prog "@a/version" thisVersion setprop (* set version *) scratch @ "@a/version" thisVersion setprop #0 "@a/comm_list/+suspend" scratch @ setprop (* register command *) #0 "@a/prog_list/" prog name strcat prog setprop scratch @ "@a/name" "+suspend" 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/+suspend" 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-suspend (#" prog intostr strcat ")" strcat Tell " " Tell "The " command @ strcat " staff-only command is used to toggle a player's Argo suspension " "status. A suspended player may not use Argo commands." strcat strcat Tell ; : DoSuspend StaffCheck not if ">> Permission denied." Tell exit then ourArg @ not if ">> Syntax: " command @ strcat " " strcat Tell exit then ourArg @ .pmatch dup if dup "@a/status" over over getpropstr "suspended" smatch if "approved" else "suspended" then setprop dup "@a/status" getpropstr ">> " rot name strcat " " strcat swap strcat "." strcat Tell else pop ">> Player " swap Capitalize strcat " not found." strcat Tell exit 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 "#install" ourArg @ stringpfx if DoInstall else "#uninstall" ourArg @ stringpfx if DoUninstall else ">> #Argument not understood." Tell then then then then then exit then then me @ ArgoPermCheck Disabled? DoSuspend ; . c q @set asys-suspend=W