|
egads Beginner
Joined: 10 Mar 2005 Posts: 15
|
Posted: Thu Mar 10, 2005 7:36 am
[Triggernewb] Help! Please. Heh. |
Okay. I'd like to think I have what is a simple problem with a hpbar trigger.
Reading a bunch of helpfiles, and asking a bunch of people I mud with has yielded no positive results.
---
Here is the trigger in its current form:
HP~: (%d)~/(%d) SP~: (%d)~/(%d)~/(%d)~%~/(%d)~% Sat~: (%d)~% Cnc~: (%d)~% G~:(%d)/(%d)~% S~:(%d)~/(%d)~% G2N~:(%d)% (*) ~<P~>
---
And here are several differeing samples of the text it matches:
HP: 713/321 SP: 1526/1526/92%/20% Sat: 0% Cnc: 0% G:3/31% S:1/35% G2N:47% A MI B MB <P>
HP: 713/321 SP: 1526/1526/92%/20% Sat: 0% Cnc: 0% G:3/31% S:1/35% G2N:47% A SS MS B MG PG <P>
HP: 713/321 SP: 1526/1526/92%/20% Sat: 0% Cnc: 0% G:3/31% S:1/35% G2N:47% A SS MS B MG PE MB <P>
HP: 713/321 SP: 1526/1526/92%/20% Sat: 0% Cnc: 0% G:3/31% S:1/35% G2N:47% A SS MS PA B MG PE MB GS <P>
---
What I want to do is simple. Or it should be simple. All of that text in capital letters with the space bars in it, I want to put all of that into a plain old variable. I don't want to do anything special with it. I just want it in a variable, with its space bars right where they should be. No processing of any kind will happen with this variable. So it doesn't have to be fancy shmancy. All I want done with it is to put the stored variable on a lable and there it shall sit. Looking pretty and achieving nothing. That's it! Should be simple. That section of the current trigger is currently (*)
It's important that the variable is limited only by the text G2N: (%d)~% at the start, and by ~<P~> at the end, because that section of text can be all manner of lengths, all manner of combinations. Theres never going to be a value that starts and ends it every time within that section of text, just the bits around it.
So can anyone think of a solution?
That is. If anyone cares. I'm not the first, and I won't be the last person to log on to zuggsoft, beg for help with a trigger, and then disappear like a fart in the wind once someones done what I want.
I am using Zmud 7.05
Thanks in advance. |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Mar 10, 2005 9:52 am |
If you're not planning on doing anything with the variable then you can probably be a bit more lax in defining the pattern match.
Try
Code: |
#TRIGGER {HP: (*) SP: (*) Sat: (*) Cnc: (*) G:(*) S:(*) G2N:(*) <P>} {plainOldVariable = {HP: %1 SP: %2 Sat: %3 Cnc: %4 G:%5 S:%6 G2N:%7 ~"<"P~">"}} |
Guinn |
|
|
|
egads Beginner
Joined: 10 Mar 2005 Posts: 15
|
Posted: Thu Mar 10, 2005 10:02 am |
You misunderstood, perhaps I didn't write it correctly.
All of the patterns that currently exist in that trigger are defined like that because they are used for many many things. The addition I want to make, that one change that I cannot master, I don't want to do anything with. All the other pattern matching has to remain as it is. It is the (*) that is able to, and has to change.
An example to make it clear.
In the line:
HP: 713/321 SP: 461/1615/100%/40% Sat: 0% Cnc: 58% G:3/19% S:1/49% G2N:51% A MS SS B MG PE MB GS <P> Mon(Mud):pe
I want the variable to store, without quotes "A MS SS B MG PE MB GS"
Then I will place that variable on my Status Bar. And I will be a happy fellow. |
|
|
|
egads Beginner
Joined: 10 Mar 2005 Posts: 15
|
Posted: Thu Mar 10, 2005 10:26 am |
Hrm. This is interesting. It's actually already doing what I want kind of.
I simply did this:
#var currentdspells %14
Then I started echoing triggers to see what was taking place.
And this is what I am presented with.
[G2N:(*)~% (*) ~<P~>-> #IF (@hpgag) {#gag}]
[HP~: (%d)~/(%d) SP~: (%d)~/(%d)~/(%d)~%~/(%d)~% Sat~: (%d)~% Cnc~: (%d)~% G~:(%d)/(%d)~% S~:(%d)~/(%d)~% G2N~:(%d)~% (*) ~<P~>-> #var currenthp 753
#var maxhp 361
#var currentsp 1228
#var maxsp 1771
#var mentalcognition 100
#var gem 10
#var saturation 2
#var concentration 75
#var gcanmake 3
#var greset 90
#var schoolspell 1
#var schoolreset 12
#var G2N 52
#var currentdspells A MS SS B MG PE MB GS]
If i then at this point do:
#var currentdspells
Variable: currentdspells A
It's stopping storing at the first space bar. What minor change do I have to do? I knew this wasn't a complex problem. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Mar 10, 2005 10:37 am |
Use proper delimeters to tell zMud that all the text should be used as a single argument. In this case either double quotes or braces are proper. I chose braces since that is what is shown in the help for #VARIABLE.
#var currentdspells {%14} |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Mar 10, 2005 10:51 am |
Sorry, it's morning and I've not had my coffee yet.
I removed a few of the ~'s from the pattern match, but this seems to be matching the last bit fine for me now, whilst still leaving all the rest intact too.
#TRIGGER {HP: (%d)/(%d) SP: (%d)/(%d)/(%d)~%/(%d)~% Sat: (%d)~% Cnc: (%d)~% G:(%d)/(%d)~% S:(%d)/(%d)~% G2N:(%d)~% (*) ~<P~>} {currentdspells = %14} |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
|
|