Page 1 of 1

zmud scripting help wanted

PostPosted: Wed Jun 02, 2004 1:55 pm
by Leizu
I know the string, and need to "analyze" next one. Depends of what following string contains zmud should take different actions.

Let me explain in example:

Leizu is a druid prime. <- this string comes from the mud and never changes. I need to check next, rigth after this one.

next string may contain 3 variants:
1. druid <- zmud should say cool
2. mage <- zmud should say comfort
3. <- (empty string) zmud should be silent


P.S. atm I use zMUD 4.62

Re: zmud scripting help wanted

PostPosted: Wed Jun 02, 2004 4:16 pm
by Weasel
I don't use zMUD, but probably works the same way as my client.. or can be adjusted accordingly.. trigger on
[code:27v4zwxl]
* is a * prime.
[/code:27v4zwxl]
which sends %2 to the subroutine script (zMUD has scripting, right?) that says
[code:27v4zwxl]
sub Leizuscript (strTriggerName, trig_line, arrWildCards)
dim class
class = arrWildCards (1)
if class = ("druid") then
World.send "say cool"
end if
if class = ("mage") than
World.send "say comfort"
end if
end sub
[/code:27v4zwxl]
or something like that anyway heh

PostPosted: Wed Jun 02, 2004 5:55 pm
by Leizu
prolly I gave bad example. I'm not good in coding, so prolly missing something or understand in a wrong way.

those strings are not related anyhow except second goes right after first. hehe.

lets say first string is not 'Leizu is a druid prime', but 'asdfsdfsdfasdfsdfs'.

PostPosted: Wed Jun 02, 2004 8:43 pm
by Zenkai
I'm using zMUd 5.55 here.

Lets say mud output is like so:

[color=yellow:5xkxx084]<726hp 350ma 177mv>
cast 'Aegis' Zenkai
You weave the threads of magic masterfully!
You are surrounded by a radiant light.

<726hp 311ma 177mv>[/color:5xkxx084]

And you want to trigger a command if you cast a masterful aegis.

[code:5xkxx084]trigger:
^~<*hp*ma*mv~>
command:
#var magic 0

trigger:
^You weave the threads of magic masterfully!
command:
#var magic 1

trigger:
^You are surrounded by a radiant light.
command:
#if (@magic = 1) {say Alright! Masterful Aegis!}[/code:5xkxx084]

Is that something like what you want to script?

PostPosted: Thu Jun 03, 2004 5:11 am
by Leizu
thanks Zenkai, I'll keep it in mind. this one might be useful.

btw zmud stores 3 last strings in variables what could be very useful for masterful cast detection. I tried to use it for this case, but empty string didnt let me make it done at first sight.

PostPosted: Sun Jul 18, 2004 9:11 am
by fresh
Newbies!

There is o­ne easy way to solve the problem, if there are not much variants of second string.
You can set up multiline triggers. It can be done this way:

1st trigger:
Trigger pattern: ^Leizu is a druid prime$^Leizu is a druid
Trigger text: #say cool

2nd trigger:
Trigger pattern: ^Leizu is a druid prime$^Leizu is a mage
Trigger text: #say crap

This is it. It should work o­n zmud 4.62 as well.

PostPosted: Sun Jul 18, 2004 9:20 am
by fresh
So, in addition to it, if you need to analyze the second string you will write a trigger like this:

^Leizu is a druid prime$^%1$

and you will have all the second string in your %1 variable

PostPosted: Sun Jul 18, 2004 11:04 am
by Leizu
zmud 4.62 doesnt support multiline triggers, newbie :)

PostPosted: Sun Jul 18, 2004 7:51 pm
by fresh
Hehe, my fault, my memory is playing tricks with me, was using zmud 4.62 too long ago. Then i suppose Terons triggers should be working fine.