Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function up(x)
- for i=1,x do
- while not turtle.up() do
- turtle.digUp()
- turtle.attackUp()
- end
- end
- end
- function forward(x)
- for i=1,x do
- while not turtle.forward() do
- turtle.dig()
- turtle.attack()
- end
- end
- end
- function back(x)
- for i=1,x do
- while not turtle.back() do
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.dig()
- turtle.attack()
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- end
- function down(x)
- for i=1,x do
- while not turtle.down() do
- turtle.digDown()
- turtle.attackDown()
- end
- end
- end
- function place(x)
- for i=1,x do
- blocks()
- back(1)
- turtle.place()
- end
- end
- function dplace(x)
- for i=1,x do
- pDown(1)
- blocks()
- turtle.place()
- end
- end
- function pDown(x)
- for i=1,x do
- blocks()
- while not turtle.placeDown() do
- turtle.digDown()
- turtle.attackDown()
- end
- back(1)
- end
- end
- function blocks()
- turtle.select(1)
- if turtle.getItemCount(1)<1 then
- if turtle.detectUp() then
- turtle.digUp()
- turtle.select(1)
- turtle.drop()
- end
- turtle.select(16)
- turtle.placeUp()
- turtle.select(1)
- turtle.suckUp()
- turtle.select(16)
- turtle.digUp()
- turtle.select(1)
- end
- end
- function pUp(x)
- for i=1,x do
- blocks()
- while not turtle.placeUp() do
- turtle.attackUp()
- turtle.digUp()
- end
- back(1)
- end
- end
- function tplace(x)
- for i=1,x do
- blocks()
- turtle.placeUp()
- dplace(1)
- end
- end
- -------MobDrop------
- function floor()
- up(1)
- for i=1,5 do
- pDown(11)
- for i=1,2 do
- turtle.turnRight()
- back(1)
- end
- pDown(11)
- for i=1,2 do
- turtle.turnLeft()
- back(1)
- end
- end
- pDown(11)
- end
- function walls(x)
- forward(1)
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,x do
- for i=1,3 do
- place(10)
- turtle.turnRight()
- end
- place(9)
- up(1)
- pDown(1)
- turtle.turnRight()
- end
- end
- function MobDrop()
- turtle.turnLeft()
- turtle.turnLeft()
- floor()
- walls(30)
- floor()
- end
- ---TradeVillage----
- function floor1()
- forward(1)
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,4 do
- back(2)
- for i=1,4 do
- pDown(1)
- back(1)
- pDown(1)
- back(3)
- end
- pDown(1)
- back(1)
- pDown(1)
- back(1)
- turtle.turnRight()
- end
- back(1)
- turtle.turnRight()
- back(1)
- for i=1,14 do
- pDown(29)
- turtle.turnLeft()
- back(1)
- turtle.turnLeft()
- back(1)
- pDown(29)
- turtle.turnRight()
- back(1)
- turtle.turnRight()
- back(1)
- end
- pDown(29)
- end
- function walls1()
- for i=1,4 do
- dplace(1)
- for i=1,4 do
- turtle.turnLeft()
- back(1)
- turtle.turnRight()
- dplace(3)
- turtle.turnRight()
- back(1)
- turtle.turnLeft()
- dplace(3)
- end
- turtle.turnLeft()
- back(1)
- turtle.turnRight()
- dplace(3)
- turtle.turnRight()
- back(1)
- dplace(1)
- turtle.turnLeft()
- back(1)
- turtle.turnRight()
- end
- end
- function floor2()
- up(1)
- pDown(29)
- turtle.turnRight()
- back(1)
- turtle.turnRight()
- for i=1,14 do
- pDown(31)
- turtle.turnLeft()
- back(1)
- turtle.turnLeft()
- back(1)
- pDown(31)
- turtle.turnRight()
- back(1)
- turtle.turnRight()
- back(1)
- end
- pDown(31)
- turtle.turnLeft()
- back(1)
- turtle.turnLeft()
- back(2)
- pDown(29)
- end
- function walls3()
- turtle.turnLeft()
- back(2)
- turtle.turnRight()
- back(1)
- for i=1,4 do
- dplace(27)
- back(2)
- turtle.turnRight()
- back(3)
- end
- turtle.turnRight()
- place(1)
- forward(1)
- for i=1,4 do
- dplace(1)
- pUp(27)
- dplace(1)
- turtle.turnRight()
- back(1)
- end
- turtle.turnRight()
- place(1)
- turtle.turnLeft()
- for i=1,4 do
- dplace(1)
- pUp(27)
- turtle.turnRight()
- dplace(1)
- end
- end
- function walls2()
- for i=1,4 do
- for i =1,4 do
- tplace(3)
- pUP(3)
- end
- tplace(3)
- back(2)
- turtle.turnRight()
- back(3)
- end
- turtle.turnRight()
- place(1)
- turtle.turnLeft()
- forward(1)
- for i=1,4 do
- tplace(2)
- for i=1,4 do
- pUp(1)
- tplace(5)
- end
- pUp(1)
- tplace(2)
- turtle.turnRight()
- back(1)
- end
- turtle.turnRight()
- place(1)
- turtle.turnLeft()
- for i=1,4 do
- tplace(2)
- for i=1,4 do
- pUp(1)
- tplace(5)
- end
- pUp(1)
- tplace(1)
- turtle.turnRight()
- end
- for i=1,2 do
- up(1)
- blocks()
- turtle.placeDown()
- end
- up(1)
- end
- function TradeVillage()
- floor1()
- up(1)
- turtle.turnRight()
- walls1()
- up(1)
- turtle.placeDown()
- up(1)
- walls1()
- floor2()
- up(1)
- turtle.turnLeft()
- forward(1)
- turtle.turnLeft()
- back(2)
- walls2()
- floor3()
- end
- ------Main Program------
- local info
- term.write("MobDrop(1) or TradeVillage(2): ")
- info = tonumber(read())
- print(info)
- if info == 1 then
- print("Building MobDrop")
- MobDrop()
- elseif info == 2 then
- print("Building TradeVillage")
- TradeVillage()
- else
- print("Error not valid build")
- end
Advertisement
Add Comment
Please, Sign In to add comment