#(apememadide) pass `<context>` to a ran task ?

9 messages · Page 1 of 1 (latest)

mystic egret
#

~~https://paste.denizenscript.com/View/123095~~ https://paste.denizenscript.com/View/123100
Made that helper system that allows to add event listeners to inventory scripts by specifying subtasks.events.on some event subscripts.
To make that smoother, it's important that the subtasks have access to the context of each event, i.e. <context.click>, which I only managed to do by injecting the tasks. However, having everything injected means any script using stop or determine will stop the whole handler, not just this one.

Is there a workaround for this ?

drowsy saddleBOT
#

(apememadide) pass <context> to a ran task ?

drowsy saddleBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

mystic egret
#

What would be useful would be to have a way to pass the event context to the task, which we run instead of inject

#

An alternative would be to create a context definition of all the event's keys, but that's pretty unintuitive imo

#

Also, determine could be fixed by passively, but stop doesn't

#

In the current implementation, stopping the script in the on block will also prevent the after block from running
The fix for that would be to set 2 event listeners, one on on and one on after, but it'd duplicate the checking logic

#

Or alternatively, would there be some kind of way of "catching" the queue ending within an injected script ?