Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- size = 8
- function tablelength(T)
- local count = 0
- for _ in pairs(T) do count = count + 1 end
- return count
- end
- function refuel()
- for i = 1,16 do
- turtle.select(i)
- print(turtle.getFuelLevel())
- if turtle.getFuelLevel() < 200 then
- turtle.refuel(10)
- end
- end
- end
- intebajs = {'minecraft:diamond', 'minecraft:iron_ore', 'minecraft:gold_ore', 'minecraft:emerald', 'minecraft:obsidian', 'minecraft:coal'}
- function in_list (tab, val)
- for index, value in ipairs(tab) do
- if value == val then
- return true
- end
- end
- return false
- end
- function throw_shit()
- for i = 1,16 do
- turtle.select(i)
- sname = turtle.getItemDetail()
- if sname then
- print(in_list(intebajs,sname.name))
- if not in_list(intebajs,sname.name) then turtle.dropDown() end
- end
- end
- end
- function find(name)
- local d = {}
- for i = 1,16 do
- turtle.select(i)
- sname = turtle.getItemDetail()
- if sname then
- sname = sname.name
- if name == sname
- then
- d[tablelength(d)+1] = i end
- end
- end
- return d
- end
- function mine()
- turtle.dig()
- turtle.digUp()
- turtle.digDown()
- suc = turtle.forward()
- return suc
- end
- function walk (len)
- x = 0
- while x < len do
- if mine() then x = x + 1 end
- end
- end
- for i = 0,size do
- walk(size - i)
- refuel()
- turtle.turnRight()
- throw_shit()
- walk(size - i)
- turtle.turnRight()
- throw_shit()
- end
Add Comment
Please, Sign In to add comment