Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Tier = 1
- Blank = 32
- Reinforced = 16
- Imbued = 8
- Demonic = 4
- Ethereal = 2
- --Turtle must be below the Altar Block
- --Inventory must be below the Turtle
- --|Chest, Interface, etc|
- --Redstone input on the rear toggles
- --automation
- --Outputs redstone on the front 1000LP
- --below max for Well of Suffering
- altar = peripheral.wrap("top")
- chest = peripheral.wrap("bottom")
- function getTotalCount(item)
- a=0
- for i=1, chest.getInventorySize() do
- if chest.getStackInSlot(i) ~= nil then
- if (chest.getStackInSlot(i).display_name == item) then
- a = a + chest.getStackInSlot(i).qty
- end
- end
- end
- return a
- end
- function getSlotWithItem(item)
- for i=1, chest.getInventorySize() do
- if chest.getStackInSlot(i) ~= nil then
- if (chest.getStackInSlot(i).display_name == item) then
- if (chest.getStackInSlot(i).qty >0) then
- return i
- end
- end
- end
- end
- end
- function createSlate(initem, outitem, lifeamount)
- if altar.getInfo().contents.amount >= lifeamount then
- print(altar.getInfo().contents.amount)
- chest.pushItem("UP",getSlotWithItem(initem),1,1)
- altar.pullItem("DOWN",1,1,1)
- while not(altar.getStackInSlot(1).display_name==outitem) do
- sleep(.2)
- end
- altar.pushItem("DOWN",1,1,1)
- chest.pullItem("UP",1,1)
- end
- end
- if altar.getStackInSlot(1)==nil then
- while true do
- sleep(1)
- if altar.getInfo().contents.amount >= (altar.getInfo().capacity-1000) then redstone.setOutput("front",true) else redstone.setOutput("front",false) end
- if redstone.getInput("back") == false then
- if altar.getStackInSlot(1)==nil then
- if getTotalCount("Blank Slate") < Blank then
- createSlate("Stone", "Blank Slate", 1000)
- elseif getTotalCount("Reinforced Slate") < Reinforced then if Tier > 1 then
- createSlate("Blank Slate", "Reinforced Slate", 2000)
- end
- elseif getTotalCount("Imbued Slate") < Imbued then if Tier > 2 then
- createSlate("Reinforced Slate", "Imbued Slate", 5000)
- end
- elseif getTotalCount("Demonic Slate") < Demonic then if Tier > 3 then
- createSlate("Imbued Slate", "Demonic Slate", 15000)
- end
- elseif getTotalCount("Ethereal Slate") < Ethereal then if Tier > 4 then
- createSlate("Demonic Slate", "Ethereal Slate", 30000)
- end
- else do sleep(8) end
- end
- end
- end
- end
- else
- altar.pushItem("DOWN",1,1,1)
- chest.pullItem("UP",1,1)
- end
Add Comment
Please, Sign In to add comment