Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------Written by Barnet-----------
- function CheckSlot(Material)
- if turtle.getItemCount() ~= 0 then
- if turtle.getItemDetail().name == Material then
- return true
- else
- return false
- end
- else
- return false
- end
- end
- function Refill(Material)
- if CheckSlot(Material) == false then
- x = 1
- while x<17 do
- turtle.select(x)
- x=x+1
- if CheckSlot(Material) == true then
- x=17
- elseif x == 17 then
- turtle.select(1)
- print("Missing Material")
- error()
- end
- end
- end
- end
- function PlaceDown(Material)
- Refill(Material)
- if turtle.detectDown() == true and turtle.compareDown() == false then
- turtle.digDown()
- end
- turtle.placeDown()
- end
- function Forward()
- while turtle.forward() == false do
- if turtle.detect() == true then
- turtle.dig()
- else
- turtle.attack()
- end
- end
- end
- function BuildForward(a,Material)
- y=1
- while y<a do
- PlaceDown(Material)
- Forward()
- y=y+1
- end
- end
- function BuildRight(Material)
- PlaceDown(Material)
- turtle.turnRight()
- Forward()
- turtle.turnRight()
- end
- function BuildLeft(Material)
- PlaceDown(Material)
- turtle.turnLeft()
- Forward()
- turtle.turnLeft()
- end
- function BuildPlane(a,b,Material)
- c=0
- while c<b/2 do
- BuildForward(a,Material)
- BuildRight(Material)
- BuildForward(a,Material)
- BuildLeft(Material)
- c=c+1
- end
- end
- print()
- print("Build a Plane")
- print("---------------------------------------")
- write("Length: ")
- a = tonumber(read())
- write("Width: ")
- b = tonumber(read())
- write("Material: ")
- Material = read()
- print("Building Plane...")
- BuildPlane(a,b,Material)
- print("Done!")
Add Comment
Please, Sign In to add comment