diff --git a/autobudilnik.rb b/autobudilnik.rb index 7311352..a9b347e 100644 --- a/autobudilnik.rb +++ b/autobudilnik.rb @@ -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)