#(josh65) `~run task` doesn't follow wait time in task

23 messages · Page 1 of 1 (latest)

sage shell
#

My script has a While loop and if the condition in the task only has - wait 3s it isn't followed and the while loop is ran every tick crashing the server.

For the sample script If I run flag <player> playerIdleAnimationSelected:! it will switch to the none condition the effect and not follow - wait 3s

https://paste.denizenscript.com/View/139822

https://paste.denizenscript.com/View/139823

vale hedgeBOT
#

(josh65) ~run task doesn't follow wait time in task

vale hedgeBOT
#

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.

jagged plover
#

while loops shoudn't be infinite

#

use delta / system time events instead

#

!e on delta time

velvet troutBOT
# jagged plover !e on delta time
Group

Core

Event Lines

delta time hourly|minutely|secondly

Switches

every:<count> to only run the event every *count* times (like "on delta time secondly every:5" for every 5 seconds).

Triggers

every <count> seconds, minutes, or hours of game calculation time. Default repetitions count of 1.
This is specifically based on the rate of time advancement in the game server,
which is not necessarily equivalent to the real passage of time (for example, this event may fire slower if the server is lagging).
For real time, see !event system time.

Context

<context.second> returns the exact delta time since system start.

jagged plover
#

!debug

velvet troutBOT
# jagged plover !debug
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

sage shell
#

I can't debug the server crashes before I can run the finish command

jagged plover
#

enable debug at least

sage shell
#
#

Moved to the system time event rather than while True and fixes it for my use case. But this would still be an issue if while was following a condition and wait time was set dynamically

jagged plover
#

from my testing it seems the timed queue gets finished immediately, if - wait is the last command in the queue

#

e.g. this will work as there's a narrate after - wait

# /ex run main_queue
main_queue:
    type: task
    script:
    - ~run side_queue
    - narrate <util.queues>
    - narrate fin
side_queue:
    type: task
    script:
    - narrate start
    - wait 5s
    - narrate end
#

but this wont

side_queue:
    type: task
    script:
    - narrate start
    - wait 5s
#

not sure if this is wanted behavior with some special case side effect, as it does not make sense to me, to have a queue running that does not do anything except to wait

#

what you can always do in this case is to use inject to run the script in the same queue as the rest of your script, but for your specific case delta / system event's are better

night drum
#

yeah wait can't be the last command, that's an intentional system rule

novel bearBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@sage shell