waiting for equilibrium Need HELP!!

Posted by Andromache on Sun 25 Sep 2011 04:59 PM — 3 posts, 18,285 views.

#0
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
USA #1
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.
Amended on Sun 25 Sep 2011 06:06 PM by Daniel P
Australia Forum Administrator #2
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.