[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  newline trigger...

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

newline trigger...

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Gore   (207 posts)  [Biography] bio
Date Tue 17 Feb 2004 06:19 AM (UTC)  quote  ]
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

[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 17 Feb 2004 07:22 AM (UTC)  quote  ]
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
[Go to top] 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.


1,687 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]