naglareffe

lightv1.1

Jun 24th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. m = peripheral.wrap("right")
  2. m.setFreq(226)
  3.  
  4. function refuel()
  5. if turtle.getFuelLevel() < 1000 then
  6.   turtle.select(3)
  7.   turtle.suckDown()
  8.   turtle.refuel()
  9. end  
  10. end
  11.  
  12. function day()
  13.     for n=1,1 do
  14.      turtle.select(2)
  15.      turtle.digDown()
  16.      sleep(1)
  17.       for i=1,24 do
  18.       turtle.down(i)
  19.       end
  20.      turtle.select(3)
  21.      turtle.digDown()
  22.      turtle.down()
  23.      turtle.down()
  24.      turtle.placeUp()
  25.      sleep(2)
  26.     end
  27. end
  28.  
  29. function night()
  30. for n=1,1 do
  31.   refuel()
  32.   turtle.select(1)
  33.   turtle.digUp()
  34.   turtle.up()
  35.   turtle.up()
  36.   turtle.placeDown()
  37.     for i=1,24 do
  38.     turtle.up(i)
  39.     end
  40.   turtle.select(2)
  41.   turtle.placeDown()
  42. end
  43. end
  44.  
  45. while true do
  46.    turtle.select(5)
  47.    if turtle.compare(5) == true then
  48.     if m.get() then
  49.       day()
  50.    elseif
  51.     if m.get() == false then  
  52.       night()
  53.    end
  54.    sleep(10)
  55. end
Advertisement
Add Comment
Please, Sign In to add comment