Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ME_ = component.me_controller
- IT_ = ME_.getItemsInNetwork
- CR_ = ME_.getCraftables
- Q_=require("qlib")
- local X = {}
- function siftItems(s, v)
- v = v or true
- local t = IT_()
- local r = {}
- local ri, ti, e, l
- ri, ti = 1, 1
- while t[ti] ~= nil do
- e = t[ti]
- l = e.label
- if string.find(string.lower(l), s) ~= nil then
- r[ri] = {ri, ti, l, e.size}
- ri = ri + 1
- end
- ti = ti + 1
- end
- if v then Q_.aprint(r) end
- return r
- end
- X.siftItems = siftItems
- function siftCraftables(s, v)
- v = v or true
- local t = CR_()
- local r = {}
- local ri, ti, e, l
- ri, ti = 1, 1
- while t[ti] ~= nil do
- e = t[ti].getItemStack()
- l = e.label
- if string.find(string.lower(l), s) ~= nil then
- r[ri] = {ri, ti, l, e.size}
- ri = ri + 1
- end
- ti = ti + 1
- end
- if v then Q_.aprint(r) end
- return r
- end
- X.siftCraftables = siftCraftables
- return X
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement