|
Fewyn Wanderer
Joined: 27 Sep 2002 Posts: 83
|
Posted: Fri May 27, 2005 3:44 pm
Need help with a tiny script |
I need help on my mud the numbers have commas in them like below.
Your pl increases by 1,008 points.
I need to get rid of the comma or make it so zMUD does numbers right with commas.
Any ideas or any help? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Fri May 27, 2005 4:05 pm |
#TR {Your pl increases by ([%d%p]) points. } {#show %replace(%1,",")}
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Fewyn Wanderer
Joined: 27 Sep 2002 Posts: 83
|
Posted: Fri May 27, 2005 4:11 pm |
shalimar wrote: |
#TR {Your pl increases by ([%d%p]) points. } {#show %replace(%1,",")} |
That doesn't work as I expected it... It just throws it down a few lines as a number.... I need it in the actual line so I can use it to calculate my entire pl gained during this login and show it. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Fri May 27, 2005 4:17 pm |
You'd probably want to #substitute rather than #show. I don't think #show will then fire any triggers, and I'd guess you want to change the way it's appearing because you want to fire a trigger.
You need to put %1 in quotes too, otherwise the comma seems to confuse the pattern match
#TRIGGER {Your pl increases by ([%d%p]) points.} {#SUBSTITUTE {Your pl increases by %replace( "%1", ",") points.}} |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Fri May 27, 2005 4:26 pm |
just let it fire of this, unless you just wanna see it look pretty, all calculations could be done off the one trigger
#TRIGGER {Your pl increases by ([%d%p]) points.} {#VAR temp {%replace( "%1", ",")}}
then further manipulate the data now stored in @temp however you need too |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Fewyn Wanderer
Joined: 27 Sep 2002 Posts: 83
|
Posted: Fri May 27, 2005 4:41 pm |
Works perfect shalimar :) Thanks a lot!
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat May 28, 2005 12:41 am |
You can simly use %n to pick up numbers with common punctuations items like commas. Commas are stripped when captured eliminating the need for extra prcoessing.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|