Help with POtionslist DB

by Argamendon

Back to Mechanic's Corner.

Argamendon2007-03-02 15:31:49
I have made attempted to make a Potion List database that does not depend on the Potionlist skill, it will give what is in each vial and what the vial is made of and how many months left on each vial.

It mostly works, for some reason the trigger for what the vial is made out of dose not catch. and it does not list all the vials that exsist.

I could use another set of eyes to look at it, any suggestions would be greatly appreciated.

here is the code

#CLASS {Potionslist}
#VAR Elixerlist {} {}
#VAR elist {} {}
#Elixers {} {}
#VAR pbnum {0} {0}
#VAR monthsleft {0} {0}
#VAR vialtype {} {}
#ALIAS getpl {#FO @elist {probe %i;#wait 300}}
#ALIAS saveall {#VAR %1 @%1 @%1 @%1}
#ALIAS showch {#SHOW Potionlist:;#SHOW %format( "&-10s &-7s &-9s &-9s", "Filled", "Months", "Vialtype", "Number");#FO @elist {#SHOW %format( "&-10s &-7.0f &-9s" &-9s, @%i.potion, @%i.mleft, @%i.vialt, @%i.number)}}
#ONINPUT {probe (*)} {#VAR pbnum %1 0 {elist}}
#TRIGGER {~"vial(%d)} {#ADDITEM Elixerlist %1;saveall Elixerlist}
#TRIGGER {^This vial has been fashioned by a highly trained artisan from (%w)$} {#VAR vialtype %1 0 {elist}}
#TRIGGER {^It has (%d) months of usefulness left$} {#VAR monthsleft %1 0 {elist}}
#TRIGGER {^a potion of {%w) sloshes about in it$} {#VAR %1filltype {} {} {elist};#ADDKEY %1filltype potion %1;#ADDKEY %1filltype mleft @monthsleft;#ADDKEY %1filltype vialt @vialtype;#ADDKEY %1filltype number @pbnum;saveall %1filltype;#ADDITEM elist %1filltype;saveall elist;#VAR %1filltype}
#TRIGGER {^a (%w) purgative sloshes about in it$}{#{#VAR %1filltype {} {} {elist};#ADDKEY %1filltype potion %1;#ADDKEY %1filltype mleft @monthsleft;#ADDKEY %1filltype vialt @vialtype;#ADDKEY %1filltype number @pbnum;saveall %1filltype;#ADDITEM elist %1filltype;saveall elist;#VAR %1filltype}
#TRIGGER {^(%w) sloshes about in it.$} {#VAR %1filltype {} {}{elist};#ADDKEY %1filltype potion %1;#ADDKEY %1filltype mleft @monthsleft;#ADDKEY %1filltype vialt @vialtype;#ADDKEY %1filltype number @pbnum;saveall %1filltype;#ADDITEM elist %1filltype;saveall elist;#VAR %1filltype}
#TRIGGER {^an (%w) potion sloshes about in it$} {#VAR %1filltype {} {} {elist};#ADDKEY %1filltype potion %1;#ADDKEY %1filltype mleft @monthsleft;#ADDKEY %1filltype vialt @vialtype;#ADDKEY %1filltype number @pbnum;saveall %1filltype;#ADDITEM elist %1filltype;saveall elist;#VAR %1filltype}
#TRIGGER {^a(%w) salve sloshes about in it$} {#VAR %1filltype {} {} {elist};#ADDKEY %1filltype potion %1;#ADDKEY %1filltype mleft @monthsleft;#ADDKEY %1filltype vialt @vialtype;#ADDKEY %1filltype number @pbnum;saveall %1filltype;#ADDITEM elist %1filltype;saveall elist;#VAR %1filltype}
#CLASS 0

Argamendon