skip navigation

Welcome, Guest [log in · register]
Cwn Annwn
Search
Page 1 of 1 1
Tejon
Avatar
The change to ‘effects’ output last month broke the parser that I posted long ago, and I’ve had several requests for a fix. I’m posting an updated version.

For people installing it for the first time, update the variables "good_effects", "bad_effects", and "wanted_effects". The code will parse the output, colouring the good versus bad effects, based on how much time before they expire. It will also report any wanted effects that are missing.

Tejon


#CLASS {effects}
#VAR good_effects {levitation|shield|sanctuary|bless|haste|invisibility|armor|augment aura|stone skin|fireshield|enhanced strength|detect invisibility|augment aura|stone skin}
#VAR bad_effects {poison|plague|faerie fire|curse|web|paralyze|silence|slow|weaken|fatigue}
#VAR wanted_spells {levitation|shield|sanctuary|bless|haste|invisibility|armor|augment aura|stone skin|detect invisibility|enhanced strength}
#VAR base_colour {cyan}
#VAR first_spell {0} {0}
#VAR type_colour {green}
#VAR found_spell {0} {0}
#VAR good_base_colour {cyan} {cyan}
#VAR good_type_colour {green} {green}
#VAR good_time_colour {green} {green}
#VAR good_short_type_colour {green} {green}
#VAR good_short_time_colour {yellow} {yellow}
#VAR good_short_base_colour {yellow} {yellow}
#VAR bad_base_colour {red} {red}
#VAR bad_type_colour {red} {red}
#VAR bad_time_colour {red} {red}
#VAR bad_short_type_colour {yellow} {yellow}
#VAR bad_short_base_colour {magenta} {magenta}
#VAR bad_short_time_colour {red} {red}
#VAR neutral_time_colour {white} {white}
#VAR neutral_type_colour {white} {white}
#VAR neutral_base_colour {cyan} {cyan}
#VAR time_colour {green}
#VAR misstring {" "}
#VAR espells {}
#REGEX {^Spell: (.+?) +- Level +([0-9]+) *, modifies +(.+) by +([0-9]+)(?: +for +([0-9]+) +minute.*)*.} {
#gag
#var timeleft %int( %5)
#class effects
#var base_colour @neutral_base_colour
#var type_colour @neutral_type_colour
#var time_colour @neutral_time_colour
#if (%ismember( %1, @good_effects)) {
#if ((@timeleft < 11) and (@timeleft > 0)) {
#var base_colour @good_short_base_colour
#var type_colour @good_short_type_colour
#var time_colour @good_short_time_colour
} {
#var base_colour @good_base_colour
#var type_colour @good_type_colour
#var time_colour @good_time_colour
}
} {
#if ( %ismember( %1, @bad_effects)) {
#if ((@timeleft < 11) and (@timeleft > 0)) {
#var base_colour @bad_short_base_colour
#var type_colour @bad_short_type_colour
#var time_colour @bad_short_time_colour
} {
#var base_colour @bad_base_colour
#var type_colour @bad_type_colour
#var time_colour @bad_time_colour
}
}
}
#say %ansi( high, magenta, black) %ansi( high, @type_colour)%format( "&-21s", %1)%ansi( high, @base_colour)"- Level " %format( "&3.0n", %2)", >> " %ansi( high, @base_colour)%format( "&-19s", %3)%ansi( high, @base_colour)" by "%ansi( high, @base_colour)%format( "&3.0n", %4)%ansi( high, @time_colour)" for "%format( "&3.0n", @timeleft)%ansi( high, @base_colour)" min"
#var espells %additem( %1, @espells)
#var first_spell 0
}
#TRIGGER {Total of (*) magical*affects.} {
#class effects
#if (@first_spell = 0) {
#var first_spell 1
#var found_spell 0
#forall @wanted_spells {
#if ( not %ismember( %i, @espells)) {
#if (( %len( %i) > 0) and (@found_spell == 0)) {
#var found_spell 2
#var misstring %cr%ansi( high, red)"Missing:"
}
#var misstring %concat( @misstring, " "%ansi( high, red)%i)
}
}
}
#if ( @found_spell == 2) {
#say @misstring
#var found_spell 1
}
#var misstring ""
#var espells ""
#class 0
}
#CLASS 0
Siege
Avatar
Vass > this script.

Total of 11 magical and 1 non-magical affects.
Tejon
Avatar
Are you saying that the script doesn’t pick up that case, Siege?
#TRIGGER {Total of (*) magical*affects.}
That should capture it, no problem. Admittedly I’m tempted to make it *ffects, to address the off-chance the game ever gets around to resolving the effects/affects dichotomy.
Saitok
Avatar
This doesn’t seem to work when I try to use it. :/
Ghostalker
Avatar
It’s been working fine for me…

You are affected by the following:
* You are resistant to: bash fire.
* You are vulnerable to: cold.
detect invisibility - Level 90, » none by 0 for 0 min
armor - Level 30, » ar by 3 for 0 min
sanctuary - Level 120, » none by 0 for 0 min
bless - Level 121, » saving-spell by 3 for 0 min
pass door - Level 113, » none by 0 for 0 min
haste - Level 120, » accuracy by 4 for 0 min
fireshield - Level 75, » none by 0 for 0 min
enhanced strength - Level 111, » strength by 2 for 0 min
stone skin - Level 151, » ar by 5 for 0 min
shield - Level 239, » ar by 7 for 89 min
levitation - Level 240, » none by 0 for 100 min
Total of 11 magical affects.

[SAFE]<1979hp 1702sp 570st>
Missing: invisibility augment aura
Ghostalker
Avatar
Hmmm… Threw sneaking and hide on, and it doesn’t do anything to them, but it doesn’t harm the script any either in mine.


You are affected by the following:
* You are resistant to: bash fire.
* You are vulnerable to: cold.
detect invisibility - Level 90, » none by 0 for 0 min
armor - Level 30, » ar by 3 for 0 min
sanctuary - Level 120, » none by 0 for 0 min
bless - Level 121, » saving-spell by 3 for 0 min
pass door - Level 113, » none by 0 for 0 min
haste - Level 120, » accuracy by 4 for 0 min
fireshield - Level 75, » none by 0 for 0 min
enhanced strength - Level 111, » strength by 2 for 0 min
stone skin - Level 151, » ar by 5 for 0 min
shield - Level 235, » ar by 7 for 85 min
levitation - Level 236, » none by 0 for 96 min
Prof: sneaking - Level 240, modifies none by 0 for 64 minutes.
Prof: hide - Level 240, modifies none by 0 for 64 minutes.
Total of 11 magical and 2 non-magical affects.

[SAFE]<1979hp 1712sp 1138st>
Missing: invisibility augment aura

Saitok
Avatar
I dunno what I’m doing wrong, but I can’t seem to make it work. D:<
Siege
Avatar
Wishful thinking Tejon.

That is how I updated mine. I replaced the trigger that Tejon updated with the one in the script in the first post.

Want me to repost it to make it easier on you guys? :P
Nemix oops

Last edited on May 5, 2008 07:20am.
Page 1 of 1 1