Search found 68 matches

by zhenzh
Sat Apr 18, 2020 3:21 pm
Forum: Howtos, FAQs and Tips & Tricks
Topic: Can I create a custom event?
Replies: 14
Views: 16423

Re: Can I create a custom event?

I see. But the manually raising event inside function introduces a new issue to be resolved. Invoking raiseEvent() in my case is equal to invoking send() directly (raiseEvent->wait_event->send) Then, the function should look like: function wait_line(pattern, action) thread = coroutin.running() tempT...
by zhenzh
Sat Apr 18, 2020 2:50 pm
Forum: Howtos, FAQs and Tips & Tricks
Topic: Can I create a custom event?
Replies: 14
Views: 16423

Re: Can I create a custom event?

I may understand why invoking function can not rise event. For all lua operation is considered as 3rd-party operation from which mudlet can not be informed.

I need think about some work around to get the event risen at the point of time coroutin.yield() run.
by zhenzh
Sat Apr 18, 2020 2:34 pm
Forum: Howtos, FAQs and Tips & Tricks
Topic: Can I create a custom event?
Replies: 14
Views: 16423

Re: Can I create a custom event?

I have a general design for the function which should be look like: function wait_line(pattern, action) thread = coroutin.running() tempTrigger(pattern, [[wait_resume()]], 1) return coroutin.yield() end function wait_event() send(action) -- the action here is suposed to generate lines to be matched ...
by zhenzh
Fri Apr 17, 2020 1:43 pm
Forum: Howtos, FAQs and Tips & Tricks
Topic: Can I create a custom event?
Replies: 14
Views: 16423

Re: Can I create a custom event?

Sure.
It may need some time for investigation as I'm not familair with the event system.
by zhenzh
Fri Apr 17, 2020 12:41 pm
Forum: Howtos, FAQs and Tips & Tricks
Topic: Can I create a custom event?
Replies: 14
Views: 16423

Re: Can I create a custom event?

I'd like to use it for simulate a wait line result. Different from simple trigger, wait line needs pending the function flow until the trigger is fired. Coroutine.yield and coroutine.resume are used here to implement pending/goahead in a function and the event is planed to be used for monitoring the...
by zhenzh
Fri Apr 17, 2020 8:29 am
Forum: Howtos, FAQs and Tips & Tricks
Topic: Can I create a custom event?
Replies: 14
Views: 16423

Can I create a custom event?

I'd like to have a custom event rather than those pre-defined sysEvents.
For example, I want an event keep on monitoring specified lua coroutine thread. Each time the coroutine status get to suspended, the event will be risen.
by zhenzh
Fri Apr 17, 2020 3:02 am
Forum: Mudlet Development
Topic: How to control the trigger priority
Replies: 1
Views: 5866

How to control the trigger priority

The priority of permTriggers can be manually controled from GUI moving order. How about the tempTriggers?
Is it possible to control the priority of triggers by providing additional parameters in lua command line?
by zhenzh
Fri Apr 17, 2020 2:36 am
Forum: Mudlet Development
Topic: How to delete a batch of triggers/timers from command line
Replies: 1
Views: 6413

How to delete a batch of triggers/timers from command line

In GUI operation, I can removing all triggers/timers under the same group by removing the whole group. But how can I do such batch deletion from lua level?

I suggest introducing tempGroup concept for all tempXXX elements so that they can be operated as what we can do from GUI for perm elements.