You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
localblah=1localid="foo"localrepeatUtil=require'repeat-util'localfunctiondoStuff()
print("Blah: " ..blah)
blah=blah+1print("Blah is now " ..blah)
ifblah>10thenprint("Blah is more than 10. Stopping.")
print("Has supposedly cancelled = " ..tostring(repeatUtil.cancel(id)))
endendrepeatUtil.scheduleEvery(id,50,"frames",doStuff)
This doesn't work because repeat-utils schedules the next call of doStuff() after doStuff() returns, regardless of what doStuff() does. Scheduling it before doStuff() could result in error message spam, but tracking calls to cancel() and avoiding rescheduling doStuff() if it cancelled itself could work.
The text was updated successfully, but these errors were encountered:
This was pointed out by Atkana on the forums:
This doesn't work because repeat-utils schedules the next call of doStuff() after doStuff() returns, regardless of what doStuff() does. Scheduling it before doStuff() could result in error message spam, but tracking calls to cancel() and avoiding rescheduling doStuff() if it cancelled itself could work.
The text was updated successfully, but these errors were encountered: