Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local sides = require("sides")
- local term = require("term")
- local clearint = 10
- local n = 0
- local cc= clearint
- local gpu = component.gpu
- local max = 32
- local nn=0
- local a = {}
- local b = {}
- local bb = {}
- local rs = component.block_refinedstorage_interface
- term.clear()
- local items = {
- {store=64 ,name = "minecraft:diamond", damage=0, label = "Diamond"},
- {store=128 ,name = "minecraft:ender_pearl", damage=0, label = "Ender Pearl"},
- {store=64 ,name = "enderio:item_alloy_ingot", damage=1, label = "Energetic Alloy"},
- {store=64 ,name = "thermalfoundation:material",damage=162,label = "Invar Ingot"},
- {store=64 ,name = "minecraft:iron_ingot", damage=0, label = "Iron Ingot"},
- {store=64 ,name = "minecraft:gold_ingot", damage=0, label = "Gold Ingot"},
- {store=256 ,name = "tconstruct:edible", damage=10, label = "Monster Jerky"},
- {store=64 ,name = "enderio:item_alloy_ingot", damage=5, label = "Pulsating Iron"},
- {store=1024,name = "minecraft:stonebrick", damage=0, label = "Stone Brick"},
- {store=64 ,name = "enderio:item_alloy_ingot", damage=2, label = "Vibrant Alloy"}
- }
- while(true) do
- local count = #rs.getTasks()
- for i,stack in ipairs(items) do
- if(rs.hasPattern(stack)) then
- local rsStack = rs.getItem(stack)
- local toCraft = stack.store;
- if(rsStack ~= nil) then
- toCraft = toCraft - rsStack.size
- end
- if(toCraft > 0) then
- n = n + 1
- if(n >= clearint) then
- n = 0
- --term.clear()
- end
- local data = "Trying to craft "..toCraft.." more "..stack.label
- if(count == 0) then
- if(toCraft >= max) then
- rs.scheduleTask(stack, max)
- else
- rs.scheduleTask(stack, toCraft)
- end
- end
- end
- else
- --print("Missing pattern for: " .. stack.label)
- end
- if(c ~= n) then
- c = n
- if((clearint-n) <= 3) then
- --print("clearing in " .. (clearint-n).." more interations")
- end
- end
- for t,datad in ipairs(items) do
- a[t] = datad.label
- bb[t] = (datad.store-rs.getItem(datad).size)
- if(bb[t] < 0) then
- b[t] = "Over by "..(-bb[t])
- elseif(bb[t]>t) then
- b[t] = "Under by "..bb[t]
- else
- b[t] = "At"
- end
- if(#a[t] > nn) then
- nn = #a[t]+1
- end
- gpu.set(1,t,a[t]..string.rep(" ",nn-#a[t]).."|"..b[t]..string.rep(" ",30-#b[t]))
- end
- end
- os.sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement