"Do every" allows decimals (e.g. 6.5 minutes) as input, but fails to execute

triggers
piston

#1

I’m a longtime WebCoRE user. I discovered a bug today in v0.3.110…

If I have a “Do every” statement, and have it set “do every __ minutes”, and choose a whole number (e.g. 6), the script runs as expected.

If I enter a decimal amount (e.g. 6.5) into the UI:

upon saving will display it as “6”:

23%20AM

However, the piston will not run. It will show an error at the top of the UI “This piston does not subscribe to any events.”

If I switch back to “6” or “7” minutes in the input, the piston runs as expected.

Suggestion: UI should not allow decimals to be input. Or, it should not allow saving if a decimal is in the field.


#2

Workaround: We can use math to correct this issue…

define
    decimal min = 6.5
    integer sec = {min} * 60
end define

execute
    Every {sec} seconds
        do Cool stuff
    END EVERY
end execute

Note: I forget the exact specifics, but there are cases where 6.5 minutes will execute in 6 minutes.
(it floors the number, so 6.9 would still become 6)

Edit: Found it… It is on WAITs, as seen here.