add lower bound

This commit is contained in:
stryan 2022-04-01 11:31:32 -04:00
parent a2adba3b3d
commit d3e337aa25

View File

@ -123,6 +123,9 @@ bot.run(true)
logger.info("Starting bot main loop") logger.info("Starting bot main loop")
loop do loop do
timer = Astro::Moon.phase.phase * (3600 * (1 + rand(3))) timer = Astro::Moon.phase.phase * (3600 * (1 + rand(3)))
if timer < 900 #lower limit of 15 minutes
timer = 900
end
logger.info("sleeping for #{timer} seconds") logger.info("sleeping for #{timer} seconds")
sleep timer sleep timer
t = Time.new t = Time.new