Color trigger

Posted by Nelly on Wed 04 Feb 2004 02:29 PM — 7 posts, 24,601 views.

#0
Hello,
I just have a little wonder here.

Im mudding at aardwolfmud.org
and there is alot of spells you can use etc...
and when the spells wears off, they all dont wear of
at once, so I wonder if there is anyway you can match a
trigger to recast the one dropped with out redoing all the
spells?
There is diffrent colour codes on work spells and not worn spells
so that might make it a little easier...

I know it works in Zmud, but I like Mushclient better so I dont wish
to change...

Love Nelly
Australia Forum Administrator #1
Can you paste here an example or two of a spell wearing off? It might be possible without the colours.
#2
You mean like this?

cast 'giant strenght'
Affected: Your muscles surge with heightened power!
Worn off: You feel weaker.

cast adrenaline
Affected: You have given yourself an adrenaline rush!
Word off: The adrenaline rush wears off.

and btw, I wanna be able to respell them with a command
and not just as soon as they wear off...
since you might be in a fight at the moment the spell
wears off...

so if I type spellup stats on aardwolf
I get all the spells show in a list with spells
highlighted in lightgreen with the spells I already have
and dark green the spells that Im not affected by.
and by that I want a trigger to react on the one in darkgreen...

really complicated but it sucks to respell manually or
cast cancellation upon you and then redo all the spells.
Australia Forum Administrator #3
The first bit is easy. Just make a trigger:

Match: You feel weaker.
Send: cast 'giant strength'


The matching on the spellup stats is a bit trickier - to do a reasonable reply could you post an example of what it looks like if you type that?
#4
Level:1 Armor Mana: 5 Learned: 95%
Bless Mana: 5 Learned: 100%
Detect invis Mana: 15 Learned: 1%
Detect magic Mana: 10 Learned: 1%
Infravision Mana: 15 Learned: 98%
Shield Mana: 5 Learned: 91%
Enhanced strength Mana: 20 Learned: 88%
Mental barrier Mana: 5 Learned: 96%
Blur Mana: 15 Learned: 89%
***********************************************************
This is how it looks when I type spells spellup.

and lets say im affected with "armor and bless"
then those spells are light green and the rest dark green..

and it looks like this
c armor
You cast a protective armor around yourself.
wear off:Your magical armor wears away.

c bless
You grant yourself the favor of Themis.
wear off:You feel less righteous as the blessing upon you fades.

and nodnod the first part is easy..
its the hard part I need help with :p
Australia Forum Administrator #5
It looks like you can do it from the text. I assume that a percentage (say over 80%) means you can use the spell.

Make a trigger like this:

* Mana: * Learned: *%

That would detect all spell names, mana needed and learnt percent. That could be remembered in variables (eg. spell_mana) and you could save the percentage learnt.

However the wearoff messages all seem different so you probably need to manually make the triggers for them.
#6
While matching on the spell fail lines is more straigh-forward, it means quite a few trigger lines, one for each spell. Other than the pain of having to find out what every single spell failure line is, there is also a chance to miss a spell if the failure line pops up in the middle of other MUD output as sometimes happens.

What Nelly was trying to do is use the "spells spellup" command which displays which spells are still active and recast only the spells which are note.

Take for example these spells:

Level:   5 Armor                  Mana: 5   Learned: 100% (  4)
Level:   6 Bless                  Mana: 5   Learned: 100% (  5)

"Level:" is dark green
"5" and "6" are dark white
"Armor" is bright green indicating it is active
"Bless" is dark green indicating that it is not
The rest of the line alternates dark white and dark green.

Now, that being said, is there any way to programatically detect the color the of just the spell name, which happens to be in the middle of other text?

As an added bit of complexity, we would probably need to track a list of spells that we did *not* want to recast. I think that is relatively simple though, at least in my head.