[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]  Lua
. . -> [Subject]  waiting for equilibrium Need HELP!!

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

waiting for equilibrium Need HELP!!

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


Posted by Andromache   (7 posts)  [Biography] bio
Date Sun 25 Sep 2011 04:59 PM (UTC)  quote  ]
Message
GIRDLING Protective Girdling. Diamond/Crescent/Circle/Star/Pentacle

I need to be able to do this

Send ("sketch diamond")
wait for equilbrium
Send ("sketch crescent")
wait for equilibrium
Send ("sketch circle")
wait for equilbrium
Send ("sketch star")
wait for equilbrium
Send ("sketch pentacle")
wait for equilibrium
Send ("dance girdling enemies")

the text for getting equilbrium back is
You have equilibrium.

I also have variables to track my EQ if you think I should use that instead

If I don't have EQ I can't sketch them so I might need to have it resend if it fails
each ritual has a different amount of shapes and so when I type an alias for a particular ritual I need to tell it to sketch each shape on EQ then when all the shapes needed are sketched to dance the ritual
[Go to top] top

Posted by Daniel P   USA  (77 posts)  [Biography] bio
Date Reply #1 on Sun 25 Sep 2011 06:04 PM (UTC)  quote  ]

Amended on Sun 25 Sep 2011 06:06 PM (UTC) by Daniel P

Message
I've come up with a very effective (but a little bloated) solution to this sort of thing which I've used in multiple places. It is to create a single trigger for every step, plus an alias to initialize. Note that all triggers are not enabled at the start.

In your case:

<aliases>
  <alias
   enabled="y"
   match="girdling"
   sequence="100"
   send_to="12"
  >
  <send>
    EnableTrigger("girdling2",true)
    Send("sketch diamond")
  </send>
  </alias>
</aliases>

<triggers>
  <trigger
   match="You have equilibrium."
   name="girdling2"
   send_to="12"
   sequence="100"
   keep_evaluating="y"
  >
  <send>
    EnableTrigger("girdling3",true)
    Send("sketch crescent")
    EnableTrigger("girdling2",false)
  </send>
  </trigger>

  <trigger
   match="You have equilibrium."
   name="girdling3"
   send_to="12"
   sequence="100"
   keep_evaluating="y"
  >
  <send>
    EnableTrigger("girdling4",true)
    Send("sketch circle")
    EnableTrigger("girdling3",false)
  </send>
  </trigger>

  <trigger
   match="You have equilibrium."
   name="girdling4"
   send_to="12"
   sequence="100"
   keep_evaluating="y"
  >
  <send>
    EnableTrigger("girdling5",true)
    Send("sketch star")
    EnableTrigger("girdling4",false)
  </send>
  </trigger>

  <trigger
   match="You have equilibrium."
   name="girdling5"
   send_to="12"
   sequence="100"
   keep_evaluating="y"
  >
  <send>
    EnableTrigger("girdling6",true)
    Send("sketch pentacle")
    EnableTrigger("girdling5",false)
  </send>
  </trigger>

  <trigger
   match="You have equilibrium."
   name="girdling6"
   send_to="12"
   sequence="100"
   keep_evaluating="y"
  >
  <send>
    Send("dance girdling enemies")
    EnableTrigger("girdling6",false)
  </send>
  </trigger>
</triggers>


See how that works.
[Go to top] top

Posted by Nick Gammon   Australia  (18,798 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Mon 26 Sep 2011 06:54 AM (UTC)  quote  ]

Amended on Mon 26 Sep 2011 06:59 AM (UTC) by Nick Gammon

Message
Andromache said:

I need to be able to do this

Send ("sketch diamond")
wait for equilbrium
Send ("sketch crescent")
wait for equilibrium
Send ("sketch circle")
wait for equilbrium
Send ("sketch star")
wait for equilbrium
Send ("sketch pentacle")
wait for equilibrium
Send ("dance girdling enemies")


See this page:

http://www.gammon.com.au/forum/?id=4957

You could do something like:



<aliases>
  <alias
   match="girdling"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>

require "wait"

wait.make (function ()  --- coroutine below here

  local TIMEOUT = 5  -- give up after 5 seconds

  Send ("sketch diamond")
  wait.match ("You have equilibrium.", TIMEOUT)

  Send ("sketch crescent")
  wait.match ("You have equilibrium.", TIMEOUT)

  Send ("sketch circle")
  wait.match ("You have equilibrium.", TIMEOUT)

  Send ("sketch star")
  wait.match ("You have equilibrium.", TIMEOUT)

  Send ("sketch pentacle")
  wait.match ("You have equilibrium.", TIMEOUT)

  Send ("dance girdling enemies")
  wait.match ("You have equilibrium.", TIMEOUT)

  Note "Girdling complete!"
  
end)  -- end of coroutine

</send>
  </alias>
</aliases>


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


- 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.


783 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]