@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-XSPELLS: Modify this program as needed to add new Argo spells. Begin by searching and replacing all instances of the string 'ppp' with the name of your program. Search and replace all instances of the string 'xxx' with the name of the spell. Code that handles effects of the spell should be placed in function Do. See the Argo Manual for further discussion. See asys-stdspells for examples. You may freely copy and modify functions from asys-stdspells for inclusion in this program. ) (2345678901234567890123456789012345678901234567890123456789012345678901) $def thisVersion "1.1" $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 *) lvar ourBoolean (* int: misc flow control 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 prog "@a/version" ArgoVersion setprop RecOldActions #0 "@a/prog_list/asys-ppp" prog setprop #0 "@a/calls/castxxx" 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 (* check: is program installed? *) ">> Please confirm: You wish to uninstall " prog name strcat "?" strcat Tell ReadYesNo not if ">> Aborted." Tell pid kill Then #0 "@a/calls/castxxx" remove_prop #0 "@a/prog_list/" prog "@a/name" getpropstr strcat remove_prop ">> Uninstalled. Please edit the online manual as appropriate." Tell ; : Doxxx ( -- ) VerifyEvent "Doxxx" Tell (* 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 "#castxxx" ourArg @ smatch if Doxxx else "#install" ourArg @ stringpfx if DoInstall else "#uninstall" ourArg @ stringpfx if DoUninstall else ">> #Argument not understood." Tell then then then exit then then ; . c q @set asys-ppp=W