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 ➜ Tips and tricks ➜ Timed Trigger

Timed Trigger

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


Posted by Talmord   (4 posts)  Bio
Date Thu 23 Aug 2007 10:57 PM (UTC)
Message
<module(..., package.seeall);

<triggers>
<trigger
enabled="y"
keep_evaluating="n"
name="Aeon"
omit_from_output="n"
regexp="y"
sequence="100"
script="Curing"
match="="^.* stands a tarot on his open palm\, and blows it lightly at you\. .*$"
</trigger>

require "wait"
wait.make (function ()

world.Send (world.Setoption ("enable_triggers",0)
wait.time (0)
world.Send (inject demulcent\nworld.Setoption("enable_triggers",1),"1")
world.Note ("Attempting to cure Aeon. Standby)

end)
</send>
</trigger>
</triggers>

Something's wrong with the syntax. I keep getting the error message A letter or underscore should precede the attribute value instead of (. This trigger is supposed to switch off all triggers, cure, then switch triggers back on again.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 24 Aug 2007 12:48 AM (UTC)
Message
I would drop the first line (<module(..., package.seeall);) - I don't see what it is doing there.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #2 on Fri 24 Aug 2007 06:44 AM (UTC)
Message
You never closed the first <trigger> tag nor do you open the <send> tag. E.g.:

<triggers>
<trigger
enabled="y"
keep_evaluating="n"
name="Aeon"
omit_from_output="n"
regexp="y"
sequence="100"
script="Curing"
match="="^.* stands a tarot on his open palm\, and blows it lightly at you\. .*$">
<send>

require "wait"
wait.make (function ()

world.Send (world.Setoption ("enable_triggers",0) )
wait.time (0)
world.Send ("inject demulcent")
world.Send (world.Setoption("enable_triggers", 1) )
world.Note ("Attempting to cure Aeon. Standby)

end)
</send>
</trigger>
</triggers>


I can't see whether your Lua is proper since I'm not all that good at Lua, but one error that stands out are your world.SetOption lines. I've fixed those up too, although I'm not sure if they do what you want.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Fri 24 Aug 2007 06:51 AM (UTC)
Message
world.Note ("Attempting to cure Aeon. Standby)


might want to be

world.Note ("Attempting to cure Aeon. Standby")


(note closing quote)

Also, you have a trailing "end)" in your code, but I'm not sure what it's for.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #4 on Fri 24 Aug 2007 07:07 AM (UTC)
Message
That part is OK:


wait.make (function ()

-- function code here

end)


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #5 on Fri 24 Aug 2007 03:37 PM (UTC)
Message
Oops -- didn't see the function opening. My bad. :-)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #6 on Fri 24 Aug 2007 11:57 PM (UTC)
Message
Quote:

world.Send (world.Setoption("enable_triggers", 1) )


It is SetOption, not Setoption, you have to get the capitalization correct:

http://www.gammon.com.au/scripts/doc.php?function=SetOption

Also, why do a world.Send of the result? Assuming the SetOption worked, you would simply be sending "0" to the world.

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


25,118 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.