Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function split(inputstr, sep)
- if(inputstr == nil or inputstr == "") then
- return nil
- end
- if sep == nil then
- sep = ","
- end
- local t={} ; i=1
- for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
- t[i] = str
- i = i + 1
- end
- return t
- end
- function shouldMineWhole(istr,xlist)
- for key,value in pairs(xlist) do
- if(istr == value[1] and value[5] == "1") then
- return true
- end
- end
- return false
- end
- if(fs.exists("listed")) then
- ifile = fs.open("listed","r")
- xlist = {}
- x = split(ifile.readLine(),',')
- while(x ~= nil and x ~= "") do
- table.insert(xlist, x)
- x = split(ifile.readLine(),',')
- end
- else
- print("Listed file does not exist, cannot clear inventory")
- end
- x = read()
- print(shouldMineWhole(x,xlist))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement