|
ilyarin Beginner
Joined: 29 Aug 2008 Posts: 10
|
Posted: Thu Sep 11, 2008 12:43 pm
Incomplete colouring. |
I have a trigger used for chat channels that changes the colour somewhat. Every now and then, when the trigger fires, it seems to give up colouring it half-way through. It's very sporadic and I can't seem to work out why it's doing it. :( This is an example of it from the debugger, with the appropriate trigger XML.
Code: |
01:36:58.818p |
01:36:58.820p | a Lusterni |(Newbie): Maze says, "But please what should i do with the bucket, i tried putting it in the springnal but i cant (maybe sintax) the fink does not want it an doesnot fit in the gnome catapult... i LOOK everywere in the battlefield... what am i doing wrong?"
01:36:58.820p | f Lusterni |Pattern: ^~(({Newbie|Celest|Market|Paladins|Novices})~)~: : (%1="Newbie")
01:36:58.821p | c Lusterni |exec : Pattern "^~(({Newbie|Celest|Market|Paladins|Novices})~)~:...
01:36:58.821p | n Lusterni |Exec Trigger "^~(({Newbie|Celest|Market|Paladins|Novices})~)~:"
|
Code: |
<trigger priority="220" id="1360">
<pattern>^~(({Newbie|Celest|Market|Paladins|Novices})~)~:</pattern>
<value>#sub %ansi(grey)~(%ansi(15)%1%ansi(grey)~)~:</value>
</trigger>
|
What I end up with is something like this (What I am looking for is the word in brackets to be white, the brackets and colon to be grey, and the rest to be whatever colour it is sent from the MUD as:
(Newbie): Maze says, "But please what should i do with the bucket, i tried putting it in the springnal but i cant (maybe sintax) the fink does not want it an doesnot fit in the gnome catapult... i LOOK everywere in the battlefield... what am i doing wrong?" |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Sep 11, 2008 4:28 pm |
Try this:
Code: |
>#sub {%ansi(grey)~(%ansi(15)%1%ansi(grey)~)~:} |
I'm not sure its the problem, but sometimes you need the braces to tell #sub that the whole thing is the substitution. |
|
|
|
ilyarin Beginner
Joined: 29 Aug 2008 Posts: 10
|
Posted: Thu Sep 11, 2008 6:46 pm |
Mm, no that's not worked I'm afraid. :(
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Sep 11, 2008 6:59 pm |
Not sure what is wrong. It worked for me just fine when I tried it in a blank session. Here is what I did:
1) Run CMUD and close the Session window
2) Open the Settings editor (Ctrl-G)
3) Copy your trigger XML text from the end of your first post. Right-clicked on the tree view on the left and selected Paste. This added your trigger.
4) Back on the command line, I typed:
#SHOW {%ansi(green)(Newbie): Maze says, "But please what should i do with the bucket, i tried putting it in the springnal but i cant (maybe sintax) the fink does not want it an doesnot fit in the gnome catapult... i LOOK everywere in the battlefield... what am i doing wrong?"}
to simulate a line of text from the MUD that was green. CMUD properly colored it so that "Newbie" was in white and the parenthesis were in gray. So it seems to be working fine here. My only guess is that maybe you have some other trigger that is also firing to color the text somehow.
Also, go into your Preferences and in the ANSI page, go to the Foreground colors tab and make sure your color 15 value is properly set to white and not something else. |
|
|
|
ilyarin Beginner
Joined: 29 Aug 2008 Posts: 10
|
Posted: Thu Sep 11, 2008 7:33 pm |
I've just done what you've said and, in the blank session, it is colouring it just fine. However when I go back to my open session and send the same #SHOW, it still returns the same as above. If another trigger was firing, wouldn't that show in the script debugger?
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Thu Sep 11, 2008 9:25 pm |
I have seen this problem happening as well. though usually not unless its a multiword #sub.
It is a very sporadic issue, sometimes the same sub will work fine, other times it wont.
Sometimes checking the 'Repeat within line' option helps. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
ilyarin Beginner
Joined: 29 Aug 2008 Posts: 10
|
Posted: Thu Sep 11, 2008 9:57 pm |
Sadly the 'Repeat within line' option hasn't helped me here. I figured it was a freak occurrence but it's happening every time now! Very odd...
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Sep 11, 2008 10:45 pm |
In the Script Debugger window, turn on the Raw Input/Output message and then post the result here. It's possible the MUD is sending other control codes or something that messes it up (since my #SHOW test was pretty simple with just the %ansi(green) at the beginning).
You normally shouldn't check the "Repeat within line" option unless the text pattern that you are matching with the #SUB trigger occurs in multiple places on the same line.
Shalimar: If you are seeing this happen too, then you should also post your exact trigger along with the raw output sent from the MUD so we can see if it's the same problem. There are not any current bugs with #SUB on my bug list, so I'll need more info if you want this fixed. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Fri Sep 12, 2008 3:19 am |
Mine does sometimes appear twice on the same line.
Here are my settings:
Code: |
<var name="bountyNPC" type="StringList" sorted="true" id="578">a town guard|city guardsman|furrier Dakris|gem dealer|Guild Taskmaster Halline|jeweler Tanzania|Surtey Akrash|Taskmaster Jarivyth|Taskmaster Malcrith|Taskmaster Rheteger</var>
<trigger priority="5790" repeat="true" id="579">
<pattern>({@bountyNPC})</pattern>
<value><![CDATA[$NPC=%word(%1, %numwords(%1))
#SUB {<send 'ask $NPC about bounty'><color purple>%1</color></send>}]]></value>
</trigger>
<trigger priority="1" id="80">
<pattern> "*"</pattern>
<value>#cw aqua</value>
</trigger>
|
This is the cause:
Code: |
The taskmaster told you: "Hmm, I've got a task here from the town of Wehnimer's Landing. The local gem dealer, Murdos Burdos, has an order to fill and wants our help. Head over there and see what you can do. Be sure to ASK about BOUNTIES."
|
Here is the raw:
Code: |
g GemStone =The taskmaster told you: [30m "Hmm[30m, [30mI've got a task here from the town of Wehnimer's Landing. The local [5Sgem[30m dea[5Sler[30m, [30mMurdos Burdos[30m, [30mhas an order to fill and wants our help. Head over there and [0m[30msee [30mwhat [30myou can do. Be sure to ASK about BOUNTIES."[0m
|
And here is a screenshot:
'gem dealer' is supposed to be all purple |
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|