Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require('pack')
- local winners = {}--4,21,637,4497,43222}
- local bags = {"Safe","Safe2","Locker","Satchel","Sack","Case","Inventory","Storage"}
- local folder_path = windower.windower_path .. '/scripts/marbles/'
- local player_name = windower.ffxi.get_player().name
- if not windower.dir_exists(folder_path) then
- windower.create_dir(folder_path)
- end
- local make_file = io.open(folder_path .. '/%s.lua':format(player_name), 'w')
- make_file:write('return {\n')
- for _,bag in pairs(bags) do
- for k,v in ipairs(windower.ffxi.get_items(bag)) do
- if v and v.id == 2559 then
- print(v.extdata:unpack('b17'))
- make_file:write(' %s,\n':format(v.extdata:unpack('b17')))
- end
- end
- end
- make_file:write('}\n')
- make_file:close()
- if #winners == 0 then return end
- local total = {0,0,0,0,0}
- for _,f in pairs(windower.get_dir(folder_path)) do
- local success, numbers = pcall(dofile,folder_path .. f)
- if success then
- for k,v in pairs(numbers) do
- for x = 1, 5 do
- if v%(10^x) == winners[x] then
- local rank = math.abs(x-6)
- total[rank] = total[rank]+1
- windower.add_to_chat(207, 'Rank %d match found on %s. %d [%d]':format(rank,f:sub(1,-5),v,winners[x]))
- end
- end
- end
- end
- end
- for x = 1,5 do
- if total[x] and total[x] > 0 then
- windower.add_to_chat(207, 'total rank %s winners: %s':format(x,total[x]))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement