$include $lib/gary'smufutils-strings $include $lib/gary'smufutils-lists $include $lib/gary'smufutils-misc $include $muf/rp/utils $include $lib/rp $def VERSION prog "_version" getpropstr $define .tell .ansi_tell $enddef $def RPlib_getstat getstat $def setprop copy @ if swap "/" rsplit swap "_" strcat dir @ strcat "/" strcat swap strcat swap then \setprop lvar type lvar items lvar copy lvar dir : extractTable (s -- ) (Extracts a table from $rpsystem for this registry) type ! "" items ! "/" strcat begin "$rpsystem" match swap nextprop dup "" stringcmp not not while dup "$rpsystem" match swap propdir? if dup "/" split pop var! dir dup dup "/" rinstr strcut swap pop (KEEPdir Name) ( items @ over element_list_add items ! ) prog { "/@registry/byType/" type @ "/items/" }cat 3 pick strcat 1 setprop (Set type on Reg object) dup var! nam prog "/@registry/byItem/" 3 pick dup var! item strcat "/" strcat propdir? if 1 var! copy else 0 copy ! then prog "/@registry/byItem/" 3 pick strcat "/type" strcat type @ setprop (Now step through directory!) over (KEEPdir Name Newdir) "/" strcat begin "$rpsystem" match swap nextprop dup "" stringcmp not not while dup dup "/" rinstr strcut swap pop (KEEPdir Name KEEPDir Property) (START >> HOTE HACK : Check for magic bit. And adjust type) dup "shock" stringcmp not if (Looking at a magic component!) prog "/@registry/byItem/" 5 pick strcat "/type" strcat "component" setprop (Check component type is set) 4 pick "/component" strcat "$rpsystem" match swap getpropstr "" stringcmp not if (Component type not set!) " Magic item without 'component' set : '" 4 pick strcat "'. Attempting to calculate possible 'fix'." strcat .tell (>KEEPdir< Name KEEPDir Property) 4 pick "/desc" strcat "$rpsystem" match swap getpropstr (DESC) dup "COMPONENT" instring 2 > if dup "COMPONENT" instring 2 - strcut pop " @set $rpsystem=" (ANSWER STRSOFAR) 6 pick strcat "/component:" strcat swap strcat .tell else pop " .. ^RED^FAILED" .tell then then then (FINISH >> HOTE HACK : Check for magic bit) (Work out copy across name) "/@registry/byItem/" 4 pick strcat "/" strcat over dup "desc" instring if pop "description" then strcat prog swap (KEEPdir Name KEEPDir Property prog Propdir) (Get value) 4 pick "$rpsystem" match swap getprop setprop pop repeat pop pop then repeat pop (prog "/@registry/byType/" type @ strcat "/items" strcat items @ setprop) ; : createTables "Clearing old tables..." .tell prog "/@registry/" remove_prop "Creating tables.." .tell "Creating attribute table.." .tell (No attribute listing stored. Do this manually) prog "/@registry/byType/attribute/description" "Core attributes that make up a character." setprop prog "/@registry/byType/attribute/items/Strength" 1 setprop prog "/@registry/byType/attribute/items/Dexterity" 1 setprop prog "/@registry/byType/attribute/items/Stamina" 1 setprop prog "/@registry/byType/attribute/items/Intelligence" 1 setprop prog "/@registry/byType/attribute/items/Perception" 1 setprop prog "/@registry/byType/attribute/items/Appearance" 1 setprop prog "/@registry/byType/attribute/items/Magery" 1 setprop prog "/@registry/byType/attribute/items/Willpower" 1 setprop prog "/@registry/byType/attribute/items/Gaia" 1 setprop prog "/@registry/byType/attribute/items/Humanity" 1 setprop prog "/@registry/byType/attribute/items/Resources" 1 setprop prog "/@registry/byType/attribute/items/Love" 1 setprop prog "/@registry/byType/attribute/maxvalue" "25" setprop prog "/@registry/byType/attribute/minvalue" "1" setprop "attribs" "attribute" extractTable (Chocostats) ( "Creating chocobo table.." .tell prog "/@registry/byType/chocobo/description" "Chocobo stats" setprop prog "/@registry/byType/chocobo/maxvalue" "99" setprop prog "/@registry/byType/chocobo/minvalue" "0" setprop "chocobo/stats" "Chocobo" extractTable ) (Specials) "Creating specials and components table.." .tell prog "/@registry/byType/special/description" "Special/Magical skills" setprop prog "/@registry/byType/special/maxvalue" "25" setprop prog "/@registry/byType/special/minvalue" "0" setprop "talents" "special" extractTable (Physical materials) "Creating materials table.." .tell prog "/@registry/byType/material/description" "Physical materials" setprop "materials" "material" extractTable prog "/@registry/byType/Bmaterial/description" "Black Market materials" setprop "bmaterials" "bmaterial" extractTable (Perks) "Creating perks table.." .tell prog "/@registry/byType/perk/description" "Things to buy as you go up levels." setprop prog "/@registry/byType/merit/maxvalue" "1" setprop prog "/@registry/byType/merit/minvalue" "0" setprop "Perk" "Perk" extractTable (Craft Perks) "Creating craft perks table.." .tell prog "/@registry/byType/craft perk/description" "Things to buy as you go up synth skill levels." setprop prog "/@registry/byType/merit/maxvalue" "1" setprop prog "/@registry/byType/merit/minvalue" "0" setprop "Crafting Perk" "Crafting Perk" extractTable (Mutations) "Creating mutations table.." .tell prog "/@registry/byType/Mutation/description" "Mutant abilities and disadvantages" setprop "Minor positive Mutation" "Minor Mutation" extractTable "Minor negative Mutation" "Minor Mutation" extractTable "Major positive Mutation" "Major Mutation" extractTable "Major negative Mutation" "Major Mutation" extractTable (Skills) "Creating skills table.." .tell prog "/@registry/byType/skill/description" "Mundane skills" setprop prog "/@registry/byType/skill/maxvalue" "25" setprop prog "/@registry/byType/skill/minvalue" "0" setprop "skill" "skill" extractTable (Merits) "Creating merits table.." .tell prog "/@registry/byType/merit/description" "Merits." setprop prog "/@registry/byType/merit/maxvalue" "1" setprop prog "/@registry/byType/merit/minvalue" "0" setprop "merit" "merit" extractTable (Flaws) "Creating flaws table.." .tell prog "/@registry/byType/merit/description" "Flaws." setprop prog "/@registry/byType/merit/maxvalue" "1" setprop prog "/@registry/byType/merit/minvalue" "0" setprop "flaw" "flaw" extractTable (Synths) "Creating synthesis table.." .tell prog "/@registry/byType/merit/description" "Synthesis Recipes" setprop prog "/@registry/byType/merit/maxvalue" "1" setprop prog "/@registry/byType/merit/minvalue" "0" setprop "recipes" "Synthesis" extractTable ( jobs ) "Creating jobs table.." .tell prog "/@registry/byType/job/description" "Jobs!" setprop "jobs" "job" extractTable (Race) "Creating racial table.." .tell prog "/@registry/byType/race/description" "Things to be born as." setprop prog "/@registry/byType/merit/maxvalue" "1" setprop prog "/@registry/byType/merit/minvalue" "0" setprop "Race" "Race" extractTable (Cards) "Creating cards table.." .tell prog "/@registry/byType/cards/description" "Trading card game" setprop prog "/@registry/byType/cards/maxvalue" "25" setprop prog "/@registry/byType/cards/minvalue" "0" setprop "cards" "cards" extractTable "Program finished successfully." .tell ; lvar result : DoSearch (Searches for properties on player objects @rp/special/ dir that haven't got a description) "Please note that this search uses registry tables NOT on the $rpsystem object. If you update any properties on $rpsystem, use 'reg #create' afterwards so these tables can note the differences" .tell "Search starts..." .tell "" result ! dbtop begin 1 - dup #0 dbcmp not while dup ok? if dup "@rp/special/" propdir? if "@rp/special/" begin over swap nextprop dup "" stringcmp not not while (ObjectKEEP SpecialProp) dup dup "/" rinstring strcut swap pop (ObjectKEEP PropKEEP Special) dup "description" RpUtils.getRegistryItem "" stringcmp not if result @ over element_list_find not if result @ swap element_list_add result ! else pop then else pop then repeat pop then then repeat pop "....Search stops" .tell "Results: " result @ "|" english_list strcat .tell result @ dup "" stringcmp not if "All up to date!" .tell exit then "|" explode begin swap "@set $rpsystem=talents/" swap strcat "/desc:?" strcat .tell 1 - dup not until pop ; : main dup "#help" stringcmp not if "This is the command for creating the 'caches' of registry information that +info uses." .tell exit then dup "#create" stringcmp not if background createTables exit then dup "#search" stringcmp not if background Dosearch exit then "Dunno what you want to do! Try #help." .tell ;