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
prestojosh
Beginner


Joined: 21 Feb 2006
Posts: 19

PostPosted: Mon Jan 07, 2008 6:27 pm   

Help with getting variables from a list
 
I need some help assigning variables to a list. Here is the list example

Code:
Following Test                [hitpnts]      [ magic ]   [mst]   [mvs]   [race]
[50  A Test]  Test            500/500      500/500   ===     500      somerace
[50  A Test]  Test1          500/500                     ===     500      somerace
[50  A Test]  Test2          500/500                     ===     500      somerace
[50  A Test]  Test3          500/500                     ===     500      somerace



What I want to do is when I see this list, is to assign the hitpnts numbers to current and maximum hp variables for comparison and I can go from there. I've tried doing whitespace tokens and things like that, but haven't been able to do it. Even doing a trigger for every character didn't work. This is the only thing where the [50 comes at the beginning for this mud. I was hoping someone could help out?

Thanks
_________________
-Presto
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Jan 07, 2008 7:16 pm   
 
I added code tags to your post to preserve the spacing. This regex will match those lines:

[50\s+A \w+]\s+\w+ \s+ \d+\/\d+ \s+ (\d+\/\d+)? \s+ === \s+ \d+ \s+ \w+

I had to use a regex to have optional wildcards. I'm also not sure about the === - presumably it can show other things, but without knowing what they are, I can't really help.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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