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
nilse75
Newbie


Joined: 23 Nov 2010
Posts: 5

PostPosted: Tue Nov 23, 2010 5:49 pm   

Problem with prompt
 
I play on a MUD where I sometimes get a prompt like this

Code:
You get a longsword.
> You wield longsword in right hand.
Hp: 215/235
> look
You are standing in a small room ...


Sometimes, when you send a lot of commands to the MUD you can get a line like this

Code:
> > > You wield longsword ...


To prevent abuse, all my triggers use the ^ to start a line. The problem is that I want to remove
any combination of > characters so I don't need to do like this on all triggers.

Code:
#TRIGGER {^{|> |> > |> > > }...} {...}


How can I write a trigger that will remove all the > from the start of my lines so I can write
normal triggers using ^? I hope you understand what I mean.

Thanks!
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Tue Nov 23, 2010 6:17 pm   
 
Try this.

Code:
<trigger priority="10" regex="true" id="1">
  <pattern>^(>\s)*(.*)</pattern>
  <value>#sub %2</value>
</trigger>
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
nilse75
Newbie


Joined: 23 Nov 2010
Posts: 5

PostPosted: Tue Nov 23, 2010 6:30 pm   
 
Thanks! Works perfect
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Tue Nov 23, 2010 6:31 pm   
 
I forgot to mention that you will want to set the priority of that trigger lower than any trigger, you want to fire off of anything that get's #sub'ed.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
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