Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- TO INSTALL JUST EXECUTE: pastebin get GscK4883 netherstar.lua
- local component = require("component")
- local robot = require("robot")
- local shell = require("shell")
- local sides = require("sides")
- local chests = component.inventory_controller
- local sandChestPlace = sides.bottom
- local scullChestPlace = sides.up
- local sandSlot = 1
- local skullSlot = 2
- local function getItems()
- -- for i=1,tonumber(chest.getInventorySize(sides.bottom)) do
- -- if chest.getStackInSlot(chestPlace, i) then
- -- if chest.getStackInSlot(chestPlace, i).label == "Soul Sand" then
- -- print("suck Soul Sand from chest")
- -- chest.suckFromSlot(chestPlace, i)
- -- sandSlot = i
- -- elseif chest.getStackInSlot(chestPlace, i).label == "Wither Skeleton Skull" then
- -- print("suck Wither Skelleton Skull from chest")
- -- chest.suckFromSlot(chestPlace, i)
- -- skullSlot = i
- -- end
- -- end
- -- end
- if tonumber(chests.getSlotStackSize(sandChestPlace, 1)) >= 64 and tonumber(chests.getSlotStackSize(scullChestPlace, 1)) >= 48 then
- robot.select(sandSlot)
- chests.suckFromSlot(sandChestPlace, 1, 64)
- robot.select(skullSlot)
- chests.suckFromSlot(scullChestPlace, 1, 48)
- return true
- else
- return false
- end
- end
- local function moveToBuild()
- for i=1,3 do robot.back() end
- robot.turnRight()
- for i=1,2 do robot.forward() end
- for i=1,2 do robot.down() end
- end
- local function buildWither()
- robot.select(sandSlot)
- robot.place()
- robot.up()
- robot.place()
- robot.turnRight()
- robot.forward()
- robot.turnLeft()
- robot.place()
- robot.turnLeft()
- for i=1,2 do robot.forward() end
- robot.turnRight()
- robot.place()
- robot.up()
- robot.select(skullSlot)
- robot.place()
- robot.turnRight()
- for i=1,2 do robot.forward() end
- robot.turnLeft()
- robot.place()
- robot.turnRight()
- robot.back()
- robot.turnLeft()
- robot.place()
- end
- local function moveToChest()
- for i=1,2 do robot.back() end
- robot.turnLeft()
- for i=1,3 do robot.forward() end
- end
- -- RUNTIME STARTS HERE
- while true do
- if getItems() == true then
- for j=1, 16 do
- moveToBuild()
- buildWither()
- moveToChest()
- os.sleep(15)
- end
- else
- os.sleep(60)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement