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


Joined: 11 Feb 2013
Posts: 2

PostPosted: Mon Feb 11, 2013 4:01 pm   

Trigger pattern
 
Hey.

Im trying to fetch a number of digits from this line in the MUD

[Bank]: You deposit [2038] gold into your account after taxing.

I want to get the deposited gold 2038 and store in into a variable. The problem i got is that i can't
make the trigger understand that the digits is inside of [], ive tryed for example %x&GOLD%x but
this only gets the 8 from all the four digits. And i realised that %x just wont work.

Appriate any help!
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Feb 11, 2013 4:35 pm   
 
All you need to do is precede the brackets with ~. That will force the parser to treat it as a literal bracket. The following pattern will work:
Code:
~[Bank~]: You deposit ~[(%d)~] gold into your account after taxing.
Reply with quote
corgae
Newbie


Joined: 11 Feb 2013
Posts: 2

PostPosted: Mon Feb 11, 2013 4:38 pm   
 
Thank you very much for the help Rahab, worked like a charm. :)
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