|
nomad980 Beginner
Joined: 01 Sep 2002 Posts: 15 Location: Miami
|
Posted: Sun Aug 15, 2004 8:23 pm
coloring with this trigger |
Hello, well I am working on this script so that it colors the mastery of my spells and skills, but only when i type (know, knowledge, know skill, know spells, etc) here is what I have so far
Code: |
#ONINPUT "knowledge1" {^know$} {
knowledge
#TEMP {$} {#STATE knowledge1 0}
}
#COND {(&14) (&09) (&14) (&09) (&14) (*)} {
#LOOP 9 {
#IF %trim( %2)=%arrget( skillmtext, %i) {#CW %arrget( skillmcolor, %i)}
#IF %trim( %4)=%arrget( skillmtext, %i) {#CW %arrget( skillmcolor, %i)}
#IF %trim( %6)=%arrget( skillmtext, %i) {#CW %arrget( skillmcolor, %i)}
}
} {looplines|param=99}
|
the two variables are these:
Code: |
#VAR skillmcolor {<Array>|null|yellow|blue|bold,green|cyan|red|brown|magenta|bold,red|white}
#VAR skillmtext {<Array>|null|slight|skilled|master|fair|expert|basic|average|advanced|sliver} |
and here is an example of the output from the mud if that can help you guys drill this into my head
Code: |
Skills
Name Mastery Name Mastery Name Mastery
Sewing skilled Alchemy sliver Brew sliver
Dodge slight Smoking sliver Draco biology sliver
Hand to hand advanced Scribe sliver Haggle sliver
Link skilled Lore basic Peek fair
Pottery sliver Spellcraft master Scrolls sliver
Staves sliver Teaching skilled Wands sliver
Spells/Songs
Name Mastery Name Mastery Name Mastery
Reveal shadows master Acid blast master Mana charge sliver
Anchor gate sliver Animate golem sliver Magic armor master
Bind golem sliver Blink sliver Blindness sliver
Blur master Burning hands sliver Call lightning sliver
Calm sliver Cancellation master Chain lightnin sliver
Charm person master Chill touch master Cloud kill sliver
Colour spray sliver Common cold sliver Cone of cold sliver
Animate shadow average Cloak of shado master Confusion sliver
Continual ligh slight Control weathe sliver Create food fair
Create ioun sliver Create rabbit sliver Create rose sliver
Create spring fair Cryogenesis sliver Dark sight master
Deafen average Detect evil master Detect good master
Detect invis master Detect magic master Detect poison sliver
Detect undead master Trueform master Shadow form master
Dispel magic master Shadow travel master Enduring light sliver
Empower staff sliver Revealing bolt sliver Hallucination master
Encase fibers sliver Ward of decept average Impersonate master
Enchant accura sliver Mislead master Mirror image average
Invincibility master Stature master Mask alignment master
Living mirage expert Forest mask master Enchant armor sliver
Starve spring fair Life to mana master Ghoulish touch sliver
Enchant damage sliver Endurance master Faerie fog slight
Faerie fire master Energy drain sliver Farsight sliver
Seal gate average Levitate sliver Random return master
Knock master Fear sliver Fireball master
Mass fly master Teleport sliver Pass door master
Gate master Fly master Suppress magic basic
Mass armor master Resist paralys sliver Globe of force master
Stone skin sliver Magic shield fair Fireproof sliver
Floating disc average Giant strength master Soften defense sliver
Guardian sliver Minor malison sliver Weaken sliver
Slow sliver Poison sliver Haste average
Pose weakness sliver Pose strength sliver Pose old sliver
Pose youth sliver Phase master Ventriloquate sliver
Mass invis sliver Invisibility master Mass haste sliver
Permanency master Talons master Water breathin sliver
Ice sphere sliver Refresh master Infravision sliver
Identify sliver Invisible stal sliver Know alignment sliver
Lightning bolt sliver Locate object sliver Locate person sliver
Magic missile sliver Needle strike sliver Nightmares sliver
Prismatic wall sliver Replenishment sliver Recharge sliver
Ring of shield sliver Shocking grasp sliver Sleep sliver
Sonic boom sliver Web sliver Witch light average
Groups
Beguiling Combat Conjuration Detection
Enchantment Enhancement Illusion Maladictions
Protective Transportation Weather Masking
Masquerade Reality warps Necrolyte Shadow mastery
Languages
Common Gnomish
|
This has been bothering me for almost a week and having been able to get it to work properly the colors go insane and not all of them are colored. Thanks in advanced for the help. |
|
|
|
geniusclown Magician
Joined: 23 Apr 2003 Posts: 358 Location: USA
|
Posted: Sun Aug 15, 2004 9:39 pm |
First off, a couple apparent errors. Your #TEMP statement will (should) fire at the end of the next line, resetting your trigger to state 0 at the onset. Why is the first element of your variables "<Array>"?
My suggestion:
Quote: |
#VAR skillmcolor {null|yellow|blue|bold,green|cyan|red|brown|magenta|bold,red|white}
#VAR skillmtext {null|slight|skilled|master|fair|expert|basic|average|advanced|sliver}
#ONINPUT "knowledge1" {^know$} {~knowledge; #T+ highlightskills}
#COND {^ Groups $} {#T- highlightskills}
#TR "highlightskills" {({@skillmtext})} {#CW %item(@skillmcolor,%ismember(%1,@skillmtext))} "" {disable}
|
This does away with the #LOOP 9 by checking for any instance of any member of the skillmtext list, then the combination of %item and %ismember will call the correct element from the skillmcolor list. |
|
_________________ .geniusclown |
|
|
|
nomad980 Beginner
Joined: 01 Sep 2002 Posts: 15 Location: Miami
|
Posted: Sun Aug 15, 2004 10:09 pm |
Sadly it didnt work. And the reason i am using something like that is because of the reply LightBlub gave here, this managed to inspire me to rewrite the script instead of the way i had it which wasnt helping because it would fail most of the time and stay active the whole time so every word on the list would change color, anyway here is the post i am refering to http://forums.zuggsoft.com/phpbb/viewtopic.php?t=17164
|
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Sun Aug 15, 2004 11:03 pm |
Here is what I would do:
#ALIAS know {#T+ knowledge1;#TEMP {^Common *$} {#T- knowldege1};~know}
#VAR skillmcolor {yellow|blue|bold,green|cyan|red|brown|magenta|bold,red|white}
#VAR skillmtext {slight|skilled|master|fair|expert|basic|average|advanced|sliver}
#TRIGGER "knowledge1" {^*%s({@skillmtext})%s*%s({@skillmtext})%s*%s({@skillmtext})$} {#CW %1 {%item( @skillmcolor, %ismember( %1, @skillmtext))};#CW %2 {%item( @skillmcolor, %ismember( %2, @skillmtext))};#CW %3 {%item( @skillmcolor, %ismember( %3 @skillmtext))}}
You might have to create two more triggers for when there aren't three columns on the last line.
Edited based on replies. |
|
|
|
nomad980 Beginner
Joined: 01 Sep 2002 Posts: 15 Location: Miami
|
Posted: Sun Aug 15, 2004 11:49 pm |
as nice as all the code you all have given me neither seems to work, it just doesnt do the coloring, the one i had at least colored the words before but it just used to go insane and pick which ones it would color and send the rest to hell, the ones that have been posted so far just do nothing, Ive tested both of them out, and from what i see what i might have to end up doing is going back to having to get that entire list, cause the problem for me is that if you type knowledge by itself it gives you every spell and skill, and I want to be able to type knowledge skill, and it just gives me the skills, or knowledge spells and it gives me the spells so the ending with groups, or ending with common just doesnt help. plain and simple they just dont work. thanks anyway i am just going to continue trying till i blow a whole in someones head, or wait till someone can show me something else other then what you two have given me, that doesnt include making a class and having a bunch of trigers that change the color, be enabled when i type know, and disabled when it sees the word group... thanks anyway guys.
|
|
|
|
SCORNME Novice
Joined: 25 Jul 2004 Posts: 48 Location: aka Falan
|
Posted: Mon Aug 16, 2004 4:18 am |
Will simply creating some color triggers and putting them in a separate class work? It may be crude, but if it works
#AL kn {know %1;#T+ KnowColors;#ALA +1 {#T- KnowColors}}
#CLA KnowColors disable
#TR {%sslight} {#CW yellow}
#TR {%sskilled} {#CW blue}
#TR {%smaster} {#CW %eval(%color(bold)+%color(green))}
#TR {%sfair} {#CW cyan}
#TR {%sexpert} {#CW red}
#TR {%sbasic} {#CW brown}
#TR {%saverage} {#CW magenta}
#TR {%sadvanced} {#CW %eval(%color(bold)+%color(red))}
#TR {%ssliver} {#CW white}
#CLA 0
I went with an Alias so as not to conflict with your MUD's "know" command. I used %s to avoid coloring any skills that may contain similar words. I didn't see a standard "finish" line, hence the ALARM. Would something like that work? |
|
|
|
|
|
|
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
|
|