Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Minecraft Wither Boss Builder (left to right).
- -- Requires:
- -- 5x5x5 area
- -- chest (Place the chest next(Left side) the turtle)
- -- Slot 1, Soul Sand
- -- Slot 2, Wither Skeleton Skull (if you wanna test it first ,use a regular Skeleton Skull instead )
- -- Slot 3, Coal
- local td ={ name = {"minecraft:soul_sand","minecraft:skull","minecraft:coal"}, min = {5,3,1} }
- local chestSide =0
- function NeedFuel()
- if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < 1 then
- turtle.select(3)
- if turtle.refuel() then
- print("Fuel level is: ", ( turtle.getFuelLevel() / turtle.getFuelLimit() ) * 100, "%")
- else
- print("Can't refuel ,Place some Coal in the 1st Slot")
- end
- else print("Fuel level is: ", ( turtle.getFuelLevel() / turtle.getFuelLimit() ) * 100, "%","We can still move", turtle.getFuelLevel(), "blocks")
- end
- end
- function findchest()
- local ChestEx
- local EnderChestEx
- for i=1 , 4 do
- local success, data = turtle.inspect()
- if success then
- ChestEx= string.find(data.name, "chest")
- EnderChestEx= string.find(data.name, "Chest")
- if ChestEx or EnderChestEx then
- for i=1 , 3 do
- turtle.select(i)
- turtle.drop()
- end
- chestSide=i
- getItems()
- return true
- else
- turtle.turnRight()
- end
- else
- turtle.turnRight()
- end
- end
- --shell.run("clear")
- print("Place the chest next(L) the turtle then add at last soul sand(5),skulls(3),coal(1) into it")
- return false
- end
- function SortItem(s)
- ItemDatastack=turtle.getItemDetail(s)
- if ItemDatastack then
- turtle.select(s)
- if (ItemDatastack.name==td.name[1] ) then
- turtle.transferTo(1)
- elseif (ItemDatastack.name==td.name[2]) then
- turtle.transferTo(2)
- elseif (ItemDatastack.name==td.name[3]) then
- turtle.transferTo(3)
- else
- turtle.drop()
- end
- end
- end
- function getItems()
- turtle.select(4)
- while true do
- local Item = turtle.suck()
- if not Item then
- for i=1 , 16 do
- SortItem(i)
- end
- return false
- end
- -- for i=4 , 16 do
- -- turtle.select(i)
- -- turtle.drop()
- -- end
- end
- end
- function CountItem()
- local count =true
- local ItemDatastack={}
- for i=1 , 2 do
- turtle.select(i)
- ItemDatastack=turtle.getItemDetail(i)
- if ItemDatastack then
- if (ItemDatastack.count<td.min[i]) then
- print("---------------------------------------")
- print("add more: ",string.sub(ItemDatastack.name, 11))
- print("---------------------------------------")
- count=false
- end
- else
- print("---------------------------------------")
- print("add : ",string.sub(td.name[i], 11)," to chest")
- print("---------------------------------------")
- count=false
- end
- end
- if not count then
- return false
- else
- return true
- end
- turtle.select(1)
- end
- function PreBuild()
- for i=4 , 16 do
- turtle.select(i)
- turtle.drop()
- end
- for i=1, chestSide+1 do
- turtle.turnRight()
- end
- end
- function BuildWither()
- turtle.forward()
- turtle.up()
- turtle.select(1)
- turtle.place()
- PlaceWitherHead()
- MoveToNext()
- PlaceWitherHead()
- turtle.down()
- turtle.place()
- turtle.up()
- MoveToNext()
- PlaceWitherHead()
- end
- function MoveToNext()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.place()
- end
- function PlaceWitherHead()
- turtle.select(2)
- turtle.up()
- turtle.place()
- turtle.down()
- turtle.select(1)
- end
- function BackToFirst()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.down()
- turtle.back()
- end
- if findchest() then
- PreBuild()
- while CountItem() do
- NeedFuel()
- BuildWither()
- BackToFirst()
- sleep(15)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement