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

Gammon Forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Be careful to use wait.lua [solved]
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Be careful to use wait.lua [solved]

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


Posted by Yanwuhuan   (15 posts)  [Biography] bio
Date Fri 11 Jan 2013 04:37 PM (UTC)
Message
Well, wait.lua is very powerful module.
In fact, I use it for many conditions, which make trigger fewer and script is cleaner.

But seems it has some limitation.
This is a case:

cmd > ask dispatcher about job
mud 1> Dispatcher is thinking ...
This guy usually dispatch job after some seconds
Here I enable trigger to match mud 5
...
mud 2 > Ooops, your weapon is broken.
A function will be invoked, it used wait.
script send 1 > remove shield 1
wait.regexp "removed", like mud 3
mud 3> You removed your shield.
mud 4 > Job dispatcher said:
mud 5 > Your job target NPC is there....
This line should trigger something, but not.
script send 2 > wield sword
script send 3 > wear shield 1
So then script was over.
mud 6 > You wield your sword.
mud 7 > You equip your shield.


Seems the script function for mud 2 used wait, mud 5 not triggered.
I just enable mud 5 trigger if mud 1 appeared, and disable itself when it fired.
In this case, I check this trigger, it was enabled.
[Go to top] top

Posted by Nick Gammon   Australia  (21,677 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 11 Jan 2013 10:15 PM (UTC)
Message
I think I would need to see your code to comment. You may have a simple race condition, or you may have a trigger in the wait that is too general (ie. matching anything).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Yanwuhuan   (15 posts)  [Biography] bio
Date Reply #2 on Sat 12 Jan 2013 03:47 AM (UTC)
Message

Yes, you're right.
I test it in a pure environment, it works.

Please mark this post as "invalid post" :)
[Go to top] top

Posted by Nick Gammon   Australia  (21,677 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Sat 12 Jan 2013 04:13 AM (UTC)
Message
I'll mark it solved.

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


2,869 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]