@q @program asys-cgroom 1 99999 d i ( asys-cgroom v1.2 Jessy @ FurryMUCK 6/97, 2/99 asys-cgroom runs Argo +cgroom command, which is used to toggle a room's chargen status. When 'true', the CharGen commands may be used in the room; when 'false', they may not. If no rooms are designated, then they may be used in any room. INSTALLATION: asys-cgroom uses the default Argo installation method. Port and install lib-argo. Set asys-cgroom W. Type '+install asys-cgroom' to install this program and its actions. See lib-argo and the Argo manual for further information. asys-cgroom may be freely ported. Please comment any changes. ) (2345678901234567890123456789012345678901234567890123456789012345678901) $def thisVersion "1.2" $define Tell me @ owner swap notify $enddef $include $lib/reflist $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 *) : Install ( -- ) (* 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-cgroom" setprop RecOldActions #0 "+cgroom" newexit dup scratch ! (* create command *) prog setlink prog "@a/version" thisVersion setprop (* set version *) scratch @ "@a/version" thisVersion setprop #0 "@a/comm_list/+cgroom" scratch @ setprop (* register command *) #0 "@a/prog_list/" prog name strcat prog setprop scratch @ "@a/name" "+cgroom" 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/+cgroom" 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-cgroom (#" prog intostr strcat ")" strcat " " Tell "The " command @ strcat " command is used to toggle the CharGen status of rooms. If set to " "'true', Argo CharGen commands may be used there; otherwise, they " "may not. If no rooms have been designated, then they may be used " "anywhere." strcat strcat strcat strcat Tell " " Tell "Syntax: " command @ strcat "[#room] (default is 'here')" strcat Tell " " Tell "See the Argo Manual for further information." Tell ; : DoCGRoom ( -- ) (* toggle room arg's CharGen status *) StaffCheck not if (* check permission *) ">> Permission denied." Tell exit then ourArg @ if (* find room to set: default is 'here' *) ourArg @ match dup if dup room? not if ">> Sorry, you must specifiy a room." Tell pop exit then else ">> '" ourArg @ Capitalize strcat " not found." strcat Tell pop exit then else loc @ then (* toggle cg status *) ourDataObj @ "@a/cg_locs" over over getpropstr if over over 5 pick REF-inlist? not if over over 5 pick REF-add 1 else over over 5 pick REf-delete 0 then else over over 5 pick REF-add 1 then (* notify *) swap pop swap pop swap ">> " swap name strcat " is now" strcat swap not if " not" strcat then " a Character Generation room." strcat Tell ; : main "me" match me ! (* initialize *) GetDataObj ourDataObj ! strip ourArg ! trig "@a/name" getpropstr ourCom ! ourArg @ if ourArg @ "#" stringpfx if "#help" ourArg @ stringpfx if DoHelp exit else "#enable" ourArg @ stringpfx if DoEnable exit else "#disable" ourArg @ stringpfx if DoDisable exit else "#version" ourArg @ stringpfx if DoVersion exit else "#install" ourArg @ stringpfx if Install exit else "#uninstall" ourArg @ stringpfx if DoUninstall exit then then then then then then then then me @ ArgoPermCheck Disabled? DoCGRoom ; . c q @set asys-cgroom=W