Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Help please not sure on the proper structure

Help please not sure on the proper structure

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Deladan   (40 posts)  Bio
Date Wed 10 Mar 2010 01:36 AM (UTC)
Message
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
Top

Posted by Deladan   (40 posts)  Bio
Date Reply #1 on Wed 10 Mar 2010 01:58 AM (UTC)
Message
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
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #2 on Wed 10 Mar 2010 04:52 AM (UTC)
Message
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.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 10 Mar 2010 04:53 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Deladan   (40 posts)  Bio
Date Reply #4 on Wed 10 Mar 2010 05:40 AM (UTC)
Message
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
Top

Posted by Deladan   (40 posts)  Bio
Date Reply #5 on Wed 10 Mar 2010 06:13 AM (UTC)
Message
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
Top

Posted by Deladan   (40 posts)  Bio
Date Reply #6 on Wed 10 Mar 2010 05:58 PM (UTC)
Message
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
Top

Posted by Deladan   (40 posts)  Bio
Date Reply #7 on Wed 10 Mar 2010 06:00 PM (UTC)
Message
I think a string.find would probably work better in doing it than a string,find since the position is important.
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #8 on Wed 10 Mar 2010 07:23 PM (UTC)
Message
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



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #9 on Wed 10 Mar 2010 07:24 PM (UTC)
Message
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?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Deladan   (40 posts)  Bio
Date Reply #10 on Wed 10 Mar 2010 07:44 PM (UTC)
Message
#sub {%ansi( 15)~ +[%ansi( 14)Commence the Beating%ansi( 15)~]+}
Top

Posted by Deladan   (40 posts)  Bio
Date Reply #11 on Wed 10 Mar 2010 08:00 PM (UTC)
Message
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}
Top

Posted by Deladan   (40 posts)  Bio
Date Reply #12 on Wed 10 Mar 2010 11:47 PM (UTC)
Message
<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"
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


36,845 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.