Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- textdata = args[1]
- slot = 1
- blocks = 0
- function placer(...)
- while turtle.getItemCount(slot) == 0 do
- slot = slot + 1
- if slot == 16 then
- turtle.select(slot)
- turtle.placeUp()
- for i = 1, 15 do
- turtle.suckUp()
- end
- turtle.digUp()
- slot = 1
- end
- turtle.select(slot)
- end
- turtle.placeDown()
- end
- for i=1,textdata:len() do
- if string.sub(textdata, i, i) == "p" then
- blocks = blocks + 1
- end
- end
- print("Use "..tostring(blocks).." blocks.")
- print("That is "..tostring((blocks - blocks % 64) / 64).." stacks and "..tostring(blocks % 64).." blocks.")
- for i=1,textdata:len() do
- if string.sub(textdata, i, i) == "f" then
- while not turtle.forward() do
- turtle.dig()
- turtle.attack()
- end
- elseif string.sub(textdata, i, i) == "r" then
- turtle.turnRight()
- elseif string.sub(textdata, i, i) == "l" then
- turtle.turnLeft()
- elseif string.sub(textdata, i, i) == "b" then
- turtle.back()
- elseif string.sub(textdata, i, i) == "p" then
- placer()
- elseif string.sub(textdata, i, i) == "u" then
- while not turtle.up() do
- turtle.digUp()
- turtle.attackUp()
- end
- elseif string.sub(textdata, i, i) == "d" then
- while not turtle.down() do
- turtle.digDown()
- turtle.attackDown()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement