Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- automap = {}
- automap.path = "C:\\Users\\" .. os.getenv("USERNAME") .. "\\AppData\\Roaming\\Tibia\\Automap"
- automap.parse = function(filename)
- local positions = {}
- local mapX,mapY,mapZ = tonumber(filename:sub(1, 4)), tonumber(filename:sub(4, 4)),tonumber(filename:sub(8, 3))
- local file = io.open(automap.path .. "\\" .. filename, "rb")
- local data = file:read(65536 * 2)
- file:close()
- local index = 1
- for x = 0, 256 do
- for y = 0, 256 do
- table.insert(positions, {x=x+(mapX*256),y=y+(mapY*256),z=mapZ,color=string.char(data[index])})
- index = index + 1
- end
- end
- return positions
- end
- automap.parse("00300606")
Advertisement
Add Comment
Please, Sign In to add comment