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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Articval
Novice


Joined: 01 Jun 2005
Posts: 47

PostPosted: 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!!!
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: 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
Reply with quote
Articval
Novice


Joined: 01 Jun 2005
Posts: 47

PostPosted: 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!!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: 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
Reply with quote
Articval
Novice


Joined: 01 Jun 2005
Posts: 47

PostPosted: Thu Oct 16, 2008 4:23 pm   
 
Its magic :)

thankyou,ill study that to understand how it does what it does, works perfectly =)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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