|
zex0s Wanderer
Joined: 29 Jun 2003 Posts: 64
|
Posted: Thu Aug 07, 2003 3:03 am
Spell Reagent tracker? |
Ok.. I am attempting to add some info to my statusbar to track the amount of spell reagents I have...
I can currently check to see when I pick them up, drop them, etc.. However, getting them to be removed when a spell uses them is slightly..... difficult.. here is a couple of example outputs from the mud.
A pinch of sulfur, a mandrake leaf, and a shimmering white fish scale flare brightly and vanish!
A mandrake leaf, and a mandrake leaf flare brightly and vanish!
There are an unknown number of different reagents, however they all boil down to 7 groups: Earth, Fire, Water, Air, Gem, Ethereal, Astral (obviously, I have no intention of attempting to track them all. I intend to set 7 variables called @Earth, @Water, etc.. and populate them with strings of each of the most common reagents of each type etc.. this is all laid out.. And:
#TR {* flare brightly and vanish!$} {}
Thats the trigger that I intend to use... and I know I can use the %isin() function, but how would I go about making sure I count ALL of them?
In the second example, the spell used 2 reagents, both were earth, using my isin, I would subtract 1.. making my count of left over reagents slightly off.. |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: Thu Aug 07, 2003 5:39 am |
#TR {(*) flare brightly and vanish!$} {#var countreagent %replace("%1",",","|");#var countreagent %numitems(@countreagent)}
Then just subtract @countreagent form your total. |
|
|
|
zex0s Wanderer
Joined: 29 Jun 2003 Posts: 64
|
Posted: Thu Aug 07, 2003 6:07 am |
That only tells me the overall total reagents used.. NOT the total of each KIND.. which is what I need..
let me explain.
my status bar: REAGENTS Earth: 22 Fire: 20 Water: 29 etc..
after A pinch of sulfur, a mandrake leaf, and a shimmering white fish scale flare brightly and vanish!
it should say REAGENTS Earth: 21 Fire:19 Water: 28
sulfur=fire reagent, scale=water reagent, etc..
Each different spell calls for different reagents, and running out of them during combat can be deadly. So I need to know how many of EACH reagent I have at all times.. checking your inventory before and during combat can also be deadly. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Aug 07, 2003 2:14 pm |
This is essentially the same as Trigger help for version 6.62 public
#TR {(*) flare brightly and vanish!} {#VAR reagents %lower( {%1});#VAR reagents %replace( {@reagents}, " and ", " ");#VAR reagents %replace( {@reagents}, ", ", "|");#VAR reagents %countlist( @reagents);UsedReagents}
#AL UsedReagents {#LOOPDB @reagents {#IF %ismember( %key, @Earth) {#ADD Earthcount -%val};#IF %ismember( %key, @Water) {#ADD Watercount -%val};#IF %ismember( %key, @Fire) {#ADD Firecount -%val};#IF %ismember( %key, @Air) {#ADD Aircount -%val};#IF %ismember( %key, @Gem) {#ADD Gemcount -%val};#IF %ismember( %key, @Ethereal) {#ADD Etherealcount -%val};#IF %ismember( %key, @Astral) {#ADD Astralcount -%val}}} |
|
|
|
zex0s Wanderer
Joined: 29 Jun 2003 Posts: 64
|
Posted: Thu Aug 07, 2003 7:10 pm |
Actually, Lightbulb, that didnt quite work, and this is why..
#TR {(*) flare brightly and vanish!} {
#VAR reagents %lower( {%1})
#VAR reagents %replace( {@reagents}, " and ", " ")
#VAR reagents %replace( {@reagents}, ", ", "|")
#VAR reagents %countlist( @reagents);UsedReagents
} (expanded to better show it)
the first #VAR line does NOT properly add ALL the lines in the %1, only up to the first comma.. However, replacing the {%1} with "%1" made the trigger work perfectly. :) Many thanks |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|