Windower / Lua

Lua Addons and Scripts
242 stars 429 forks source link

[request] please add a way to read from dats in lua #1445

Open smd111 opened 8 years ago

smd111 commented 8 years ago

@z16 (we talked about this last night in chat)

please add a dats reader to lua

smd111 commented 8 years ago

any news on this??

if this was done all we would need to update pointwatch for aby zones(if ever again) would be

zone_to_dat_for_offset_table = {
    ["Abyssea - Konschtat"] = "ROM/23/80",
    ["Abyssea - Tahrongi"] = "ROM/23/110",
    ["Abyssea - La Theine"] = "ROM/24/69",
    ["Abyssea - Attohwa"] = "ROM/25/24",
    ["Abyssea - Misareaux"] = "ROM/25/25",
    ["Abyssea - Vunkerl"] = "ROM/25/26",
    ["Abyssea - Altepa"] = "ROM/25/27",
    ["Abyssea - Uleguerand"] = "ROM/25/62",
    ["Abyssea - Grauberg"] = "ROM/25/63",
    }

        offset = find_offset(zone_name),
        pearl_ebon_gold_silvery = 0,
        azure_ruby_amber = 1,
        visitant_status_update = 9,
        visitant_status_wears_off = 10,
        visitant_status_extend = 12,
        visitant_status_gain = 45,
        pearlescent_light = 183,
        golden_light = 184,
        silvery_light = 185,
        ebon_light = 186,
        azure_light = 187,
        ruby_light = 188,
        amber_light = 189,

function find_offset(zone_name)
    local dat = read_dat(zone_to_dat_for_offset_table[name])
    for id,str in ipairs(dat) do
        if str:startswith("≺Set Color #5≻Visitant Light Intensity≺Set Color #1≻") then
            return id
        end
    end

end

as long as the dats dont change and read_dat outputs to a table i think this would be way better then the current 150 lines to do the same thing