Due to increasing spam attacks, forum registrations are currently paused to keep our community safe and spam-free. Come hang out and stay connected with us on the SimHub Discord: https://discord.com/invite/nBBMuX7!
Catch you on Discord — and thanks for understanding!
Catch you on Discord — and thanks for understanding!
Notifications
Clear all
Topic starter
23/05/2023 6:48 am
Apologies if this has been answered inside a couple searches and came up empty.
setTimeout() doesn't seem to exist in simhub. Is there anyway short of using nclac to add a timer or delay?
Would appreciate any knowledge on the subject.
Nathan
27/05/2023 6:59 pm
let time = timespantoseconds($prop('SystemInfoPlugin.Uptime'));
if (root.toggle == null) {
root.toggle = false;
root.triggerTime = time;
delay1 = 10;
delay2 = 5;
}
if (time - root.triggerTime >= (root.toggle ? delay2 : delay1)) {
root.toggle = !root.toggle;
root.triggerTime = time;
}
return root.toggle;