Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("clear")
- print("test")
- function vide()
- for x=1, 16 do
- if turtle.getItemCount(x) > 0 then
- return false
- end
- end
- return true
- end
- function loot()
- while true do
- if turtle.inspect() then
- for x=1,16 do
- turtle.select(x)
- turtle.drop()
- end
- end
- sleep(0.5)
- if vide() then
- sleep(10)
- if vide() then
- break
- end
- end
- end
- end
- function mine(a)
- n = 0
- slot = 1
- while n < a do
- print(turtle.getFuelLevel())
- print(a-n)
- while turtle.getFuelLevel() < 256 do
- turtle.select(slot)
- if turtle.refuel(8) then
- elseif slot > 15 then
- print("Plus de gaz pd")
- sleep(2)
- slot = 1
- else
- slot = slot + 1
- end
- end
- turtle.dig()
- turtle.digUp()
- turtle.digDown()
- if turtle.forward()
- then n = n + 1
- end
- end
- sleep(5)
- end
- rednet.open("right")
- gdr = 0
- while true do
- local id, m, p = rednet.receive()
- if id == 279 and p == "mine" then
- mine(m)
- rednet.receive()
- turtle.turnRight()
- turtle.turnRight()
- local success, data = turtle.inspect()
- if data.name ~= "EnderStorage:enderChest" then
- print("Je ne suis pas la boss :(")
- turtle.turnLeft()
- else
- gdr = 1
- end
- loot()
- if gdr == 1 then
- turtle.turnLeft()
- end
- turtle.turnLeft()
- end
- shell.run("pastebin run jnV0Sdit")
- end
- os.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement