 |
Articval Novice
Joined: 01 Jun 2005 Posts: 47
|
Posted: Wed Oct 15, 2008 6:39 pm
Better solution to cut a line sent by MUD |
Hi!!
In order to be able to use my triggers on newlines, i need a trigger to cut what the mud sends me when it sends me info after the prompt:
<<prompt>> INFO I DONT WANT HERE.
By the moment, I have next working trigger:
#tr {>>)} {
#if %1="" {} {
#Sub {>>)}
#say {%{1}%{2}}
} }
It works,but the problem is that it does not save the color of the line (wich I would like to use in my brand new Cmud) and I think there is a new trigger function on Cmud which could do that better...
Any ideas?? Thankss!!! |
|
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Wed Oct 15, 2008 8:29 pm |
The same thing I would have used for zMUD:
#TRIGGER {((prompt here)*)} {#PSUB %2 %x1}
At least, it should work. At work right now and can't test it, but give it a go.
Charneus |
|
|
|
 |
Articval Novice
Joined: 01 Jun 2005 Posts: 47
|
Posted: Thu Oct 16, 2008 3:15 pm |
Nup,does not what i was looking for...
(i realize I didnt ask for it on the 1st post hehe)
I have this:
<<prompt>> INFO I DONT WANT HERE.
And I want this:
<<prompt>>
INFO I DONT WANT HERE.
What your trigger got for me was:
<<prompt>>
hehe thanks for the help btw
Edit:
The background question of this is: Is there a trigger which fires off JUST AFTER its pattern is sent by the mud?? (not after finishing the line)??
Thx!! |
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Thu Oct 16, 2008 4:01 pm |
This trigger should do it slightly simpler. The when the newline is inserted by #PSUB it causes triggers to pick up on that line and will work with pattern anchors correctly. It also blocks all other triggers from running when the line still needed fixing by virtue of its priority and the stop option.
| Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger name="PromptFix" priority="1" stop="true" prompt="true" copy="yes">
<pattern>(>>)(*)</pattern>
<value>#IF (%2) {
$Pos=%word(%x2,1)
#PSUB {%cr} $Pos ($Pos-1)
}</value>
</trigger>
</cmud> |
You may have to fix the pattern to '& gt; & gt;' without the spaces in order to import. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
Articval Novice
Joined: 01 Jun 2005 Posts: 47
|
Posted: Thu Oct 16, 2008 4:23 pm |
Its magic :)
thankyou,ill study that to understand how it does what it does, works perfectly =) |
|
|
|
 |
|
|
|