SHOW:
|
|
- or go back to the newest paste.
| 1 | m = peripheral.wrap("right")
| |
| 2 | - | m.setFreq(60) |
| 2 | + | m.setFreq(226) |
| 3 | ||
| 4 | - | if m.get() then |
| 4 | + | function refuel() |
| 5 | - | turtle.placeDown() |
| 5 | + | if turtle.getFuelLevel() < 1000 then |
| 6 | - | else |
| 6 | + | turtle.select(3) |
| 7 | - | turtle.digDown() |
| 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 |