|
prestojosh Beginner
Joined: 21 Feb 2006 Posts: 19
|
Posted: 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 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
|
|