Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local arg = { ... }
- local id = {}
- local meta = {}
- local name = {}
- local files = {[1]="dump"}
- local i = 0
- local dictionary = {}
- for x=1,#files do
- local file = fs.open(files[x],"r")
- repeat
- i=i+1
- local line = file:readLine()
- id[i] = line
- line = file:readLine()
- meta[i] = line
- line = file:readLine()
- name[i] = line
- until not line
- end
- local table = {["id"]=id,["meta"]=meta,["name"]=name}
- local search = arg[1]
- local idlist = ""
- local recursionCheck = ""
- for i=1,#table["id"] do
- dictionary[table["id"][i].."~"..table["meta"][i]]=table["name"][i]
- if string.find(string.upper(table["name"][i]),string.upper(search)) then
- idlist = idlist..table["id"][i].."~"..table["meta"][i].." "
- end
- end
- local file = fs.open("idlist","w")
- file.write(idlist)
- file.close()
- --file = fs.open("dictionary","w")
- --file.write(textutils.serialise(dictionary))
- --file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement