newline trigger...

Posted by Gore on Tue 17 Feb 2004 06:19 AM — 2 posts, 14,942 views.

#0
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

Australia Forum Administrator #1
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