Need a list of spells you always desire to have on:
#VAR V_Spell_Desired "armor|holy aura|fury|heroism|bless|hot protection|detect invisibility"
Track what you need:
#VAR V_Spell_ToCast ""
Track what you have:
#VAR V_Spell_Current ""
Figure out what is missing and what you have:
#TRIGGER {You are affected by the following spells~/skills~:} {#T+ SpellList;#VAR V_Spell_ToCast @V_Spell_Desired}
#CLASS SpellList
#TRIGGER {SPL~: ~(%s(%d)hr~) ({@V_Spell_Desired})} {#DELITEM V_Spell_ToCast {%2};#ADDITEM V_Spell_Current {%2};#NOOP If you know how game hours relate to real time you can set up a timer to let you know when spell %2 will end in %1 hours.}
#TRIGGER {SKL~: ~(%s(%d)hr~) ({@V_Spell_Desired})} {#DELITEM V_Spell_ToCast {%2};#ADDITEM V_Spell_Current {%2};#NOOP If you know how game hours relate to real time you can set up a timer to let you know when spell %2 will end in %1 hours.}
#TRIGGER {^$} {#T- SpellList}
#CLASS 0
#ALIAS SpellUp {#FORALL @V_Spell_ToCast {cast ~'%i~'}}}
What I don't know is what the difference in casting SPL/SKL are. I made 2 triggers in case one needs a feat or item to get the affect from.
That will provide you with a list of current affects and things you may want to cast.
This assumes the list is followed by a blank line.
Then you can use the alias SpellUp which simply spams a cast of all missing affects. Modify the cast method to reflect what you need to do to get the affect etc.
Useful is that when ever you get that affects list, you get a string list of V_Spell_Current which you can %ismember check with. Ie you meet something that breaths fire and you can check to see if "hot protection" is in your V_Spell_Current list or not and cast accordingly.
Ton Diening
You are affected by the following spells/skills:
-------------------------------------------------
SPL: ( 25hr) armor -10 to ARMOR
SPL: ( 3hr) holy aura
SKL: ( 8hr) fury +4 to DAMROLL
SKL: ( 8hr) fury +2 to HITROLL
SKL: ( 5hr) heroism +10 to ARMOR
SKL: ( 5hr) heroism +4 to DAMROLL
SKL: ( 5hr) heroism +4 to HITROLL
SPL: ( 7hr) bless -1 to SAVING_SPELL
SPL: ( 7hr) bless +2 to HITROLL
SPL: ( 0hr) hot protection
SPL: ( 47hr) detect invisibility