Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local time = 205
- local chestSide = 'Right'
- function checkPosition()
- local success, block = turtle.inspect()
- if success then
- if block.name == "projecte:collector_mk3" then
- print("mk3 front")
- function waiting(i)
- if i ~= time or i < time then
- i = i + 1
- print("waiting "..i.."/"..time)
- sleep(1)
- waiting(i)
- end
- end
- waiting(0)
- turtle.dig()
- local p = find(1, "projecte:collector_mk3")
- if p then
- turtle.select(p)
- turtle.place()
- end
- StartProgram()
- else
- print("no mk3 turn")
- turtle.turnRight()
- checkPosition()
- end
- end
- end
- function StartProgram()
- while true do
- print("select slot 16")
- turtle.select(16)
- sleep(1)
- if chestSide == 'Right' then
- print("tourne a droite")
- turtle.turnRight()
- else
- print("tourne a gauche")
- turtle.turnLeft()
- end
- print("aspire")
- turtle.suck()
- if chestSide == 'Right' then
- print("tourne a gauche")
- turtle.turnLeft()
- else
- print("tourne a droite")
- turtle.turnRight()
- end
- print("sleep 1")
- sleep(1)
- local k = find(1, "minecraft:coal")
- if k then
- turtle.select(k)
- end
- print("drop")
- turtle.drop()
- function waiting(i)
- if i ~= time or i < time then
- i = i + 1
- print("waiting "..i.."/"..time)
- sleep(1)
- waiting(i)
- end
- end
- waiting(0)
- turtle.dig()
- local p = find(1, "projecte:collector_mk3")
- if p then
- turtle.select(p)
- turtle.place()
- end
- end
- end
- function find(i , name)
- local i = i
- local name = name
- if i > 16 then
- return false
- end
- turtle.select(i)
- local data = turtle.getItemDetail()
- if data then
- if data.name == name then
- return i
- else
- i = i + 1
- return find(i, name)
- end
- else
- i = i + 1
- return find(i, name)
- end
- end
- local p = find(1, "projecte:collector_mk3")
- if p then
- print("mk3 solt "..p)
- turtle.select(p)
- turtle.place()
- else
- print("mk3 not fond")
- end
- checkPosition()
- print("startprogram bottom")
- StartProgram()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement