Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Global Declares --
- component = require("component")
- transpose = component.transposer
- term = require("term")
- rs = component.redstone
- gpu = component.gpu
- colors = require("colors")
- sides = require("sides")
- -- Variables --
- -- You can change these as needed
- BloodAltarTier = 1 -- Change manually depending on your Altar level, Default: 5 (Tier: V)
- slateBCount = 16 -- Blank Slates, Default: 8
- slateRCount = 8 -- Reinforced Slates, Default: 8
- slateICount = 8 -- Imbued Slates, Default: 4
- slateDCount = 8 -- Demonic Slates, Default: 4
- slateECount = 2 -- Etherial Slates, Default: 1
- chestSide = sides.top -- Default: sides.top (1)
- stoneSide = sides.north -- Default: 2 (Back)
- altarSide = sides.west --Default: 4 (Right)
- reserveTankSide = sides.east --Default: 5 (Left), this is only used if a tank is detected
- rsInputSide = sides.bottom --Default: 4 (Right), This is right of a computer with a Redstone card or right of a Redstone I/O block
- stoneSlot = 2 --Default: 10 (Slot 10 is the first export slot for a Refined Storage Interface, Change this as needed)
- -- Altar slots do not need to be changed, unless WayOfTime add additional inventory slots or tanks to the Blood Altar
- altarSlot = 1
- altarTank = 1
- -- Slate Slots below are the first 5 slots of a chest, change these if you are not using any type of regular chest (NOT tested with other mods like Iron Chests)
- slateBSlot = 1
- slateRSlot = 2
- slateISlot = 3
- slateDSlot = 4
- slateESlot = 5
- stackInfo = {}
- itemInfo = {
- {
- name = "Blank Slate",
- blood = 1000,
- tier = 1
- },
- {
- name = "Reinforced Slate",
- blood = 2000,
- tier = 2
- },
- {
- name = "Imbued Slate",
- blood = 5000,
- tier = 3
- },
- {
- name = "Demonic Slate",
- blood = 15000,
- tier = 4
- },
- {
- name = "Ethereal Slate",
- blood = 30000,
- tier = 5
- }
- }
- slateSlot = {
- [1] = slateBSlot,
- [2] = slateRSlot,
- [3] = slateISlot,
- [4] = slateDSlot,
- [5] = slateESlot,
- }
- function setNull(i)
- stackInfo[i].label = itemInfo[i].name
- stackInfo[i].size = 0
- end
- function setStackInfo()
- for i=1, 5 do
- stackInfo[i] = {}
- if transpose.getStackInSlot(chestSide, slateSlot[i]) then
- stackInfo[i].size = transpose.getStackInSlot(chestSide, slateSlot[i]).size
- stackInfo[i].label = transpose.getStackInSlot(chestSide, slateSlot[i]).label
- else
- setNull(i)
- end
- end
- end
- function getTankInfo()
- tInfo = transpose.getFluidInTank(altarSide)
- tankAmount = tInfo[1].amount
- tankCapacity = tInfo[1].capacity
- tankPercent = (tankAmount / tankCapacity) * 100
- if term.isAvailable() then
- term.clearLine()
- term.write(string.format("Current Blood Level: %.2f %%, %.0d mb / %.0d mb\n", tankPercent, tankAmount, tankCapacity))
- end
- end
- function getReserveTankInfo()
- rTInfo = transpose.getFluidInTank(reserveTankSide)
- if rTInfo.n > 0 then
- rTankAmount = rTInfo[1].amount
- rTankCapacity = rTInfo[1].capacity
- rTPercent = (rTankAmount / rTankCapacity) * 100
- if term.isAvailable() then
- term.clearLine()
- term.write(string.format("Reserve Blood Level: %.2f %%, %.0d mb / %.0d mb\n", rTPercent, rTankAmount, rTankCapacity))
- end
- else
- if term.isAvailable() then
- term.write("No Reserve Tank Detected\n")
- end
- end
- end
- function WriteRSBlood()
- if term.isAvailable() then
- term.clearLine()
- term.write("Blood Creation: ")
- if rs.getInput(rsInputSide) == 0 then
- term.write("True \n")
- else
- term.write("False\n")
- end
- end
- end
- function BlankSlate()
- local crafting = true
- --Move 1 stone from Interface to Blood Altar
- transpose.transferItem(stoneSide, altarSide, 1, stoneSlot, altarSlot)
- while crafting do
- writeToTerm()
- term.write(itemInfo[1].name.."\n")
- if transpose.getStackInSlot(altarSide, altarSlot).label == itemInfo[1].name then
- crafting = false
- --Move 1 Blank Slate from Blood Altar to Chest
- transpose.transferItem(altarSide, chestSide, 1, altarSlot, slateBSlot)
- end
- end
- end
- function ReinforcedSlate()
- local crafting = true
- --Move 1 Blank Slate from Chest to Blood Altar
- transpose.transferItem(chestSide, altarSide, 1, slateBSlot, altarSlot)
- while crafting do
- writeToTerm()
- term.write(itemInfo[2].name.."\n")
- if transpose.getStackInSlot(altarSide, altarSlot).label == itemInfo[2].name then
- crafting = false
- --Move 1 Reinforced Slate from Blood Altar to Chest
- transpose.transferItem(altarSide, chestSide, 1, altarSlot, slateRSlot)
- end
- end
- end
- function ImbuedSlate()
- local crafting = true
- --Move 1 Reinforced Slate from Chest to Blood Altar
- transpose.transferItem(chestSide, altarSide, 1, slateRSlot, altarSlot)
- while crafting do
- writeToTerm()
- term.write(itemInfo[3].name.."\n")
- if transpose.getStackInSlot(altarSide, altarSlot).label == itemInfo[3].name then
- crafting = false
- --Move 1 Imbued Slate from Blood Altar to Chest
- transpose.transferItem(altarSide, chestSide, 1, altarSlot, slateISlot)
- end
- end
- end
- function DemonicSlate()
- local crafting = true
- --Move 1 Imbued Slate from Chest to Blood Altar
- transpose.transferItem(chestSide, altarSide, 1, slateISlot, altarSlot)
- while crafting do
- writeToTerm()
- term.write(itemInfo[4].name.."\n")
- if transpose.getStackInSlot(altarSide, altarSlot).label == itemInfo[4].name then
- crafting = false
- --Move 1 Demonic Slate from Blood Altar to Chest
- transpose.transferItem(altarSide, chestSide, 1, altarSlot, slateDSlot)
- end
- end
- end
- function EtherealSlate()
- local crafting = true
- --move 1 Demonic Slate from chest to Blood Altar
- transpose.transferItem(chestSide, altarSide, 1, slateDSlot, altarSlot)
- while crafting do
- if transpose.getStackInSlot(altarSide, altarSlot).label == itemInfo[5].name then
- crafting = false
- --Move 1 Ethereal Slate from Blood Altar to Chest
- transpose.transferItem(altarSide, chestSide, 1, altarSlot, slateESlot)
- end
- end
- end
- function writeToTerm()
- term.setCursor(1,1)
- getTankInfo()
- getReserveTankInfo()
- WriteRSBlood()
- term.clearLine()
- term.write("Making: ")
- end
- term.clear()
- repeat
- setStackInfo()
- writeToTerm(" ")
- currentTank = transpose.getFluidInTank(altarSide, altarTank).amount
- if BloodAltarTier >= itemInfo[1].tier and stackInfo[1].label == itemInfo[1].name and stackInfo[1].size < slateBCount and currentTank >= itemInfo[1].blood then
- BlankSlate()
- elseif BloodAltarTier >= itemInfo[2].tier and stackInfo[2].label == itemInfo[2].name and stackInfo[2].size < slateRCount and currentTank >= itemInfo[2].blood then
- ReinforcedSlate()
- elseif BloodAltarTier >= itemInfo[3].tier and stackInfo[3].label == itemInfo[3].name and stackInfo[3].size < slateICount and currentTank >= itemInfo[3].blood then
- ImbuedSlate()
- elseif BloodAltarTier >= itemInfo[4].tier and stackInfo[4].label == itemInfo[4].name and stackInfo[4].size < slateDCount and currentTank >= itemInfo[4].blood then
- DemonicSlate()
- elseif BloodAltarTier >= itemInfo[5].tier and stackInfo[5].label == itemInfo[5].name and stackInfo[5].size < slateECount and currentTank >= itemInfo[5].blood then
- EtherealSlate()
- end
- until event.pull(1) == "interrupted"
Add Comment
Please, Sign In to add comment