Help please not sure on the proper structure

Posted by Deladan on Wed 10 Mar 2010 01:36 AM — 13 posts, 42,617 views.

#0
ok This is what I have for a zmud trigger

^You have recovered balance on all limbs\.$

This is what it does

balance=1
#sub {%ansi( 15)~ +[%ansi( 14)Commence the Beating%ansi( 15)~]+}
#if (@disembowel=1 and @balance=1 and @equilibrium=1) {Disembowel}


how do I convert that over to mush client, I have a few like that so just one example can help me a lot
#1
Also I'm having trouble with this alias

Rune

And this is what it does

#var runetarget %1
say to @runetarget You wish me to bestow some of my power upon thee??
outr 3 yellowink
outr purpleink
outr greenink
sketch algiz on @runetarget
#wa 4500
sketch berkana on @runetarget
#wa 4500
sketch jera on @runetarget
Australia Forum Administrator #2
Deladan said:

how do I convert that over to mush client, I have a few like that so just one example can help me a lot


Something like this:


<triggers>
  <trigger
   enabled="y"
   match="^You have recovered balance on all limbs\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>

balance = true

if disembowel and balance and equilibrium then
  Send "Disembowel"
end -- if

</send>
  </trigger>

  <trigger
   enabled="y"
   match="^You have regained your mental equilibrium\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>

equilibrium = true

if disembowel and balance and equilibrium then
  Send "Disembowel"
end -- if

</send>
  </trigger>
</triggers>


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


You would need to know you lost them as well, which you can probably work out from your prompt.

Australia Forum Administrator #3
Deladan said:

Also I'm having trouble with this alias

Rune

And this is what it does

#var runetarget %1
say to @runetarget You wish me to bestow some of my power upon thee??
outr 3 yellowink
outr purpleink
outr greenink
sketch algiz on @runetarget
#wa 4500
sketch berkana on @runetarget
#wa 4500
sketch jera on @runetarget


Template:post=4956
Please see the forum thread: http://gammon.com.au/forum/?id=4956.
#4
Thanks alot I plan on doing something with the prompt about like this

Where this is the trigger line

^(\d+)h, (\d+)m, (\d+)e, (\d+)w (.+)-$

And this is what it does


prompt=%5
#if %pos( x, @prompt) {balance=1} {balance=0}
#if %pos( e, @prompt) {equilibrium=1} {equilibrium=0}
#if %pos( k, @prompt) {kola=1} {kola=0}
#if %pos( b, @prompt) {blindness=1} {blindness=0}
#if %pos( d, @prompt) {deafness=1} {#if @deafness=1 {deafness=0}}


with the extra in there being placeholders and such
#5
Also what about the substitutions on the other two I think that a colornote would do for what I want but I'm not sure of where to put it in heh
#6
I could probably use string.find to do it. I think not too sure maybe a string.match would work too. ok getting a headache now so yeah
#7
I think a string.find would probably work better in doing it than a string,find since the position is important.
Australia Forum Administrator #8
string.find would be about the same as string.find actually. ;)

Given that the balance stuff is in wildcard 5 something like this should do it:


prompt = "%5"    -- note the quotes!

balance     = string.match (prompt, "x")
equilibrium = string.match (prompt, "e")
kola        = string.match (prompt, "k")
blindness   = string.match (prompt, "b")
deafness    = string.match (prompt, "d")


In each case string.match returns nil if the string isn't found (I don't think the position matters because they are all different), and non-nil if found.

Now in Lua nil is considered false and anything else (except the word false itself) is considered true, so you can now just say:


if disembowel and balance and equilibrium then
  Send "Disembowel"
end -- if


Australia Forum Administrator #9
Deladan said:

Also what about the substitutions on the other two I think that a colornote would do for what I want but I'm not sure of where to put it in heh


Inside the if?
#10
#sub {%ansi( 15)~ +[%ansi( 14)Commence the Beating%ansi( 15)~]+}
#11
I'm just starting small with converting my offensive over to mush

#CLASS 0
#CLASS {Deladan Stuff|Attacking|DSB}
#ALIAS dsbqueue {#IF (@disembowel=1 & @balance=1 & @equilibrium=1);disembowel;disembowel=0}
#REGEX {^With a vicious snarl you carve a merciless swathe through the steaming guts of} {disembowel=0}
#REGEX {^You have no victim impaled to be able to perform a disembowelment} {disembowel=0}
#REGEX {^Blood bubbles and froths from (\w+)'s mouth as (?:she|he) gasps (?:his|her) last breath and slides off the} {disembowel=0}
#REGEX {^With a snarl of contempt, you allow (\w+) to slide free of your weapon} {disembowel=0}
#REGEX {^You have slain (.+)} {disembowel=0}
#REGEX {^You draw your blade back and plunge it deep into the body of} {disembowel=1;Balance=0}
#CLASS 0


#REGEX {^(\d+)h, (\d+)m, (\d+)e, (\d+)w (.+)-$} {prompt=%5;#if %pos( x, @prompt) {balance=1} {balance=0};#if %pos( e, @prompt) {equilibrium=1} {equilibrium=0};#if %pos( k, @prompt) {kola=1} {kola=0};#if %pos( b, @prompt) {blindness=1} {blindness=0};#if %pos( d, @prompt) {deafness=1} {#if @deafness=1 {deafness=0}}"" {nocr|prompt}
#12
<trigger
enabled="y"
group="DSB"
match="^(\d+)h, (\d+)m, (\d+)e, (\d+)w (.+)-$"
regexp="y"
send_to="12"
sequence="100"
>
<send>prompt = "%5"

balance = string.match (prompt, "x")
equilibrium = string.match (prompt, "e")
kola = string.match (prompt, "k")
blindness = string.match (prompt, "b")
deafness = string.match (prompt, "d")
</send>
</trigger>
<trigger
enabled="y"
group="DSB"
match="^Blood bubbles and froths from (\w+)'s mouth as (?:she|he) gasps (?:his|her) last breath and slides off the"
regexp="y"
send_to="12"
sequence="100"
>
<send>disembowel = false</send>
</trigger>
<trigger
enabled="y"
group="Balance"
match="^The gremlin races between your legs"
regexp="y"
send_to="12"
sequence="100"
>
<send>balance = false </send>
</trigger>
<trigger
enabled="y"
group="DSB"
match="^With a snarl of contempt, you allow (\w+) to slide free of your weapon"
regexp="y"
send_to="12"
sequence="100"
>
<send>disembowel = false </send>
</trigger>
<trigger
enabled="y"
group="DSB"
match="^With a vicious snarl you carve a merciless swathe through the steaming guts of"
regexp="y"
send_to="12"
sequence="100"
>
<send>disembowel = false </send>
</trigger>
<trigger
enabled="y"
group="DSB"
match="^You draw your blade back and plunge it deep into the body of"
regexp="y"
send_to="12"
sequence="100"
>
<send>disembowel = true
balance = false </send>
</trigger>
<trigger
enabled="y"
group="DSB"
match="^You have no victim impaled to be able to perform a disembowelment"
regexp="y"
send_to="12"
sequence="100"
>
<send>disembowel = false </send>
</trigger>
<trigger
enabled="y"
group="DSB"
match="^You have recovered balance on all limbs\.$"
regexp="y"
send_to="12"
sequence="100"
>
<send>

balance = true

if disembowel and balance and equilibrium then
Send "Disembowel"
end -- if

</send>
</trigger>
<trigger
enabled="y"
group="DSB"
match="^You have recovered equilibrium\.$"
regexp="y"
send_to="12"
sequence="100"
>
<send>

equilibrium = true

if disembowel and balance and equilibrium then
Send "Disembowel"
end -- if

</send>
</trigger>
<trigger
enabled="y"
group="DSB"
match="^You have slain (.+)"
regexp="y"
send_to="12"
sequence="100"
>
<send>disembowel = false </send>
</trigger>


<alias
match="dsb"
enabled="y"
group="Attacking"
sequence="100"
>
<send>disembowel</send>
</alias>
<alias
match="dsbqueue"
enabled="y"
group="DSB"
send_to="12"
sequence="100"
>
<send>if disembowel and balance and equilibrium then
Send "Disembowel"