|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Thu May 15, 2008 11:30 pm
simple trigger help.... |
Well... I thought it was right, but alas... I'm doing something wrong. =[
From the mud:
You get a pile of 395,948,003 gold.
What I have:
#trig {^You get a pile of %n$goldcurr gold.} {#add money $goldcurr;#say I got $goldcurr}
Not adding anything to @money and not performing the #say. =**[ |
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Thu May 15, 2008 11:53 pm |
This may be overkill and I am sure there is a better way, but...
Code: |
#REGEX {^You get a pile of (\d{0,3},?\d{0,3},?\d+) gold\.$} {#ADD money %1;#SAY I got %1}
|
will do the trick. The only problem I have with it is that it will accept 003 which isn't wrong but it also isn't pretty. So this needs a wee bit of work, but it is a start. |
|
_________________ Sic itur ad astra. |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Fri May 16, 2008 12:03 am |
well... lol, the problem with that, is that i don't necessarily always get over a 100k gold, sometimes its as little as 1 gold. thats why i was trying to use the %n i read someplace that it automatically removed the commas.... hrmmm....
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 16, 2008 12:23 am |
Very complex way of doing it, Anaristos. %n will match comma-delimited numbers and strip the commas, so it's the best way to do the match. The trouble, shaun, is that you're using the localvar syntax completely wrong. To set the value of the variable, you use ($localvar:whatever you want to capture), so you want ^You get a pile of ($goldcurr:%n) gold.
|
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Fri May 16, 2008 12:27 am |
gar! fang, your the man! hey... can i borrow your brain for a day or so? just so i can get my ideas down into my client, and clean things up? lol! thanks again bro! =D
|
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Fri May 16, 2008 4:46 am |
Wow what game is that where you find that much in a pile of gold? Your character must be rich.
|
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: Fri May 16, 2008 4:12 pm |
Heh... Just an example... =D
|
|
|
|
|
|