Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
uviel
Beginner


Joined: 24 Feb 2007
Posts: 12

PostPosted: Sat Feb 24, 2007 6:43 pm   

Stat trigger
 
Hi, I am trying to capture stats to a variable via trigger. The mud I am on displays stats as:

------------------------------------------------------------------------
Str: 23 (23.4) Plat: 2
Int: 14 (14.0) Aqp: 0 Gold: 96
Wis: 16 (16.0) Iqp: 0 Silv: 30
Dex: 15 (15.0)
Con: 22 (22.0)

I made the followng trigger:

%s Str: %s %d (?%a?)

with @str = %1 in the value field

The above is not firing. Any hel would be appreciated. BTW I am new to this so if at all possible take it easy on me :P
Reply with quote
uviel
Beginner


Joined: 24 Feb 2007
Posts: 12

PostPosted: Sat Feb 24, 2007 6:53 pm   
 
Oh yeah also havng problem with capturing decimal numbers I just capture 23. the number after the decimal point is not getting captured
Reply with quote
uviel
Beginner


Joined: 24 Feb 2007
Posts: 12

PostPosted: Sat Feb 24, 2007 7:53 pm   
 
Solved it with the following trigger

Str: %d (%1) %s Plat: %d

Thanks
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Feb 24, 2007 8:00 pm   
 
%a isn't a valid wildcard, and I'm not sure what's going on with that (??) stuff. Technically, %1 isn't a valid wildcard either, you'll should really use something like:

%sStr:%s%d (%d.%d)

You could also create a regex using [\d\.]+
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Feb 25, 2007 3:16 am   
 
Umm, yeah it is, Fang (but you're correct in that it wouldn't work in this situation). %a equates to any letter OR number combination similar to %w:

%w -- one-word combination of only letters (ie, "cat" but not "cat-dog")
%d -- one-word combination of only numbers (ie, "123" but not "1,000")
%a -- one-word combination of anything %w or %d matches (ie, "123abc")
%p -- one-word cominbation of only punctuation symbols (ie, "...")
%x -- one-word combination of anything %w, %d, or %p matches
_________________
EDIT: I didn't like my old signature
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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