Notifications
Clear all
Topic starter
23/05/2023 5: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 5: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;