|
corgae Newbie
Joined: 11 Feb 2013 Posts: 2
|
Posted: 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! |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: 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. |
|
|
|
|
corgae Newbie
Joined: 11 Feb 2013 Posts: 2
|
Posted: Mon Feb 11, 2013 4:38 pm |
Thank you very much for the help Rahab, worked like a charm. :)
|
|
|
|
|
|