Skip to content

Instantly share code, notes, and snippets.

@z16
Created July 6, 2014 16:17
Show Gist options
  • Save z16/25d57354af924b6c7c28 to your computer and use it in GitHub Desktop.
Save z16/25d57354af924b6c7c28 to your computer and use it in GitHub Desktop.
--[[
Any functions or code in this file will be run upon the eval addon load.
This file is ONLY run upon load. You will need to reload the eval addon to
re-read any changes
]]
require('luau')
require('pack')
packets = require('packets')
texts = require('texts')
_meta._G = {}
_meta._G.target = setmetatable({}, {__index = function(t, k) return (infect .. windower.ffxi.get_mob_by_target)(k) end})
_meta._G.index = setmetatable({}, {__index = function(t, k) return (infect .. windower.ffxi.get_mob_by_index)(k) end})
_meta._G.id = setmetatable({}, {__index = function(t, k) return (infect .. windower.ffxi.get_mob_by_id)(k) end})
infect = function(t)
if not t then
return nil
end
for k, v in pairs(t) do
if class(v) == 'table' then
infect(v)
end
end
return setmetatable(t, _meta.T)
end
setmetatable(_G, {__index = function(t, k)
return _meta._G[k] or infect(windower.ffxi['get_' .. k] and windower.ffxi['get_' .. k]()) or nil
end})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment