Fabrimat

rifornimentoCart

Oct 17th, 2020 (edited)
657
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("ocs/apis/sensor")
  2.  
  3. raining = false
  4. se = sensor.wrap("top")
  5.  
  6. while true do
  7.   targets = se.getTargets()
  8.   details = se.getTargetDetails("CURRENT")
  9.   if details.Raining or details.Thundering then
  10.     print("Snow started")
  11.     raining = true
  12.   elseif raining then
  13.     print("Snow finished")
  14.     rs.setOutput("left", true)
  15.     sleep(0.5)
  16.     rs.setOutput("left", false)
  17.    
  18.     rs.setOutput("right", true)
  19.     sleep(0.5)
  20.     rs.setOutput("right", false)
  21.   end
  22. end
RAW Paste Data