@q @program asys-info 1 99999 d i ( asys-info v1.2 Jessy@FurryMUCK 6/00 This program handles the Argo +info command, used to display entries in the Argo database for a MUCK or realm. INSTALLATION: asys-info uses the standard Argo installation method. Port the program and set it Wizard. Type '+install asys-info' USAGE: +info / Example: +info skills/bows asys-info may be freely ported. Please comment any changes. ) (2345678901234567890123456789012345678901234567890123456789012345678901) $def thisVersion "1.2" $define Tell me @ owner swap notify $enddef $include $lib/argo lvar lib (* dbref of lib-Argo *) lvar ourArg (* inital arg string, unmodified *) lvar ourBoolean (* int: misc flow control var *) lvar ourCat (* string: category to view *) lvar ourCom (* string: 'official' name of command *) lvar ourCounter (* misc. counter var *) lvar ourDataObj (* dbref: object holding system-wide data *) lvar ourEntry (* string: dbase entry to view *) lvar ourProp (* string: propdir holding dbase entry *) lvar ourString (* string: workspace var *) 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 prog "@a/version" getpropstr if ">> Reinstalling..." Tell else ">> Installing..." Tell then (* record 'official' name of prog; remove old links *) prog "@a/name" "asys-info" setprop RecOldActions (* create and register command; set default props *) #0 "+info" newexit dup scratch ! prog setlink prog "@a/version" thisVersion setprop scratch @ "@a/version" thisVersion setprop #0 "@a/comm_list/+info" scratch @ setprop #0 "@a/prog_list/" prog name strcat prog setprop scratch @ "@a/name" "+info" 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/+info" RemoveCommand #0 "@a/prog_list/" prog "@a/name" getpropstr strcat remove_prop RecOldActions ">> Uninstalled. Please edit the online manual as appropriate." Tell ; : DoShowValidCats ( -- i ) (* categories with entries *) ourDataObj @ "@a/dis-ad/" nextprop if "Advantages" "Disadvantages" then ourDataObj @ "@a/creatures/" nextprop if "Creatures" then ourDataObj @ "@a/groups/" nextprop if "Groups" then ourDataObj @ "@a/jobs/" nextprop if "Jobs" then ourDataObj @ "@a/npcs/" nextprop if "NPCs" then ourDataObj @ "@a/languages/" nextprop if "Languages" then ourDataObj @ "@a/objects/" nextprop if "Objects" then ourDataObj @ "@a/psiabs/" nextprop if "Psiabs" then ourDataObj @ "@a/skills/" nextprop if "Skills" then ourDataObj @ "@a/spells/" nextprop if "Spells" then ourDataObj @ "@a/tplates/" nextprop if "Templates" then depth if " " Tell "Categories that have defined entries currently include:" Tell " " Tell depth Sort depth 3-col 1 else "Currently there are no defined database entries for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell 0 then ; : DoGetCategory ( -- i ) (* get category to view *) (* return true if successful *) (* store cat name in ourCat; store cat propdir in ourString *) "advantages" ourCat @ stringpfx if "@a/dis-ad/" "advantage" else "creatures" ourCat @ stringpfx if "@a/creatures/" "creature" else "disadvantages" ourCat @ stringpfx if "@a/dis-ad/" "disadvantage" else "groups" ourCat @ stringpfx if "@a/groups/" "group" else "jobs" ourCat @ stringpfx if "@a/jobs/" "job" else "npcs" ourCat @ stringpfx if "@a/npcs/" "NPC" else "languages" ourCat @ stringpfx if "@a/languages/" "psiab" else "objects" ourCat @ stringpfx if "@a/objects/" "object" else "psiabs" ourCat @ stringpfx if "@a/psiabs/" "psiab" else "psionic abilities" ourCat @ stringpfx if "@a/psiabs/" "psiab" else "skills" ourCat @ stringpfx if "@a/skills/" "skill" else "spells" ourCat @ stringpfx if "@a/spells/" "spell" else "templates" ourCat @ stringpfx if "@a/tplates/" "template" else ">> Category not found." Tell 0 exit then then then then then then then then then then then then then ourString ! ourCat ! 1 ; : DoShowSyntax ( -- ) (* show syntax for +info *) "Syntax:" Tell " " Tell " $com / For example..." command @ "$com" subst Tell " $com objects/sword " Tell " " command @ "$com" subst Tell "If is omitted, the program will put you at a prompt where " "you can list entries and display them by name or number. If both " " and are omitted, you will be prompted for a " "category, then an entry." strcat strcat strcat Tell ; : DoHelp ( -- ) (* display help screen *) " " Tell prog name " (#" strcat prog intostr strcat ")" strcat Tell " " Tell "The $com command is used to display information about entries in the " "MUCK's or realm's Argo database. To use it, specify an entry " "category, followed by a / slash mark, followed by the entry within " "the specified category that you want to view:" strcat strcat strcat command @ "$com" subst Tell " " Tell DoShowSyntax DoShowValidCats ; : DoShowAbilities ( -- ) (* show abilities for creature/npc *) " STR: " ourDataObj @ ourProp @ "/stats/str" strcat getpropstr strcat Tell " CON: " ourDataObj @ ourProp @ "/stats/con" strcat getpropstr strcat Tell " DEX: " ourDataObj @ ourProp @ "/stats/dex" strcat getpropstr strcat Tell " INT: " ourDataObj @ ourProp @ "/stats/int" strcat getpropstr strcat Tell " PRE: " ourDataObj @ ourProp @ "/stats/pre" strcat getpropstr strcat Tell (* display skills *) ourDataObj @ ourProp @ "/skills/" strcat nextprop dup if " " Tell begin dup while " Skills: $inst ($level)" over dup "/" rinstr strcut swap pop "$inst" subst ourDataObj @ 3 pick getpropstr "$level" subst Tell ourDataObj @ swap nextprop repeat then pop (* display spells *) ourDataObj @ ourProp @ "/spells/" strcat nextprop dup if " " Tell begin dup while " Spells: $inst ($level)" over dup "/" rinstr strcut swap pop "$inst" subst ourDataObj @ 3 pick getpropstr "$level" subst Tell ourDataObj @ swap nextprop repeat then pop (* display psiabs *) ourDataObj @ ourProp @ "/psiabs/" strcat nextprop dup if " " Tell begin dup while " Psiabs: $inst ($level)" over dup "/" rinstr strcut swap pop "$inst" subst ourDataObj @ 3 pick getpropstr "$level" subst Tell ourDataObj @ swap nextprop repeat then pop (* display languages *) ourDataObj @ ourProp @ "/languages/" strcat nextprop dup if " " Tell begin dup while " Languages: $inst ($level)" over dup "/" rinstr strcut swap pop "$inst" subst ourDataObj @ 3 pick getpropstr "$level" subst Tell ourDataObj @ swap nextprop repeat then pop ourDataObj @ ourProp @ "/dis-ad/" strcat nextprop dup if " " Tell begin dup while ourDataObj @ over getpropstr atoi -1 > if ourDataObj @ swap nextprop continue then " Advantages: $inst ($level)" over dup "/" rinstr strcut swap pop "$inst" subst ourDataObj @ 3 pick getpropstr "$level" subst Tell ourDataObj @ swap nextprop repeat then pop ourDataObj @ ourProp @ "/dis-ad/" strcat nextprop dup if " " Tell begin dup while ourDataObj @ over getpropstr atoi 0 < if ourDataObj @ swap nextprop continue then " Disadvantages: $inst ($level)" over dup "/" rinstr strcut swap pop "$inst" subst ourDataObj @ 3 pick getpropstr "$level" subst Tell ourDataObj @ swap nextprop repeat then pop ; : DoShowCreature ( -- ) (* show info about creature ourEntry *) ourDataObj @ ourCat @ ourEntry @ strcat "/masked" strcat getpropstr StaffCheck not and if ">> Permission denied." Tell exit then ourDataObj @ "@a/creatures/" nextprop not if ">> No creatures have been defined for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell exit then ">> CREATURE INFORMATION FOR '$creature':" ourEntry @ "$creature" subst toupper Tell " " Tell DoShowAbilities ; : DoShowDisAd ( -- ) (* show info about DisAd ourEntry *) ourDataObj @ ourCat @ ourEntry @ strcat "/masked" strcat getpropstr StaffCheck not and if ">> Permission denied." Tell exit then ourDataObj @ "@a/dis-ad/" nextprop not if ">> No advantages or disadvantages have been defined for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell exit then ">> $cat INFORMATION FOR '$disad':" ourString @ "$cat" subst ourEntry @ "$disad" subst toupper Tell " " Tell " Point Bonus: $cost" ourDataObj @ ourProp @ getpropstr atoi -1 * intostr "$cost" subst Tell " " Tell ourDataObj @ ourProp @ "/trigs#/" strcat nextprop dup if begin dup while ourDataObj @ over getpropstr "," explode pop " Triggered Effects: $cat: $inst ($level)" swap CapAll "$cat" subst swap CapAll "$inst" subst swap CapAll "$level" subst Tell ourDataObj @ swap nextprop repeat pop else " Triggered Effects: " Tell pop then ; : DoShowGroup ( -- ) (* show info about group ourEntry *) ourDataObj @ ourCat @ ourEntry @ strcat "/masked" strcat getpropstr StaffCheck not and if ">> Permission denied." Tell exit then ourDataObj @ "@a/groups/" nextprop not if ">> No groups have been defined for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell exit then ">> GROUP INFORMATION FOR '$group':" ourEntry @ "$group" subst toupper Tell " " Tell " Minimum Status: $status" ourDataObj @ ourProp @ getpropstr "$status" subst Tell ; : DoShowJob ( -- ) (* show info about a specific job *) ourDataObj @ ourCat @ ourEntry @ strcat "/masked" strcat getpropstr StaffCheck not and if ">> Permission denied." Tell exit then ourDataObj @ "@a/jobs/" nextprop not if ">> No jobs have been defined for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell exit then ">> JOB INFORMATION FOR '$job':" ourEntry @ "$job" subst toupper Tell " " Tell ourDataObj @ ourProp @ "/preqs#/" strcat nextprop dup if begin dup while ourDataObj @ over getpropstr "," explode pop " Prequisites: $cat: $inst ($level)" swap CapAll "$cat" subst swap CapAll "$inst" subst swap "$level" subst Tell ourDataObj @ swap nextprop repeat pop else " Prerequisites: " Tell pop then " " Tell " Salary: $sal" ourDataObj @ ourProp @ "/salary" strcat getpropstr dup if atoi ExpressLowestMoney else "" then "$sal" subst Tell " Hiring Modifier: $hm" ourDataObj @ ourProp @ "/hmod" strcat getpropstr dup not if pop "" then "$hm" subst Tell " Injury Chance: $ic%" ourDataObj @ ourProp @ "/injchance" strcat getpropstr dup not if pop "" then "$ic" subst Tell " Injury Amount: $ir" ourDataObj @ ourProp @ "/injdam" strcat getpropstr dup not if pop "" then "$ir" subst Tell ; : DoShowLanguage ( -- ) (* show info about language ourEntry *) ourDataObj @ ourCat @ ourEntry @ strcat "/masked" strcat getpropstr StaffCheck not and if ">> Permission denied." Tell exit then ourDataObj @ "@a/languages/" nextprop not if ">> No languages have been defined for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell exit then "DoShowLanguage" Tell ; : DoShowObject ( -- ) (* show info about a specific object *) ourDataObj @ ourCat @ ourEntry @ strcat "/masked" strcat getpropstr StaffCheck not and if ">> Permission denied." Tell exit then ourDataObj @ "@a/objects/" nextprop not if ">> No objects have been defined for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell exit then ">> object INFORMATION FOR '$object':" ourEntry @ "$object" subst toupper Tell " " Tell " Std. Cost: $cost" ourDataObj @ ourProp @ "/cost" strcat getpropstr atoi ExpressLowestMoney "$cost" subst Tell " " Tell ourDataObj @ ourProp @ "/class/" strcat nextprop begin dup while " Class: $class ($val)" ourDataObj @ 3 pick getpropstr "$val" subst over dup "/" rinstr strcut swap pop CapAll "$class" subst Tell ourDataObj @ swap nextprop repeat pop ourDataObj @ ourProp @ "/create/" strcat nextprop if " " Tell ourDataObj @ ourProp @ "/create/prereqs/" strcat nextprop dup if ourDataObj @ over "/" strcat nextprop begin dup while begin dup while ourDataObj @ over getpropstr over dup "/" rinstr strcut UnAbbreviateStat CapAll swap dup strlen 1 - strcut pop dup "/" rinstr strcut swap pop CapAll " Create Prereq's: $cat: $inst ($level)" swap "$cat" subst swap "$inst" subst swap "$level" subst Tell ourDataObj @ swap nextprop repeat pop ourDataObj @ swap nextprop repeat pop else " Create Prereq's: " Tell pop then ourDataObj @ ourProp @ "/create/tools/" strcat nextprop dup if begin dup while " Create Tools: $inst ($count)" over dup "/" rinstr strcut swap pop strip CapAll "$inst" subst ourDataObj @ 3 pick getpropstr "$count" subst Tell ourDataObj @ swap nextprop repeat pop else " Create Tools: " Tell pop then ourDataObj @ ourProp @ "/create/materials/" strcat nextprop dup if begin dup while " Create Materials: $inst ($count)" over dup "/" rinstr strcut swap pop strip CapAll "$inst" subst ourDataObj @ 3 pick getpropstr "$count" subst Tell ourDataObj @ swap nextprop repeat pop else " Create Materials: " Tell pop then ourDataObj @ ourProp @ "/create/rolls/" strcat nextprop if ourDataObj @ ourProp @ "/create/rolls/skills/" strcat nextprop dup if begin dup while " Create Rolls: $inst ($count)" over dup "/" rinstr strcut swap pop strip CapAll "$inst" subst ourDataObj @ 3 pick getpropstr "$count" subst Tell ourDataObj @ swap nextprop repeat pop else pop then ourDataObj @ ourProp @ "/create/rolls/spells/" strcat nextprop dup if begin dup while " Create Rolls: $inst ($count)" over dup "/" rinstr strcut swap pop strip CapAll "$inst" subst ourDataObj @ 3 pick getpropstr "$count" subst Tell ourDataObj @ swap nextprop repeat pop else pop then ourDataObj @ ourProp @ "/create/rolls/psiabs/" strcat nextprop dup if begin dup while " Create Rolls: $inst ($count)" over dup "/" rinstr strcut swap pop strip CapAll "$inst" subst ourDataObj @ 3 pick getpropstr "$count" subst Tell ourDataObj @ swap nextprop repeat pop else pop then else " Create Rolls: " Tell pop then " Create Time: $time" ourDataObj @ ourProp @ "/create/time" strcat getprop ParseTimeInt "$time" subst Tell then ourDataObj @ ourProp @ "/repair/" strcat nextprop if ourDataObj @ ourProp @ "/repair/prereqs/" strcat nextprop dup if ourDataObj @ over "/" strcat nextprop begin dup while begin dup while ourDataObj @ over getpropstr over dup "/" rinstr strcut UnAbbreviateStat CapAll swap dup strlen 1 - strcut pop dup "/" rinstr strcut swap pop CapAll " Repair Prereq's: $cat: $inst ($level)" swap "$cat" subst swap "$inst" subst swap "$level" subst Tell ourDataObj @ swap nextprop repeat pop ourDataObj @ swap nextprop repeat pop else " Repair Prereq's: " Tell pop then ourDataObj @ ourProp @ "/repair/tools/" strcat nextprop dup if begin dup while " Repair Tools: $inst ($count)" over dup "/" rinstr strcut swap pop strip CapAll "$inst" subst ourDataObj @ 3 pick getpropstr "$count" subst Tell ourDataObj @ swap nextprop repeat pop else " Repair Tools: " Tell pop then ourDataObj @ ourProp @ "/repair/materials/" strcat nextprop dup if begin dup while " Repair Materials: $inst ($count)" over dup "/" rinstr strcut swap pop strip CapAll "$inst" subst ourDataObj @ 3 pick getpropstr "$count" subst Tell ourDataObj @ swap nextprop repeat pop else " Repair Materials: " Tell pop then " Repair Time: $time" ourDataObj @ ourProp @ "/repair/time" strcat getprop ParseTimeInt "$time" subst Tell then ourDataObj @ ourProp @ "/class/weapons" strcat getpropstr if " " Tell ourDataObj @ ourProp @ "/combat/skills/" strcat nextprop begin dup while " Combat Skill: " over dup "/" rinstr strcut swap pop strip CapAll strcat Tell ourDataObj @ swap nextprop repeat pop 0 ourBoolean ! " Min STR: " ourDataObj @ ourProp @ "/combat/minstr" strcat getpropstr strcat Tell " Damage: " ourDataObj @ ourProp @ "/combat/dam" strcat getpropstr strcat Tell " Hands: " ourDataObj @ ourProp @ "/combat/hands" strcat getpropstr strcat Tell " Ranged: " ourDataObj @ ourProp @ "/combat/ranged" strcat getpropstr if 1 ourBoolean ! "Yes" else "No" then strcat Tell ourBoolean @ if " Range: " ourDataObj @ ourProp @ "/combat/maxrange" strcat getpropstr atoi intostr strcat " meters" strcat Tell " Range Mod: " ourDataObj @ ourProp @ "/combat/rangemod" strcat getpropstr atoi intostr strcat " meters" strcat Tell then " Fencing: " ourDataObj @ ourProp @ "/class/fencing weapons" strcat getpropstr if "Yes" else "No" then strcat Tell " Can Parry: " ourDataObj @ ourProp @ "/combat/parry" strcat getpropstr if "Yes" else "No" then strcat Tell " Can be Dodged: " ourDataObj @ ourProp @ "/combat/dable" strcat getpropstr if "Yes" else "No" then strcat Tell " Can be Blocked: " ourDataObj @ ourProp @ "/combat/bable" strcat getpropstr if "Yes" else "No" then strcat Tell " Can be Parried: " ourDataObj @ ourProp @ "/combat/pable" strcat getpropstr if "Yes" else "No" then strcat Tell " Damage Type: " ourDataObj @ ourProp @ "/combat/type" strcat getpropstr CapAll strcat Tell then ourDataObj @ ourProp @ "/armor/" strcat nextprop if " " Tell " To-Hit Mod: " ourDataObj @ ourProp @ "/armor/damred" strcat getpropstr dup if atoi -1 * intostr else pop "" then strcat Tell " Damage Reduction: " ourDataObj @ ourProp @ "/armor/damred" strcat getpropstr dup not if pop "0" then strcat Tell " DEX Penalty: " ourDataObj @ ourProp @ "/armor/dexred" strcat getpropstr dup not if pop "0" then strcat Tell " Fatigue Penalty: " ourDataObj @ ourProp @ "/armor/fatacc" strcat getpropstr dup not if pop "0" then strcat Tell " Speed Penalty: " ourDataObj @ ourProp @ "/armor/fatacc" strcat getpropstr dup not if pop "0" then strcat " seconds" strcat Tell then ; : DoShowNPC ( -- ) (* show info about npc ourEntry *) ourDataObj @ ourCat @ ourEntry @ strcat "/masked" strcat getpropstr StaffCheck not and if ">> Permission denied." Tell exit then ourDataObj @ "@a/npcs/" nextprop not if ">> No NPCs have been defined for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell exit then ">> NPC INFORMATION FOR '$npc':" ourEntry @ "$npc" subst toupper Tell " " Tell DoShowAbilities ; : DoShowTemplate ( -- ) (* show info about template ourEntry *) ourDataObj @ ourCat @ ourEntry @ strcat "/masked" strcat getpropstr StaffCheck not and if ">> Permission denied." Tell exit then ourDataObj @ "@a/tplates/" nextprop not if ">> No templates have been defined for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell exit then ">> TEMPLATE INFORMATION FOR '$entry':" ourEntry @ "$entry" subst toupper Tell 0 ourBoolean ! ourDataObj @ ourProp @ "#/" strcat nextprop begin dup while ourDataObj @ over getpropstr dup "stats*" smatch if ourBoolean @ not if 1 ourBoolean ! " " Tell then "," explode pop pop " Stats: $inst ($level)" swap toupper "$inst" subst swap "$level" subst Tell else pop then ourDataObj @ swap nextprop repeat pop 0 ourBoolean ! ourDataObj @ ourProp @ "#/" strcat nextprop begin dup while ourDataObj @ over getpropstr dup "skills*" smatch if ourBoolean @ not if 1 ourBoolean ! " " Tell then "," explode pop pop " Skills: $inst ($level)" swap CapAll "$inst" subst swap "$level" subst Tell else pop then ourDataObj @ swap nextprop repeat pop 0 ourBoolean ! ourDataObj @ ourProp @ "#/" strcat nextprop begin dup while ourDataObj @ over getpropstr dup "spells*" smatch if ourBoolean @ not if 1 ourBoolean ! " " Tell then "," explode pop pop " Spells: $inst ($level)" swap CapAll "$inst" subst swap "$level" subst Tell else pop then ourDataObj @ swap nextprop repeat pop 0 ourBoolean ! ourDataObj @ ourProp @ "#/" strcat nextprop begin dup while ourDataObj @ over getpropstr dup "psiabs*" smatch if ourBoolean @ not if 1 ourBoolean ! " " Tell then "," explode pop pop " Psiabs: $inst ($level)" swap CapAll "$inst" subst swap "$level" subst Tell else pop then ourDataObj @ swap nextprop repeat pop 0 ourBoolean ! ourDataObj @ ourProp @ "#/" strcat nextprop begin dup while ourDataObj @ over getpropstr dup "languages*" smatch if ourBoolean @ not if 1 ourBoolean ! " " Tell then "," explode pop pop " Languages: $inst ($level)" swap CapAll "$inst" subst swap "$level" subst Tell else pop then ourDataObj @ swap nextprop repeat pop 0 ourBoolean ! ourDataObj @ ourProp @ "#/" strcat nextprop begin dup while ourDataObj @ over getpropstr dup "dis-ad*" smatch if "," explode pop pop over atoi -1 > if ourBoolean @ not if 1 ourBoolean ! " " Tell then " Advantages: $inst ($level)" swap CapAll "$inst" subst swap "$level" subst Tell else pop pop then else pop then ourDataObj @ swap nextprop repeat pop 0 ourBoolean ! ourDataObj @ ourProp @ "#/" strcat nextprop begin dup while ourDataObj @ over getpropstr dup "*dis-ad*" smatch if "," explode pop pop over atoi 0 < if ourBoolean @ not if 1 ourBoolean ! " " Tell then " Disadvantages: $inst ($level)" swap CapAll "$inst" subst swap "$level" subst Tell else pop pop then else pop then ourDataObj @ swap nextprop repeat pop 0 ourBoolean ! 0 ourCounter ! ourDataObj @ ourProp @ "#/" strcat nextprop begin dup while dup "*cost" smatch if ourDataObj @ swap nextprop continue then dup "*dis-ad" smatch if ourDataObj @ swap nextprop continue then ourDataObj @ over getpropstr "," explode pop pop pop ourCounter @ swap atoi + ourCounter ! ourDataObj @ swap nextprop repeat pop " " Tell " Figured Cost: $cost" ourCounter @ intostr "$cost" subst Tell " Charged Cost: $cost" ourDataObj @ ourProp @ "#/cost" strcat getpropstr "$cost" subst Tell ; : DoShowSkill ( -- ) (* show info about a specific skill *) ourDataObj @ ourCat @ ourEntry @ strcat "/masked" strcat getpropstr StaffCheck not and if ">> Permission denied." Tell exit then ourDataObj @ "@a/skills/" nextprop not if ">> No skills have been defined for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell exit then ">> SKILL INFORMATION FOR '$entry':" ourEntry @ "$entry" subst toupper Tell " " Tell ourDataObj @ ourProp @ getpropstr "," explode pop rot pop " Base: $bas" swap UnAbbreviateStat CapAll "$bas" subst Tell " " Tell " INT Rating: $int" swap "$int" subst Tell " " Tell ourDataObj @ ourProp @ "/preqs#/" strcat nextprop dup if begin dup while ourDataObj @ over getpropstr "," explode pop " Prequisites: $cat: $inst ($level)" swap CapAll "$cat" subst swap CapAll "$inst" subst swap "$level" subst Tell ourDataObj @ swap nextprop repeat pop else " Prerequisites: " Tell pop then " " Tell ourDataObj @ ourProp @ "/tools/" strcat nextprop dup if begin dup while " Tools: $inst ($count)" over dup "/" rinstr strcut swap pop strip CapAll "$inst" subst ourDataObj @ 3 pick getpropstr "$count" subst Tell ourDataObj @ swap nextprop repeat pop else " Tools: " Tell pop then " " Tell ourDataObj @ ourProp @ "/materials/" strcat nextprop dup if begin dup while " Materials: $inst ($count)" over dup "/" rinstr strcut swap pop strip CapAll "$inst" subst ourDataObj @ 3 pick getpropstr "$count" subst Tell ourDataObj @ swap nextprop repeat pop else " Materials: " Tell pop then " " Tell ; : DoShowSpell ( -- ) (* show info about a specific spell *) ourDataObj @ ourCat @ ourEntry @ strcat "/masked" strcat getpropstr StaffCheck not and if ">> Permission denied." Tell exit then ourDataObj @ "@a/spells/" nextprop not if ">> No spells have been defined for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell exit then ">> spell INFORMATION FOR '$spell':" ourEntry @ "$spell" subst toupper Tell " " Tell ourDataObj @ ourProp @ getpropstr "," explode pop rot pop " Base: $bas" swap UnAbbreviateStat CapAll "$bas" subst Tell " " Tell " INT Rating: $int" swap "$int" subst Tell " " Tell ourDataObj @ ourProp @ "/preqs#/" strcat nextprop dup if begin dup while ourDataObj @ over getpropstr "," explode pop " Prequisites: $cat: $inst ($level)" swap CapAll "$cat" subst swap CapAll "$inst" subst swap "$level" subst Tell ourDataObj @ swap nextprop repeat pop else " Prerequisites: " Tell pop then " " Tell ourDataObj @ ourProp @ "/tools/" strcat nextprop dup if begin dup while " Components: $inst ($count)" over dup "/" rinstr strcut swap pop strip CapAll "$inst" subst ourDataObj @ 3 pick getpropstr "$count" subst Tell ourDataObj @ swap nextprop repeat pop else " Components: " Tell pop then " " Tell ourDataObj @ ourProp @ "/materials/" strcat nextprop dup if begin dup while " Materials: $inst ($count)" over dup "/" rinstr strcut swap pop strip CapAll "$inst" subst ourDataObj @ 3 pick getpropstr "$count" subst Tell ourDataObj @ swap nextprop repeat pop else " Materials: " Tell pop then " " Tell " Fatigue: $fat" ourDataObj @ ourProp @ "/fat" strcat getpropstr dup if dup "/" rinstr strcut swap pop UnabbreviateStat CapAll " " swap strcat else pop "" then "$fat" subst Tell " Defence: $def" ourDataObj @ ourProp @ "/def" strcat getpropstr dup if dup "/" rinstr strcut swap pop UnabbreviateStat CapAll " " swap strcat else pop "" then "$def" subst Tell ; : DoShowPsiab ( -- ) (* show info about a specific psiab *) ourDataObj @ ourCat @ ourEntry @ strcat "/masked" strcat getpropstr StaffCheck not and if ">> Permission denied." Tell exit then ourDataObj @ "@a/psiabs/" nextprop not if ">> No psiabs have been defined for this $scope." ourDataObj @ #0 dbcmp if "MUCK" else "realm" then "$scope" subst Tell exit then ">> psiab INFORMATION FOR '$psiab':" ourEntry @ "$psiab" subst toupper Tell " " Tell ourDataObj @ ourProp @ getpropstr "," explode pop rot pop " Base: $bas" swap UnAbbreviateStat CapAll "$bas" subst Tell " " Tell " INT Rating: $int" swap "$int" subst Tell " " Tell ourDataObj @ ourProp @ "/preqs#/" strcat nextprop dup if begin dup while ourDataObj @ over getpropstr "," explode pop " Prequisites: $cat: $inst ($level)" swap CapAll "$cat" subst swap CapAll "$inst" subst swap "$level" subst Tell ourDataObj @ swap nextprop repeat pop else " Prerequisites: " Tell pop then " " Tell " Fatigue: $fat" ourDataObj @ ourProp @ "/fat" strcat getpropstr dup if dup "/" rinstr strcut swap pop UnabbreviateStat CapAll " " swap strcat else pop "" then "$fat" subst Tell " Defence: $def" ourDataObj @ ourProp @ "/def" strcat getpropstr dup if dup "/" rinstr strcut swap pop UnabbreviateStat CapAll " " swap strcat else pop "" then "$def" subst Tell ; : DoListEntries ( -- ) (* list entries for current cat *) ourCat @ 3-coln-prop ; : DoFindEntryByNumber ( -- i ) (* find entry ourEntry *) (* return true if successful *) "" scratch ! 0 ourCounter ! ourEntry @ atoi ourEntry ! ourDataObj @ ourCat @ nextprop begin dup while ourCounter @ 1 + ourCounter ! ourCounter @ ourEntry @ = if dup dup "/" rinstr strcut swap pop scratch ! break then ourDataObj @ swap nextprop repeat pop scratch @ if scratch @ ourEntry ! 1 else ourEntry @ intostr ourEntry ! 0 then ourEntry @ "" "#" subst ourEntry ! ; : DoFindEntryByName ( -- i ) (* find entry ourEntry *) (* return true if successful *) "" scratch ! ourCat @ "@a/tplates/" smatch if ourEntry @ "#" strcat ourEntry ! then ourDataObj @ ourCat @ nextprop begin dup while dup dup "/" rinstr strcut swap pop ourEntry @ smatch if dup dup "/" rinstr strcut swap pop scratch ! break then ourDataObj @ swap nextprop repeat pop scratch @ if scratch @ ourEntry ! 1 else 0 then ourEntry @ "" "#" subst ourEntry ! ; : DoShowEntry ( -- ) (* route to display routine for ourCat *) ourCat @ "@a/creatures/" smatch if DoShowCreature else ourCat @ "@a/dis-ad/" smatch if DoShowDisAd else ourCat @ "@a/groups/" smatch if DoShowGroup else ourCat @ "@a/jobs/" smatch if DoShowJob else ourCat @ "@a/languages/" smatch if DoShowLanguage else ourCat @ "@a/objects/" smatch if DoShowObject else ourCat @ "@a/npcs/" smatch if DoShowNPC else ourCat @ "@a/skills/" smatch if DoShowSkill else ourCat @ "@a/spells/" smatch if DoShowSpell else ourCat @ "@a/psiabs/" smatch if DoShowPsiab else ourCat @ "@a/tplates/" smatch if DoShowTemplate else ">> Entry not found." Tell then then then then then then then then then then then ; : DoShowEntryByNumber ( -- )(* find entry by number ourEntry; show *) DoFindEntryByNumber if ourCat @ ourEntry @ strcat ourProp ! DoShowEntry else ">> $cat number $num not found." ourString @ tolower CapAll "$cat" subst ourEntry @ "$num" subst Tell then ; : DoShowEntryByName ( -- ) (* find entry by name ourEntry; show *) DoFindEntryByName if ourCat @ ourEntry @ strcat ourProp ! DoShowEntry else ">> $cat '$name' not found." ourString @ tolower CapAll "$cat" subst ourEntry @ CapAll "$name" subst Tell then ; : DoInfoLoop ( -- ) (* prompt for entry to show *) begin ">> What $cat do you want information about?" ourString @ tolower "$cat" subst Tell ">> [Enter $cat name or number, .l to list choices, .q to quit]" ourString @ tolower "$cat" subst Tell ReadLine strip QCheck ".list" over stringpfx if DoListEntries NukeStack continue then dup number? if ourEntry ! DoShowEntryByNumber else ourEntry ! DoShowEntryByName then NukeStack repeat ; : DoCategoryLoop ( -- ) (* read category, then go to DoInfoLoop *) begin ">> What category do you want information about?" Tell ">> [Enter category, .l to list choices, or .q to quit]" Tell ReadLine strip QCheck ".list" over stringpfx if pop DoShowValidCats else ourCat ! DoGetCategory if DoInfoLoop then then NukeStack repeat ; : DoInfo ( -- ) ourArg @ if ourArg @ "/" instr if ourArg @ dup "/" rinstr strcut strip ourEntry ! strip dup strlen 1 - strcut pop strip ourCat ! else ourArg @ ourCat ! then DoGetCategory not if exit then ourEntry @ if ourEntry @ number? if DoShowEntryByNumber else DoShowEntryByName then else DoInfoLoop then else DoCategoryLoop then ; : main "me" match me ! (* initialize *) "$lib/argo" match lib ! GetDataObj ourDataObj ! strip ourArg ! trig "@a/name" getpropstr ourCom ! Update 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? DoInfo ; . c q @set asys-info=W