Advertisement
Kiliandeca

DecaMiner2: Create - main

Jan 19th, 2017
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. if not turtle then
  2.     error("Floppy ready: You can remove the computer")
  3. end
  4.  
  5. shell.run('delete DecaMiner')
  6.  
  7. if peripheral.getType("right") == "modem" then
  8.     rednet.open("right")
  9. elseif peripheral.getType("left") == "modem" then
  10.     rednet.open("left")
  11. else
  12.     error("Error: no modem detected")
  13. end
  14.  
  15. shell.run("pastebin get YER0NhWe startup")
  16. shell.run("label set DecaMinerV2")
  17.  
  18.  
  19. print(turtle.getFuelLevel())
  20.  
  21. if turtle.getFuelLevel() < 1280 then
  22. if turtle.suckDown(16) then
  23.     if turtle.refuel() then
  24.         print("Refuel sucess")
  25.        
  26.  
  27.  
  28.     else
  29.         error("Invalid item: check the chest, empty the turtle and reboot")
  30.     end
  31. else
  32.     error("Chest empty: check the chest and reboot")
  33. end
  34. end
  35.  
  36.         while true do
  37.             rednet.broadcast("", "break")
  38.             print("d1")
  39.             sleep(1)
  40.         end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement