Advertisement
Guest User

autorun.lua

a guest
Jan 22nd, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.13 KB | None | 0 0
  1. -- Magic Strings
  2. -- os.date("%H:%M",realtime.time())
  3. local component = require("component")
  4. local sides = require("sides")
  5. local realtime = require("realtime")
  6. local rs = component.redstone
  7. component.redstone.setOutput(sides.top,0)
  8. repeat
  9.  
  10. if os.date("%H",realtime.time()) == "11" then
  11.   if string.match(os.date("%M",realtime.time()), "5%d") then
  12.   print("07")
  13.   component.redstone.setOutput(sides.top,15)
  14.   os.sleep(150)
  15.   end
  16. else
  17.   os.sleep(150)
  18. end
  19. if os.date("%H",realtime.time()) == "12" then
  20.   if string.match(os.date("%M",realtime.time()), "1%d") then
  21.   print("07")
  22.   component.redstone.setOutput(sides.top,0)
  23.   os.sleep(150)
  24.   end
  25. else
  26.   os.sleep(150)
  27. end
  28. if os.date("%H",realtime.time()) == "23" then
  29.   if string.match(os.date("%M",realtime.time()), "5%d") then
  30.   print("07")
  31.   component.redstone.setOutput(sides.top,15)
  32.   os.sleep(150)
  33.   end
  34. else
  35.   os.sleep(150)
  36. end
  37. if os.date("%H",realtime.time()) == "24" then
  38.   if string.match(os.date("%M",realtime.time()), "1%d") then
  39.   print("07")
  40.   component.redstone.setOutput(sides.top,0)
  41.   os.sleep(150)
  42.   end
  43. else
  44.   os.sleep(150)
  45. end
  46. os.sleep(150)
  47.  
  48. until i == 5
  49.  
  50. print(os.date("%H:%M",realtime.time()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement