Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variables
- version = 0.1
- skullData = {name = "skull", dmg = 1, min = 3}
- soulSandData = {name = "soul_sand", dmg = 0, min = 4}
- attackDmg = 300
- --Peripherals
- t = peripheral.find("tile_computercraft_turtle_name")
- --Setup
- rs.setOutput("bottom", false)
- --Functions
- function findItem(itemInfo)
- slot = nil
- done = false
- i = 1
- while i <= 16 do
- slotInfo = turtle.getItemCount()
- if (type(slotInfo) == "table") and (slotInfo.name == itemInfo.name) and (slotInfo.dmg == itemInfo.dmg) and (slotInfo.qty >= itemInfo.min) then
- slot = i
- i = 17
- end
- i = i + 1
- end
- if slot ~= nil then
- return slot
- end
- end
- function placeWither(skullSlot, soulSandSlot)
- turtle.select(soulSandSlot)
- turtle.forward()
- turtle.placeDown()
- turtle.turnLeft()
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- turtle.place()
- turtle.turnLeft()
- turtle.up()
- turtle.placeDown()
- turtle.select(skullSlot)
- turtle.turnLeft()
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- turtle.place()
- turtle.turnLeft()
- turtle.back()
- turtle.place()
- turtle.down()
- end
- --Body
- while true do
- --[[term.clear()
- term.setCursorPos(1, 1)
- ready = true
- skullSlot = findItem(skullData)
- print(skullSlot)
- soulSandSlot = findItem(soulSandData)
- print(soulSandSlot)
- if skullSlot == false then
- term.setCursorPos(1, 2)
- print("Out of Wither Skulls")
- sleep(10)
- ready = false
- end
- if soulSandSlot == false then
- term.setCursorPos(1, 3)
- print("Out of Soul Sand")
- sleep(10)
- ready = false
- end
- if ready == false then
- rs.setOutput("bottom", true)
- else
- rs.setOutput("bottom", false)
- placeWither(skullSlot, soulSandSlot)
- sleep(60)
- end]]--
- placeWither(1, 2)
- sleep(60)
- for i = 0, (attackDmg / 7) do
- turtle.attack()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement