@q @program asys-ppp 1 99999 d i ( *YOUR HEADER COMMENT HERE* Please do include a header comment. They're important. See other Argo programs for examples. USING ASYS-XCOMS: Modify this program as needed to add new Argo commands. Begin by searching and replacing all instances of the string 'ppp' with the name of your program. Code that handles the command should be placed in function Do. See the Argo Manual for further discussion. See other Argo programs for examples. You may freely copy and modify functions from other Argo programs for inclusion in this program. ) (2345678901234567890123456789012345678901234567890123456789012345678901) $def thisVersion "1.2" $define Tell me @ owner swap notify $enddef $include $lib/argo lvar ourArg (* inital arg string, unmodified *) lvar ourBoolean (* int: misc flow control var *) lvar ourCom (* string: 'official' name of command *) lvar ourCounter (* misc. counter var *) lvar ourDataObj (* dbref: object holding system-wide data *) lvar ourOption (* string: command #option *) lvar scratch (* workspace var *) : 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 (* notify that we're starting... *) prog "@a/version" getpropstr if ">> Reinstalling..." Tell else ">> Installing..." Tell then (* record 'official' name of prog; remove old links *) prog "@a/name" "asys-ppp" setprop RecOldActions (* create and register command; set default props *) #0 "+xxx" newexit dup scratch ! prog setlink prog "@a/version" thisVersion setprop scratch @ "@a/version" thisVersion setprop scratch @ "@a/name" "+xxx" setprop #0 "@a/comm_list/+xxx" scratch @ setprop #0 "@a/prog_list/" prog name strcat prog setprop ">> Installed." Tell ; : DoUninstall (* uninstall program from Argo *) (* check: is program installed? *) 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 (* get confirmation *) ">> Please confirm: You wish to uninstall " prog name strcat "?" strcat Tell ReadYesNo not if ">> Aborted." Tell pid kill Then background "@a/comm_list/+xxx" RemoveCommand RecOldActions #0 "@a/prog_list/" prog "@a/name" getpropstr strcat remove_prop ">> Uninstalled. Please edit the online manual as appropriate." Tell ; : DoHelp ( -- ) (* display help screen *) " " Tell prog name " (#" strcat prog intostr strcat ")" strcat Tell " " Tell (* YOUR HELP DOCS GO HERE *) ; : Doxxx ( -- ) (* YOUR PRIMARY FUNCTION GOES HERE*) ; : main "me" match me ! (* initialize *) GetDataObj ourDataObj ! strip ourArg ! trig "@a/name" getpropstr ourCom ! Update ourArg @ if ourArg @ "#" stringpfx if ourArg @ " " instr if ourArg @ dup " " instr strcut strip ourArg ! strip ourOption ! else ourArg @ strip ourOption ! then "#help" ourOption @ stringpfx if DoHelp exit else "#enable" ourOption @ stringpfx if DoEnable exit else "#disable" ourOption @ stringpfx if DoDisable exit else "#version" ourOption @ stringpfx if DoVersion exit else "#install" ourOption @ stringpfx if DoInstall exit else "#uninstall" ourOption @ stringpfx if DoUninstall exit else then then then then then then then then me @ ArgoPermCheck Disabled? ourCom @ "+xxx" smatch if Doxxx exit then ">> ERROR: Command not found." Tell ; . c q @set asys-ppp=W