SchindlerShadow

Ars-Magica-2-Cap-Replacer

Aug 27th, 2014
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. function getBlock()
  2.   if turtle.getItemCount(1) == 1 then
  3.     return 1
  4.   else
  5.     return 2
  6.   end
  7. end
  8.  
  9. function dayTime(block)
  10.   if block == 2 then
  11.     turtle.digDown()
  12.     turtle.select(1)
  13.     turtle.placeDown()
  14.   end
  15.   print("Daytime")
  16. end
  17.  
  18. function nightTime(block)
  19.   if block == 1 then
  20.     turtle.digDown()
  21.     turtle.select(2)
  22.     turtle.placeDown()
  23.   end
  24.   print("NightTime")
  25. end
  26.  
  27. while true do
  28. time = os.time()
  29. block = getBlock()
  30. print(time)
  31.  
  32. if time > 7 and time < 20 then
  33.   dayTime(block)
  34. else
  35.   nightTime(block)
  36. end
  37.  
  38.  
  39.  
  40. sleep(.1)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment