zmud scripting help wanted

Scripts for zMUD and CMUD

zmud scripting help wanted

Postby Leizu » Wed Jun 02, 2004 1:55 pm

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
Leizu
 
Posts: 25
Joined: Wed Jan 07, 2004 5:39 pm
Status: Offline

Re: zmud scripting help wanted

Postby Weasel » Wed Jun 02, 2004 4:16 pm

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
User avatar
Weasel
Hall of Fame Avatar Poster
 
Posts: 2174
Joined: Sun Jan 04, 2004 4:27 am
Status: Offline

Postby Leizu » Wed Jun 02, 2004 5:55 pm

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'.
Leizu
 
Posts: 25
Joined: Wed Jan 07, 2004 5:39 pm
Status: Offline

Postby Zenkai » Wed Jun 02, 2004 8:43 pm

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?
Zenkai
 
Posts: 34
Joined: Sun Apr 25, 2004 3:15 am
Status: Offline

Postby Leizu » Thu Jun 03, 2004 5:11 am

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.
Leizu
 
Posts: 25
Joined: Wed Jan 07, 2004 5:39 pm
Status: Offline

Postby fresh » Sun Jul 18, 2004 9:11 am

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.
fresh
 
Posts: 6
Joined: Sat Jun 05, 2004 9:30 pm
Status: Offline

Postby fresh » Sun Jul 18, 2004 9:20 am

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
fresh
 
Posts: 6
Joined: Sat Jun 05, 2004 9:30 pm
Status: Offline

Postby Leizu » Sun Jul 18, 2004 11:04 am

zmud 4.62 doesnt support multiline triggers, newbie :)
Leizu
 
Posts: 25
Joined: Wed Jan 07, 2004 5:39 pm
Status: Offline

Postby fresh » Sun Jul 18, 2004 7:51 pm

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.
fresh
 
Posts: 6
Joined: Sat Jun 05, 2004 9:30 pm
Status: Offline


Return to zMUD/CMUD Scripts

Who is online

Users browsing this forum: No registered users and 5 guests

cron