I was just wondering if anyone who uses ZMuD knows how to set a trigger that will set variables?
Announcement
Collapse
No announcement yet.
ZMuD
Collapse
X
-
Make the trigger return "#VAR variable string", where variable is the name of the variable, and string is the data to be store in it. You can use * as a wildcard in the trigger and then do something like "#VAR myvariable %1" to have it store the wildcard (Or %2 for 2nd wildcard, %3 for third...)
Hope that does the trick.
-
Actually, assigning variables in triggers in zMUD is much simpler. Using & in your pattern will asign whatever text is there to a variable. So, in example, say you wanted to assign the numbers from this changing line to variables:
You currently have 13 knowledge crystals and 0 power crystals to use.
The pattern would be:
You currently have &crystals knowledge crystals and &pcrystals power crystals to use.
Recalling @crystals and @pcrystals later in your code should recall 13 and 0 respectively.
Hope that helps!
Comment
-
Hi! I'm quite new to this mudding and mud client scripting so would there be someone to share useful scripts for zmud? I'm having for example trouble with capturing chat to different window with the #CAP command, because it only captures one line and the rest stays in the main window. Is there a way to capture multiline messages?
Comment
-
It is far from easy or reliable because of how Akanbar forces wordwrap on you with no option to disable or even extend it. Using multiline triggers is unreliable because two one-line messages can look like a three-line message unless you do some tricky stuff with parsing. And zMUD's not very good at having triggers enable and disable other triggers fast enough to capture a three-line tell that way. No matter what you do odds are it'll do the wrong thing at some points; the real solution would be if we could disable wordwrapping at the server end, but I expect there's no hope of that.
Comment
-
Okay. Now that I'm sober/awake/not busy, I can help you. Sorry for yesterday or whenever that was.
So I tinkered around and here's how I did multiline stuff. I made four separate triggers
PATTERN:* tells you, "*"
VALUE:#cap tells
PATTERN:* tells you, "*$^*"
VALUE:#cap 2 tells
PATTERN:* tells you, "*$^*$^*"
VALUE:#cap 3 tells
PATTERN:* tells you, "*$^*$^*$^*"
VALUE: #cap 4 tells
**I use * over (%w) in the beginning because of titles being so darn annoying. Ilessa's has a comma after her name, which screws over my current tells checker. Others have prefixes that are either one, two or three words. It's just ultimately easier.
*goes back to being a mindless drone* zzzzLast edited by Xinia; 27 December 2009, 05:41 PM.Sir Ichiban drools all over himself.
You say, "Ready? Ready?"
You say, "Go get it!"
You throw a light crystal to the up.
You have recovered balance.
Sir Ichiban is no longer following you.
Sir Ichiban has just ridden up, astride a warhorse.
Comment
-
Xinia's solution is the multiline version I mentioned above and that's where I started, but it has a flaw which may or may not bother you:
Faralil tells you, "Hi."
2520/2520h 215/315m 42xp >
Faralil tells you, "How are you?"
That will match the one-line version and the three-line version, so you'll get this in your capture:
Faralil tells you, "Hi."
Faralil tells you, "How are you?"
Faralil tells you, "Hi."
2520/2520h 215/315m 42xp >
Faralil tells you, "How are you?"
(The exact sequence depends on the order of your triggers.)
If that's okay with you, you don't need anything smarter than Xinia's approach, but if that bothers you, it gets really tricky to avoid that, which gets into the other stuff I mentioned.
(Incidentally, the extra ^s in Xinia's triggers are redundant; you never need a ^ after a $ inside a multiline trigger.)
Comment
-
Tsianina: Yep had that issue with those triggers. It's bothering a bit, but if it's like you told I guess I have to settle with it. Wouldn't want to start to dig into any rocket science stuff to get that work properly. I really don't know much about programming so don't mind if this is stupid idea: Would it be perhaps good to simply use trigger to only launch a script when there is for example tell and then in the script filter the unneeded #CAP commands out with some if statements? Or is the problem that you can't really detect how many lines there is in the tell? Quess good option would be to supply them in the zuggsoft forums with needed information and ask if it's possible to make clean multiline capture with this kind of system and if, how.
Comment
-
I'm not sure why it's doing double lines for you guys... It's not doing it for me
Also, Tsianina! You smell D:
*takes her redundant coding out for consolation lunch*Sir Ichiban drools all over himself.
You say, "Ready? Ready?"
You say, "Go get it!"
You throw a light crystal to the up.
You have recovered balance.
Sir Ichiban is no longer following you.
Sir Ichiban has just ridden up, astride a warhorse.
Comment
-
-
Originally posted by Chyren View PostIt all depends on what you want. I'm sure we all have specialized stuff for guilds and tradeskills, but aren't going to just put it out there unless its asked for.Last edited by Arionos; 28 December 2009, 10:43 PM.
Comment
-
Experiencing some problems with the automapper.. I used autoconfig and toggled slowwalking as advised in some zuggsoft's common tutorial. Now the problem is that sometimes the mapper maps the room exits wrong taking also directions from the room description. Also sometimes the mapper draws the room again even though it is already mapped. Could anyone hint a workaround to these?
Comment
-
Originally posted by Arionos View PostHmm maybe I did something wrong.. Can u place the triggers in wrong order?
Originally posted by Arionos View PostHow about some common scripts, that made your mudding more pleasant or that are useful and are not guild specific?
- auto sipper
- changing targets for when something stands in your way
- auto-longevity verser (I overcomplicated mine, but I'd give you a simpler one. Oh. And this is guild specific)
- Health/mana/xp gauges
- Weapon state gauges
- Tire gauge
- Beeping mode.
- Commodity comparer
- Other stuff I'm too lazy to explore my system to re-find.
want? You've probably figured out most of it, though, minus the gauges (buttons)Sir Ichiban drools all over himself.
You say, "Ready? Ready?"
You say, "Go get it!"
You throw a light crystal to the up.
You have recovered balance.
Sir Ichiban is no longer following you.
Sir Ichiban has just ridden up, astride a warhorse.
Comment
Comment