Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x,y,z=1,1,0
- dir=0
- smeltables={
- "minecraft:iron_ore",
- "minecraft:gold_ore",
- "thermalfoundation:ore",
- "railcraft:ore_metal",
- "railcraft:ore_metal_poor"
- }
- furnaces=5
- function Forward()
- while not turtle.forward() do end
- if (dir%2)==0 then y=y-1+(dir%4)
- else x=x+2-(dir%4)
- end
- end
- function Up()
- while not turtle.up() do end
- z=z+1
- end
- function Down()
- while not turtle.down() do end
- z=z-1
- end
- function Right()
- turtle.turnRight()
- dir=(dir+1)%4
- end
- function Left()
- turtle.turnLeft()
- dir=(dir-1)%4
- end
- function CheckSmeltable(num)
- local data=turtle.getItemDetail(num)
- if data then
- for i=1,#smeltables do
- if data.name==smeltables[i] then return true end
- end
- end
- return false
- end
- function MoveToFurnace()
- Right() Right() Forward() Left()
- local tries=0
- while not turtle.dropDown() and tries<furnaces-1 do
- Forward()
- tries=tries+1
- end
- Right() Right()
- for i=1,tries do Forward() end
- Right() Forward()
- end
- function MoveToChest()
- Right() Forward()
- local data=turtle.getItemDetail()
- if data and data.name=="minecraft:cobblestone" then
- Left()
- turtle.drop()
- Left() Forward() Right()
- else
- local tries=0
- while not turtle.drop() do
- Up()
- tries=tries+1
- end
- for i=1,tries do Down() end
- Right() Right() Forward() Right()
- end
- end
- while true do
- while turtle.suckDown() do end
- for i=1,16 do
- turtle.select(i)
- if turtle.getItemCount(i)>0 then
- if CheckSmeltable(i) then MoveToFurnace()
- else MoveToChest()
- end
- end
- end
- turtle.select(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement