Обновить autobudilnik.rb

This commit is contained in:
anon47 2024-02-13 10:39:33 -07:00
parent dba5ed8983
commit b50535b79a

View File

@ -93,6 +93,7 @@ suffix = waittimestr.delete('0-9')
case suffix
when ''
waittime = waittimestr.to_i
waittimestr += 's'
when 'd'
waittime = waittimestr.to_i * 86400
when 'm'
@ -105,12 +106,12 @@ else
raise "'#{suffix}' suffix is not found"
end
if waittime > 17
if waittime > 18
puts 'waittime:' + waittimestr
waittime = waittime - 18 # 30 x 0.6 = 18
else
puts "18 seconds is the minimum\nwaittime:18"
waittime = 0
puts "19 seconds is the minimum\nwaittime:19s"
waittime = 1
end
nexttime = Time.new + waittime
@ -160,7 +161,7 @@ while true
sleep(0.6) #НУЖНО УБАВИТЬ С ВЭЙТТАЙМА
a2.call(175)
}
puts "turn on audio"
puts "starts audio"
system('zadacha1.bat ' + audiofilepath)
end
sleep(3.4)