Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Bruner
Beginner


Joined: 17 Dec 2002
Posts: 18
Location: USA

PostPosted: Thu Jan 15, 2004 9:23 pm   

Ansi Color Tracking Script
 
Alright, bare with me.. this is going to be difficult to explain.

What I want, is for the output to look like the bit below.

There are some tracks of a ridden mount leaving >>EAST>> {blue}
There are some tracks of a trolloc leaving >>EAST>> {red}
There are some tracks of a human leaving ^^NORTH^^ {navy}
There are some tracks of a humanoid leaving vvSOUTHvv {green}
There are some tracks of an animal leaving <<WEST<< {green}
There are some tracks of a seanchan leaving <<WEST<< {purple}

Problem is, It ends up with everything but trolloc tracks coloring green, and the trolloc tracks coloring red. Like the Below Bit.

There are some tracks of a ridden mount leaving >>EAST>> {green}
There are some tracks of a trolloc leaving >>EAST>> {red}
There are some tracks of a human leaving ^^NORTH^^ {green}
There are some tracks of a humanoid leaving vvSOUTHvv {green}
There are some tracks of an animal leaving <<WEST<< {green}
There are some tracks of a seanchan leaving <<WEST<< {green}

My correct script is this:

#ALIAS GetDir {#IF {%1="north"} {#VAR dirchar @northchar};#IF {%1="east"} {#VAR dirchar @eastchar};#IF {%1="south"} {#VAR dirchar @southchar};#IF {%1="west"} {#VAR dirchar @westchar};#IF {%1="up"} {#VAR dirchar @upchar};#IF {%1="down"} {#VAR dirchar @downchar}} "Scripts|Track|Tracking Colors"

#VAR dirchar {<<} {_nodef} "Scripts|Track|Tracking Colors"
#VAR downchar {--} {_nodef} "Scripts|Track|Tracking Colors"
#VAR eastchar {>>} {_nodef} "Scripts|Track|Tracking Colors"
#VAR northchar {^^} {_nodef} "Scripts|Track|Tracking Colors"
#VAR southchar {vv} {_nodef} "Scripts|Track|Tracking Colors"
#VAR upchar {++} {_nodef} "Scripts|Track|Tracking Colors"
#VAR westchar {<<} {_nodef} "Scripts|Track|Tracking Colors"

#TRIGGER {({bloody traces|tracks}) of a ({trolloc|seanchan|human}) leaving (%w).} {#CO red;GetDir %3;#SUB {%1 of %ansi( red, bold)a %2 %ansi( red)leaving %ansi( yellow)@dirchar%ansi( red, bold)%upper(%3)%ansi( yellow)@dirchar}} "Scripts|Track|Tracking Colors"

#TRIGGER {({tracks|bloody traces}) of ~*(%w)~* leaving (%w).} {#CO red;GetDir %3;#SUB {%1 of *%ansi( red, bright)%2* %ansi( red)leaving %ansi( yellow)@dirchar%ansi( red, bold)%upper(%3)%ansi( yellow)@dirchar}} "Scripts|Track|Tracking Colors"

#TRIGGER {{bloody traces} of (*) leaving (%w).} {#CO red;GetDir %2;#SUB {bloody traces of %ansi( red, bold)%1 %ansi( red)leaving %ansi( yellow)@dirchar%ansi( red, bold)%upper(%2)%ansi( yellow)@dirchar}} "Scripts|Track|Tracking Colors"

#TRIGGER {{tracks} of (*) leaving (%w).} {#CO green;GetDir %2;#SUB {tracks of %ansi( green, bold)%1 %ansi( green)leaving %ansi( yellow)@dirchar%ansi( green, bold)%upper(%2)%ansi( yellow)@dirchar}} "Scripts|Track|Tracking Colors"


When I rewrote it, and I thought it would work, but i can't seem to get work is this:

#ALIAS GetDir {#IF {%1="north"} {#VAR dirchar @northchar};#IF {%1="east"} {#VAR dirchar @eastchar};#IF {%1="south"} {#VAR dirchar @southchar};#IF {%1="west"} {#VAR dirchar @westchar};#IF {%1="up"} {#VAR dirchar @upchar};#IF {%1="down"} {#VAR dirchar @downchar}}

#VAR dirchar {>>} {_nodef}
#VAR downchar {--} {_nodef}
#VAR eastchar {>>} {_nodef}
#VAR northchar {^^} {_nodef}
#VAR southchar {vv} {_nodef}
#VAR upchar {++} {_nodef}
#VAR westchar {<<} {_nodef}

#TRIGGER {({bloody traces|tracks}) of a ({human}) leaving (%w).} {#CO navy;GetDir %3;#SUB {%1 of %ansi( navy, bold)a %2 %ansi( navy)leaving %ansi( yellow)@dirchar%ansi( navy, bold)%upper(%3)%ansi( yellow)@dirchar}}

#TRIGGER {({bloody traces|tracks}) of a ({seanchan}) leaving (%w).} {#CO purple;GetDir %3;#SUB {%1 of %ansi( purple, bold)a %2 %ansi( purple)leaving %ansi( yellow)@dirchar%ansi( purple, bold)%upper(%3)%ansi( yellow)@dirchar}}

#TRIGGER {({bloody traces|tracks}) of a ({trolloc}) leaving (%w).} {#CO red;GetDir %3;#SUB {%1 of %ansi( red, bold)a %2 %ansi( red)leaving %ansi( yellow)@dirchar%ansi( red, bold)%upper(%3)%ansi( yellow)@dirchar}}

#TRIGGER {({tracks|bloody traces}) of ~*(%w)~* leaving (%w).} {#CO red;GetDir %3;#SUB {%1 of *%ansi( red, bright)%2* %ansi( red)leaving %ansi( yellow)@dirchar%ansi( red, bold)%upper(%3)%ansi( yellow)@dirchar}}

#TRIGGER {{bloody traces} of (*) leaving (%w).} {#CO red;GetDir %2;#SUB {bloody traces of %ansi( red, bold)%1 %ansi( red)leaving %ansi( yellow)@dirchar%ansi( red, bold)%upper(%2)%ansi( yellow)@dirchar}}

#TRIGGER {{tracks} of (*) leaving (%w).} {#CO green;GetDir %2;#SUB {tracks of %ansi( green, bold)%1 %ansi( green)leaving %ansi( yellow)@dirchar%ansi( green, bold)%upper(%2)%ansi( yellow)@dirchar}}

I can't get the "a human" trigger to execute. I don't know really what i'm asking.. I think i just want someone to show my way it won't trigger. I think why it won't catch the trigger is because it's putting in the "<<West<<" sub before it get's to the "a human" trigger. So is there a order in which is triggers? If so, how do I chance it? And if that is the case, how come the "a trolloc" triggers, but not the other two. Any help would be appriciated.

Bruner
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Jan 15, 2004 10:10 pm   
 
Another scan Wink and it is the last triggers:
#TRIGGER {({tracks|bloody traces}) of ~*(%w)~* leaving (%w).} {#CO red;...

#TRIGGER {{bloody traces} of (*) leaving (%w).} {#CO red'...

causing the red only.

You want to put them 'before' the others:

Triggers fire from first to last.
In the settings editor do a View->Sort By->None
Then look at your triggers to see what order they are in. You can drag and drop them to change their order.
Reply with quote
Bruner
Beginner


Joined: 17 Dec 2002
Posts: 18
Location: USA

PostPosted: Thu Jan 15, 2004 10:22 pm   
 
Yeah.. I always clear out my Previous scripts before implimenting new ones... So I am pretty sure it isn't that...

I played with it a little, and I disabled all of the tracking triggers but the "a human" one, and it changed everything to "%ansi {navy}" everything was navy colored.. i had to close the program and reopen it to get colors back. I /think/ that it's because it left it opened, like it triggered once, then never stopped triggering. Right now, I haven't a clue.. Anything else would be sweet. Even if you had to rewrite the script.

Thanks,

Bruner

Btw, this is the original mud tracking output:

There are some tracks of a trolloc leaving east.
There are some tracks of a trolloc leaving up.
There are some tracks of a humanoid leaving north.
There are some tracks of an animal leaving south.
There are some tracks of a human leaving west.
There are some tracks of a seanchan leaving down.
Reply with quote
Bruner
Beginner


Joined: 17 Dec 2002
Posts: 18
Location: USA

PostPosted: Thu Jan 15, 2004 10:26 pm   
 
Well, I was kind of supid, and didn't check if your solution was correct. And I haven't tested it yet, but It was sorting by names.. and infact, the "a human" trigger was last.. so, Maybe that was it. I'll post again in a bit when I can test it.

Bruner
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net