Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inv_spawn = peripheral.wrap("ender_chest_2")
- inv_res = peripheral.wrap("ender_chest_1")
- output = peripheral.wrap("ender_chest_3")
- local function rs_seq()
- inv_spawn.pushItem("north", diamond_pos, 4)
- inv_spawn.pushItem("north", quartz_pos, 12)
- inv_spawn.pushItem("north", glow_pos, 4)
- inv_spawn.pushItem("north", charged_pos, 4)
- inv_res.pushItem("north", res_pos, 1)
- os.sleep(10)
- rs.setOutput("left", true)
- os.sleep(0.75)
- rs.setOutput("left", false)
- os.sleep(0.75)
- rs.setOutput("left", true)
- os.sleep(0.75)
- rs.setOutput("left", false)
- end
- local function scan_inventory()
- inv_spawn.condenseItems()
- inv_res.condenseItems()
- diamond = false
- diamond_pos = 0
- quartz= false
- quartz_pos = 0
- glow = false
- glow_pos = 0
- charged = false
- charged_pos = 0
- res = false
- res_pos = 0
- for i = 1, inv_spawn.getInventorySize(), 1 do
- if inv_spawn.getStackInSlot(i) then
- print(inv_spawn.getStackInSlot(i).display_name)
- if inv_spawn.getStackInSlot(i).display_name == "Block of Diamond" then
- diamond = true
- diamond_pos = i
- end
- end
- end
- for i = 1, inv_spawn.getInventorySize(), 1 do
- if inv_spawn.getStackInSlot(i) then
- print(inv_spawn.getStackInSlot(i).display_name)
- if inv_spawn.getStackInSlot(i).display_name == "Pillar Quartz Block" then
- quartz = true
- quartz_pos = i
- end
- end
- end
- for i = 1, inv_spawn.getInventorySize(), 1 do
- if inv_spawn.getStackInSlot(i) then
- print(inv_spawn.getStackInSlot(i).display_name)
- if inv_spawn.getStackInSlot(i).display_name == "Glowstone" then
- glow = true
- glow_pos = i
- end
- end
- end
- for i = 1, inv_spawn.getInventorySize(), 1 do
- if inv_spawn.getStackInSlot(i) then
- print(inv_spawn.getStackInSlot(i).display_name)
- if inv_spawn.getStackInSlot(i).display_name == "Charged Draconium Block" then
- charged = true
- charged_pos = i
- end
- end
- end
- for i = 1, inv_res.getInventorySize(), 1 do
- if inv_res.getStackInSlot(i) then
- print(inv_spawn.getStackInSlot(i).display_name)
- if inv_res.getStackInSlot(i).display_name == "Resurrection Stone" then
- res = true
- res_pos = i
- end
- end
- end
- print(diamond)
- print(quartz)
- print(glow)
- print(charged)
- print(res)
- if diamond and quartz and glow and charged and res then
- IS_CRAFTING = true
- rs_seq()
- end
- end
- local function check_for_finish()
- for i = 1, output.getInventorySize(), 1 do
- if output.getStackInSlot(i) then
- if output.getStackInSlot(i).display_name == "Dragon Heart" then
- print("Found finished Dragon Heart.")
- output.pushItem("up", i, 1)
- IS_CRAFTING = false
- end
- end
- end
- end
- IS_CRAFTING = false
- print("Startin script...")
- while true do
- print("Crafting status: " .. tostring(IS_CRAFTING))
- if IS_CRAFTING then
- print("Checking for finished Dragon Heart....")
- check_for_finish()
- else
- print("Checking for available spawning materials...")
- scan_inventory()
- end
- os.sleep(10)
- end
Add Comment
Please, Sign In to add comment