SkBee icon indicating copy to clipboard operation
SkBee copied to clipboard

[SUGGESTION] make run task later return the current task id so it can be cancelled

Open itsnotethann opened this issue 7 months ago • 1 comments

Suggestion

As of right now, there is no way to use run task later in conjunction with the task id to cancel it before it runs.

Example Usage:

set {taskToBeRun} to run 1 minute later: broadcast "a minute has passed"

every 10 seconds: if "pzvi" parsed as player is offline: stop task with id {taskToBeRun}

Additional Information

No response

itsnotethann avatar Apr 21 '25 03:04 itsnotethann

This is an interesting concept, and might be relatively simple to implement with section expressions. I'll look into it a bit later.

ShaneBeee avatar Apr 21 '25 03:04 ShaneBeee

I ended up opting for a different solution. Due to the fact the current section extends a loop section (to be able to stop the task within itself) it would have broken logic to make it a section expression. Therefor I just adjusted the current task id expression to have an option for last created task id.

Example of how you could use this

on some event:
    run task 1 minute later:
        do some stuff
    set {id} to last created task id

on blah blah:
    cancel task with id {id}

ShaneBeee avatar May 02 '25 14:05 ShaneBeee