Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local y=0
- -- local tblStairs={"minecraft:cobblestone_stairs", "minecraft:stone_stairs", "extcaves:lavastone_stairs", "extcaves:polished_lavastone_stairs"} not working because if stairs direction!
- local tblBlocks={"minecraft:cobblestone", "minecraft:dirt", "minecraft:netherrack", "extcaves:lavastone", "minecraft:basalt", "minecraft:blackstone", "create:weathered_limestone", "quark:deepslate", "quark:cobbled_deepslate", "minecraft:deepslate", "minecraft:cobbled_deepslate", "minecraft:tuff", "byg:soapstone", "byg:scoria_stone", "byg:scoria_cobblestone"}
- function inTable(tbl, item)
- for i, v in ipairs(tbl) do
- if v == item then
- return true
- end
- end
- return false
- end
- function moveForw()
- local try=1
- while not turtle.forward() do
- print("I can't go forward .. try:"..try)
- sleep(1)
- try=try+1
- end
- end
- function moveUp()
- local try=1
- while not turtle.up() do
- print("I can't go up .. try:"..try)
- sleep(1)
- try=try+1
- end
- end
- function moveDown()
- local try=1
- while not turtle.down() do
- print("I can't go down .. try:"..try)
- sleep(1)
- try=try+1
- end
- y=y+1
- end
- function turnL()
- turtle.turnLeft()
- end
- function digForw()
- while turtle.detect() do
- turtle.dig()
- end
- end
- function digUp()
- while turtle.detectUp() do
- turtle.digUp()
- end
- end
- function digDown()
- turtle.digDown()
- end
- function selectStairs()
- for A=1,16 do
- local item=turtle.getItemDetail(A)
- if item then
- if (inTable(tblBlocks, item.name)) then
- turtle.select(A)
- return(1)
- end
- end
- if A==16 then
- return(0)
- end
- end
- end
- function placeStairs()
- if not turtle.detectDown() then
- A=selectStairs()
- if A==1 then
- local try=1
- while not turtle.placeDown() do
- print("I can't place down. a block !..Try: "..try)
- try=try+1
- sleep(1)
- end
- end
- end
- end
- function startBuilding()
- while true do
- success, data = turtle.inspectDown()
- if (data.name=="minecraft:bedrock") then break end
- digDown()
- placeStairs()
- success, data = turtle.inspect()
- if (data.name=="minecraft:bedrock") then break end
- digForw()
- moveForw()
- digUp()
- success, data = turtle.inspectDown()
- if (data.name=="minecraft:bedrock") then break end
- digDown()
- moveDown()
- end
- end
- function goback()
- turnL()
- turnL()
- digUp()
- moveUp()
- digUp()
- moveUp()
- for A=1,y-2 do
- digUp()
- moveUp()
- digUp()
- moveForw()
- end
- moveForw()
- digUp()
- moveForw()
- end
- startBuilding()
- goback()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement