Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tArgs = {...}
- --Receive Container
- cont = "minecraft:ender chest_11"
- --Virtual Inv Container
- contl = "inv/"
- con = fs.list(contl)
- --placeholder
- st = ""
- --Seperate string by char Return table
- function mysplit (inputstr, sep)
- if sep == nil then
- sep = "%s"
- end
- local t={}
- for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
- table.insert(t, str)
- end
- return t
- end
- if tArgs[1] ~= nil then
- for i = 1, #tArgs do
- st = st..""..tArgs[i].." "
- end
- rItem = string.gsub(st, '[ \t]+%f[\r\n%z]', '')
- else
- rItem = tArgs[1]
- end
- if rItem == "" then
- print("INSERT ITEM TO SEARCH FOR")
- else
- for _,v in pairs(con) do
- fcon = fs.open(contl..v, "r")
- repeat
- st = fcon.readLine()
- if st ~= nil then
- local lineCon = mysplit(st,"-")
- local t,tt = string.find(string.lower(lineCon[3]), rItem)
- if t ~= nul then
- local sctn = peripheral.wrap(lineCon[1])
- sctn.pushItems(cont,tonumber(lineCon[2]))
- end
- end
- if st == nil then
- done = true
- end
- until done == true
- done = false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement