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 ➜ newline trigger...

newline trigger...

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


Posted by Gore   (207 posts)  Bio
Date Tue 17 Feb 2004 06:19 AM (UTC)
Message
Hello, trying to make a reroller for a mud a play..

Here's what the output from the mud is:

Quote:

|Your stats are:
|               Current  Racial
|                  Stat  Max
|     Agility     :  61   80
|     Stamina     :  73   80
|     Strength    :  66   80
|     Quickness   :  62   80
|     Willpower   :  75   80
|     Perception  :  68   80
|     Intelligence:  73   80
|Is this acceptable?


the |'s aren't actually in the imput, just emphasizing the spacing. Here's the code I have so far:

Quote:

<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^     Agility     \:  (.*?)   80$"
   regexp="y"
   script="agil_log"
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  </trigger>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^     Intelligence\:  (.*?)   80$"
   regexp="y"
   script="inti_log"
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  </trigger>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^     Perception  \:  (.*?)   80$"
   regexp="y"
   script="perc_log"
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  </trigger>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^     Quickness   \:  (.*?)   80$"
   regexp="y"
   script="quic_log"
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  </trigger>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^     Stamina     \:  (.*?)   80$"
   regexp="y"
   script="stam_log"
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  </trigger>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^     Strength    \:  (.*?)   80$"
   regexp="y"
   script="stre_log"
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  </trigger>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^     Willpower   \:  (.*?)   80$"
   regexp="y"
   script="will_log"
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  </trigger>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^Is this acceptable\? $"
   regexp="y"
   script="acceptable"
   sequence="100"
   other_text_colour="black"
   other_back_colour="black"
  >
  </trigger>
</triggers>

Dim agil, stam, stre
Dim quic, will, perc
Dim inti, accept

accept = 0

Sub acceptable (a,b,wildcard)
  World.Note "Agil - " & agil & " Perc - " & perc & " Stam - " & stam & " Quic - " & quic
  if cint(agil) > 79  then
    accept = accept + 1
    World.Note "Agil is good, " & agil
  End if
  if cint(perc) > 79  then
    accept = accept + 1
    World.Note "Perc is good, " & perc
  End if
  if Cint(stam) > 79  then
    accept = accept + 1
    World.Note "Stam is good, " & stam
  End if
  if Cint(quic) > 79 then
    accept = accept + 1
    World.Note "quic is good, " & quic
  End if
  if accept = 4 then
    'World.Note "Stats: " & agil & " agi, " & perc & " per, " & stam & " sta, " & quic & "qui, " & will " wil, " & stre & " str, " & inti & " int."
    World.Note "Stats are good, type Y to continue."
    World.Send "y"
  End if
  If accept < 4 then
    accept = 0
        World.Note "Stats suck"
  End if
End Sub

Sub Agil_log (a,b,wildcard)
  agil = wildcard(1)
End Sub

Sub stam_log (a,b,wildcard)
  stam = wildcard(1)
End Sub

Sub stre_log (a,b,wildcard)
  stre = wildcard(1)
End Sub

Sub quic_log (a,b,wildcard)
  quic = wildcard(1)
End Sub

Sub will_log (a,b,wildcard)
  will = wildcard(1)
End Sub

Sub perc_log (a,b,wildcard)
  perc = wildcard(1)
End Sub

Sub inti_log (a,b,wildcard)
  inti = wildcard(1)
End Sub


Problem is, here's what I get from the mud with the code:

Quote:

Your stats are:
               Current  Racial
                  Stat  Max
     Agility     :  48   80
     Stamina     :  62   80
     Strength    :  80   80
     Quickness   :  40   80
     Willpower   :  64   80
     Perception  :  49   80
     Intelligence:  73   80
Is this acceptable? 
Agil - 48 Perc - 49 Stam - 62 Quic - 40
Stats suck



Your stats are:
               Current  Racial
                  Stat  Max
     Agility     :  61   80
     Stamina     :  73   80
     Strength    :  66   80
     Quickness   :  62   80
     Willpower   :  75   80
     Perception  :  68   80
     Intelligence:  73   80
Is this acceptable? 


my "acceptable" trigger won't show anything until after something is sent through, or received from the mud. I had a problem like this with my prompt triggers on zMud, but I fixed it by switching the trigger to newline, any ideas on how I can fix this in mushclient? Thank you

Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 17 Feb 2004 07:22 AM (UTC)
Message
The latest version of MUSHclient (3.44) has a new facility (OnPluginPartialLine).

This would let you reply to the question "Is this acceptable?" even without waiting for the newline.

See this post:

http://www.gammon.com.au/forum/?bbsubject_id=3774


- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


11,920 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.