Advertisement
Guest User

startup

a guest
Aug 4th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. rednet.open("right")
  2.  
  3.  
  4. function supplyPower(x)
  5.   t = x
  6.   print(t)
  7.   rednet.broadcast("quarry("..t..")")
  8.   i = 0
  9.   n = t*16
  10.   while i < n do
  11.     turtle.select(1)
  12.     turtle.forward()
  13.     turtle.placeDown()
  14.     if turtle.getFuelLevel() <= 20 then
  15.       turtle.turnRight()
  16.       turtle.turnRight()
  17.       turtle.select(2)
  18.       turtle.place()
  19.       turtle.select(3)
  20.       turtle.suck(1)
  21.       turtle.refuel(1)
  22.       turtle.select(2)
  23.       turtle.dig()
  24.       turtle.turnLeft()
  25.       turtle.turnLeft()
  26.       os.sleep(10)    
  27.     else  
  28.       os.sleep(12)
  29.     end
  30.     turtle.select(1)
  31.     turtle.digDown()
  32.     i = i+1
  33.   end
  34.   os.reboot()
  35. end
  36.  
  37. print("How many chunks?")
  38. local input = read()
  39. x = tonumber(input)
  40. print("Mining "..x.." chunks")
  41. supplyPower(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement