summaryrefslogtreecommitdiff
path: root/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol
diff options
context:
space:
mode:
Diffstat (limited to 'Data/BuiltIn/Libraries/lua-addons/addons/autocontrol')
-rw-r--r--Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/autoabils.lua73
-rw-r--r--Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/autocontrol.lua305
-rw-r--r--Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/burden.lua186
-rw-r--r--Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/burdometer.lua96
-rw-r--r--Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/data/settings.xml58
-rw-r--r--Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/readme.md22
6 files changed, 740 insertions, 0 deletions
diff --git a/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/autoabils.lua b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/autoabils.lua
new file mode 100644
index 0000000..ea44bdc
--- /dev/null
+++ b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/autoabils.lua
@@ -0,0 +1,73 @@
+autoabils = {
+ [1688] = {name = 'Shield Bash', recast = 180, icon = "00210"},
+ [1689] = {name = 'Strobe', recast = 30, icon = "00210"},
+ [1690] = {name = 'Shock Absorber', recast = 180, icon = "00210"},
+ [1691] = {name = 'Flashbulb', recast = 45, icon = "00210"},
+ [1692] = {name = 'Mana Converter', recast = 180, icon = "00210"},
+ [1755] = {name = 'Reactive Shield', recast = 65, icon = "00210"},
+ [1765] = {name = 'Eraser', recast = 30, icon = "00210"},
+ [1812] = {name = 'Economizer', recast = 180, icon = "00210"},
+ [1876] = {name = 'Replicator', recast = 60, icon = "00210"},
+ [2489] = {name = 'Heat Capacitator', recast = 90, icon = "00210"},
+ [2490] = {name = 'Barrage Turbine', recast = 180, icon = "00210"},
+ [2491] = {name = 'Disruptor', recast = 60, icon = "00210"},
+ [3485] = {name = 'Regulator', recast = 60, icon = "00210" }
+}
+attachments_to_abilities = {
+ [8225] = 1688,
+ [8449] = 1689,
+ [8454] = 1755,
+ [8456] = 2489,
+ [8457] = 1689,
+ [8461] = 2489,
+ [8519] = 1876,
+ [8520] = 2490,
+ [8545] = 1690,
+ [8553] = 1690,
+ [8557] = 1690,
+ [8642] = 1691,
+ [8645] = 1765,
+ [8674] = 1692,
+ [8678] = 1812,
+ [8680] = 2491,
+ [8682] = 3485,
+}
+
+local player_id
+
+windower.register_event("login", function()
+ player_id = windower.ffxi.get_player().id
+end)
+
+windower.register_event("load", function()
+ local player = windower.ffxi.get_player()
+ player_id = player and player.id
+end)
+
+windower.register_event("action", function(act)
+ local abil_ID = act['param']
+ local actor_id = act['actor_id']
+ local pet_index = windower.ffxi.get_mob_by_id(player_id)['pet_index']
+
+ if act['category'] == 6 and actor_id == player_id and (abil_ID == 136 or abil_ID == 310 or abil_ID == 139) then
+ local avalible_abilities = {}
+ local automaton = windower.ffxi.get_mjob_data()
+
+ if attachments_to_abilities[automaton.frame] then
+ table.insert(avalible_abilities, autoabils[attachments_to_abilities[automaton.frame]])
+ end
+
+ for _, id in pairs(automaton.attachments) do
+ if attachments_to_abilities[id] then
+ table.insert(avalible_abilities, autoabils[attachments_to_abilities[id]])
+ end
+ end
+
+ for _, ability in pairs(avalible_abilities) do -- if abil_ID is deactivate delete ability timers, otherwise create them.
+ windower.send_command('timers '.. (abil_ID == 139 and "d" or "c") .. ' "'..ability.name..'" ' .. (abil_ID == 139 and "" or ability.recast..' up abilities/' .. ability.icon))
+ end
+ elseif autoabils[abil_ID-256] and windower.ffxi.get_mob_by_id(actor_id)['index'] == pet_index and pet_index ~= nil then
+ local abil = abil_ID - 256
+ windower.send_command('@timers c "'..autoabils[abil].name..'" '..autoabils[abil].recast..' up')
+ end
+end)
diff --git a/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/autocontrol.lua b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/autocontrol.lua
new file mode 100644
index 0000000..3c0d51c
--- /dev/null
+++ b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/autocontrol.lua
@@ -0,0 +1,305 @@
+--[[
+Copyright © 2013, 2014, 2020 Ricky Gall, Nifim
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of <addon name> nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <your name> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+]]
+
+_addon.name = 'autocontrol'
+_addon.version = '2.0.5'
+_addon.author = 'Nitrous (Shiva)'
+_addon.commands = {'autocontrol','acon'}
+
+require('tables')
+require('strings')
+require('logger')
+require('sets')
+res = require('resources')
+config = require('config')
+files = require('files')
+chat = require('chat')
+
+defaults = {}
+defaults.bg = {}
+defaults.bg.red = 0
+defaults.bg.blue = 0
+defaults.bg.green = 0
+defaults.pos = {}
+defaults.pos.x = 400
+defaults.pos.y = 300
+defaults.text = {}
+defaults.text.red = 255
+defaults.text.green = 255
+defaults.text.blue = 255
+defaults.text.font = 'Consolas'
+defaults.text.size = 10
+defaults.autosets = T{}
+defaults.autosets.default = T{ }
+defaults.AutoActivate = true
+defaults.AutoDeusExAutomata = false
+defaults.maneuvertimers = true
+defaults.burdentracker = true
+
+settings = config.load(defaults)
+
+burden_hud = require('burdometer') -- has to be loaded after settings are parsed.
+require("autoabils")
+recast_ids = {}
+recast_ids.deactivate = res.job_abilities:with('english', 'Deactivate').recast_id
+recast_ids.activate = res.job_abilities:with('english', 'Activate').recast_id
+recast_ids.deusex = res.job_abilities:with('english', 'Deus Ex Automata').recast_id
+
+petlessZones = S{50,235,234,224,284,233,70,257,251,14,242,250,226,245,
+ 237,249,131,53,252,231,236,246,232,240,247,243,223,248,230,
+ 26,71,244,239,238,241,256,257}
+
+function initialize()
+ local player = windower.ffxi.get_player()
+ if not player then
+ windower.send_command('@wait 5;lua i autocontrol initialize')
+ return
+ end
+
+ mjob_id = player.main_job_id
+ atts = res.items:category('Automaton')
+
+ local playermob = windower.ffxi.get_mob_by_index(player.index)
+ while(playermob == nil) do
+ coroutine.sleep(1)
+ playermob = windower.ffxi.get_mob_by_index(player.index)
+ end
+
+ if mjob_id == 18 then
+ if playermob.pet_index then
+ if settings.burdentracker then
+ burden_hud:show()
+ end
+ end
+ end
+end
+
+windower.register_event('load', 'login', initialize)
+
+function attach_set(autoset)
+ if windower.ffxi.get_player().main_job_id ~= 18 or not settings.autosets[autoset] then
+ return
+ end
+ if settings.autosets[autoset]:map(string.lower):equals(get_current_autoset():map(string.lower)) then
+ log('The '..autoset..' set is already equipped.')
+ return
+ end
+
+ local playermob = windower.ffxi.get_mob_by_index(windower.ffxi.get_player().index)
+ if playermob.pet_index and playermob.pet_index ~= 0 then
+ local recast = windower.ffxi.get_ability_recasts()[recast_ids.deactivate]
+ if recast == 0 then
+ windower.send_command('input /pet "Deactivate" <me>')
+ log('Deactivating ' .. windower.ffxi.get_mjob_data().name .. '.')
+ windower.send_command('@wait 2;lua i autocontrol attach_set '..autoset)
+ elseif recast then
+ error('Deactivate on cooldown wait ' .. (recast / 60) .. ' seconds and try again')
+ end
+ else
+ windower.ffxi.reset_attachments()
+ log('Starting to equip '..autoset..' to '..windower.ffxi.get_mjob_data().name..'.')
+ set_attachments_from_autoset(autoset, 'head')
+ end
+end
+
+function set_attachments_from_autoset(autoset,slot)
+ if slot == 'head' then
+ local tempHead = settings.autosets[autoset].head:lower()
+ if tempHead then
+ for att in atts:it() do
+ if att.name:lower() == tempHead and att.id > 5000 then
+ windower.ffxi.set_attachment(att.id)
+ break
+ end
+ end
+ end
+ coroutine.schedule(set_attachments_from_autoset:prepare(autoset, 'frame'), 0.5)
+ elseif slot == 'frame' then
+ local tempFrame = settings.autosets[autoset].frame:lower()
+ if tempFrame then
+ for att in atts:it() do
+ if att.name:lower() == tempFrame and att.id > 5000 then
+ windower.ffxi.set_attachment(att.id)
+ break
+ end
+ end
+ end
+ coroutine.schedule(set_attachments_from_autoset:prepare(autoset, '1'), 0.5)
+ else
+ local tempname = settings.autosets[autoset]['slot' .. tostring(slot):zfill(2)]:lower()
+ if tempname then
+ for att in atts:it() do
+ if att.name:lower() == tempname and att.id > 5000 then
+ windower.ffxi.set_attachment(att.id, tonumber(slot))
+ break
+ end
+ end
+ end
+
+ if tonumber(slot) < 12 then
+ coroutine.schedule(set_attachments_from_autoset:prepare(autoset, slot + 1), 0.5)
+ else
+ log(windower.ffxi.get_mjob_data().name..' has been equipped with the '..autoset..' set.')
+ if petlessZones:contains(windower.ffxi.get_info().zone) then
+ return
+ else
+ local recasts = windower.ffxi.get_ability_recasts()
+ if settings.AutoActivate and recasts[recast_ids.activate] == 0 then
+ windower.send_command('input /ja "Activate" <me>')
+ elseif settings.AutoDeusExAutomata and recasts[recast_ids.deusex] == 0 then
+ log('Activate is down, using Deus Ex Automata instead.')
+ windower.send_command('input /ja "Deus Ex Automata" <me>')
+ elseif settings.AutoActivate and settings.AutoDeusExAutomata then
+ log('Activate and Deus Ex Automata timers were not ready.')
+ elseif settings.AutoActivate then
+ log('Activate timer was not ready.')
+ elseif settings.AutoDeusExAutomata then
+ log('Deus Ex Automata timer was not ready.')
+ end
+ end
+ end
+ end
+end
+
+function get_current_autoset()
+ if windower.ffxi.get_player().main_job_id == 18 then
+ local autoTable = T{}
+ local mjob_data = windower.ffxi.get_mjob_data()
+ local tmpTable = mjob_data.attachments
+ for i = 1, 12 do
+ local t = ''
+ if tmpTable[i] then
+ if i < 10 then
+ t = '0'
+ end
+ autoTable['slot' .. tostring(i):zfill(2)] = atts[tmpTable[i]].name:lower()
+ end
+ end
+ autoTable.head = atts[mjob_data.head].name:lower()
+ autoTable.frame = atts[mjob_data.frame].name:lower()
+ return autoTable
+ end
+end
+
+function save_set(setname)
+ if setname == 'default' then
+ error('Please choose a name other than default.')
+ return
+ end
+
+ settings.autosets[setname] = get_current_autoset()
+ config.save(settings, 'all')
+ notice('Set '..setname..' saved.')
+end
+
+function get_autoset_list()
+ log('Listing sets:')
+ for key,_ in pairs(settings.autosets) do
+ if key ~= 'default' then
+ log('\t' .. key .. ': ' .. (settings.autosets[key]:length()-2) .. ' attachments.')
+ end
+ end
+end
+
+function get_autoset_content(autoset)
+ log('Getting '..autoset..'\'s attachment list:')
+ settings.autosets[autoset]:vprint()
+end
+
+windower.register_event('addon command', function(comm, ...)
+ if windower.ffxi.get_player().main_job_id ~= 18 then
+ error('You are not on Puppetmaster.')
+ return
+ end
+
+ local args = L{...}
+ comm = comm or 'help'
+
+ if comm == 'saveset' then
+ if args[1] then
+ save_set(args[1])
+ end
+ elseif comm == 'add' then
+ if args[2] then
+ local slot = table.remove(args,1)
+ local attach = args:sconcat()
+ add_attachment(attach,slot)
+ end
+ elseif comm == 'equipset' then
+ if args[1] then
+ attach_set(args[1])
+ end
+ elseif comm == 'setlist' then
+ get_autoset_list()
+ elseif comm == 'attlist' then
+ if args[1] then
+ get_autoset_content(args[1])
+ end
+ elseif comm == 'list' then
+ get_current_autoset():vprint()
+ elseif comm == "maneuvertimers" or comm == "mt" then
+ maneuvertimers = not maneuvertimers
+ elseif S{'fonttype','fontsize','pos','bgcolor','txtcolor'}:contains(comm) then
+ if comm == 'fonttype' then burden_hud:font(args[1])
+ elseif comm == 'fontsize' then burden_hud:size(args[1])
+ elseif comm == 'pos' then burden_hud:pos(args[1], args[2])
+ elseif comm == 'bgcolor' then burden_hud:bgcolor(args[1], args[2], args[3])
+ elseif comm == 'txtcolor' then burden_hud:color(args[1], args[2], args[3])
+ end
+ config.save(settings, 'all')
+ elseif comm == 'show' then burden_hud:show()
+ elseif comm == 'hide' then burden_hud:hide()
+ elseif comm == 'settings' then
+ log('BG: R: '..settings.bg.red..' G: '..settings.bg.green..' B: '..settings.bg.blue)
+ log('Font: '..settings.text.font..' Size: '..settings.text.size)
+ log('Text: R: '..settings.text.red..' G: '..settings.text.green..' B: '..settings.text.blue)
+ log('Position: X: '..settings.pos.x..' Y: '..settings.pos.y)
+ else
+ log('Autosets command list:')
+ log(' 1. help - Brings up this menu.')
+ log(' 2. setlist - list all saved automaton sets.')
+ log(' 3. saveset <setname> - saves <setname> to your settings.')
+ log(' 4. equipset <setname> - equips <setname> to your automaton.')
+ log(' 5. attlist <setname> - gets the attachment list for <setname>')
+ log(' 6. list - gets the list of currently equipped attachments.')
+ log(' 7. maneuvertimers - Toggles showing maneuver timers on/off.')
+ log('The following all correspond to the burden tracker:')
+ log(' fonttype <name> | fontsize <size> | pos <x> <y>')
+ log(' bgcolor <r> <g> <b> | txtcolor <r> <g> <b>')
+ log(' settings - shows current settings')
+ log(' show/hide - toggles visibility of the tracker so you can make changes.')
+ end
+end)
+
+windower.register_event("job change", function(main_job_id)
+ if main_job_id == 18 and settings.burdentracker then
+ burden_hud:show()
+ else
+ burden_hud:hide()
+ end
+end)
diff --git a/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/burden.lua b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/burden.lua
new file mode 100644
index 0000000..51a8136
--- /dev/null
+++ b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/burden.lua
@@ -0,0 +1,186 @@
+local set = require("sets")
+local packets = require("packets")
+
+local o = {
+ fire = 0,
+ earth = 0,
+ water = 0,
+ wind = 0,
+ ice = 0,
+ thunder = 0,
+ light = 0,
+ dark = 0,
+}
+local burden = {}
+local mt = {
+ __index = burden
+}
+setmetatable(o, mt)
+local updaters = {}
+local heatsink
+
+windower.register_event('incoming chunk',function(id,org,modi,is_injected,is_blocked)
+ if id == 0x044 then
+ local attachments = windower.ffxi.get_mjob_data().attachments
+ if attachments then
+ for _, id in pairs(attachments) do
+ heatsink = (id == 8610)
+ if heatsink then
+ break
+ end
+ end
+ end
+ end
+end)
+
+local thresholdModifiers =
+{
+ [11101] = 40, -- Cirque Farsetto +2
+ [11201] = 20, -- Cirque Farsetto +1
+ [14930] = 5, -- Pup. Dastanas
+ [15030] = 5, -- Pup. Dastanas +1
+ [16281] = 5, -- Buffoon's Collar
+ [16282] = 5, -- Buffoon's Collar +1
+ [20520] = 40, -- Midnights
+ [26263] = 10, -- Visucius's Mantle
+ [26932] = 40, -- Kara. Farsetto
+ [26933] = 40, -- Kara. Farsetto +1
+ [27960] = 5, -- Foire Dastanas
+ [27981] = 5, -- Foire Dastanas +1
+ [28634] = 5, -- Dispersal Mantle
+}
+burden.threshold = 30
+
+local pet_actions =
+{
+ [136] = "activate",
+ [139] = "deactivate",
+ [141] = "fire",
+ [142] = "ice",
+ [143] = "wind",
+ [144] = "earth",
+ [145] = "thunder",
+ [146] = "water",
+ [147] = "light",
+ [148] = "dark",
+ [309] = "cooldown",
+ [310] = "deus_ex_automata",
+}
+function burden:update(action)
+ updaters[action](self)
+end
+
+function burden:zone()
+ for k in pairs(self) do
+ self[k] = 15
+ end
+end
+
+function burden.set_decay_event(func)
+ burden.decay_event = func
+end
+function updaters.deactivate(self)
+ for k in pairs(self) do
+ self[k] = 0
+ end
+end
+
+function updaters.activate(self)
+ for _, id in pairs(windower.ffxi.get_mjob_data().attachments) do
+ heatsink = (id == 8610)
+ if heatsink then
+ break
+ end
+ end
+ burden.update_decay_rate()
+ for k in pairs(self) do
+ self[k] = 15
+ end
+end
+updaters.deus_ex_automata = updaters.activate
+
+function updaters.cooldown(self)
+ for k in pairs(self) do
+ self[k] = self[k] / 2
+ end
+end
+
+function updaters.maneuver(self, type)
+ self[type] = self[type] + 15
+ local inventory = windower.ffxi.get_items()
+ local equipment = {
+ sub = {},
+ ammo = {},
+ main = {},
+ head = {},
+ body = {},
+ back = {},
+ legs = {},
+ feet = {},
+ neck = {},
+ hands = {},
+ range = {},
+ waist = {},
+ left_ear = {},
+ left_ring = {},
+ right_ear = {},
+ right_ring = {},
+ }
+ for k, v in pairs(inventory.equipment) do
+ equipment[string.gsub(k ,"_bag","")][k] = v
+ end
+ burden.threshold = 30
+ for k, v in pairs(equipment) do
+ item = windower.ffxi.get_items(v[k .. "_bag"], v[k])
+ if thresholdModifiers[item.id] then
+ burden.threshold = burden.threshold + thresholdModifiers[item.id]
+ end
+ end
+end
+
+function updaters.ice(self) updaters.maneuver(self, "ice") end
+function updaters.fire(self) updaters.maneuver(self, "fire") end
+function updaters.wind(self) updaters.maneuver(self, "wind") end
+function updaters.dark(self) updaters.maneuver(self, "dark") end
+function updaters.earth(self) updaters.maneuver(self, "earth") end
+function updaters.water(self) updaters.maneuver(self, "water") end
+function updaters.light(self) updaters.maneuver(self, "light") end
+function updaters.thunder(self) updaters.maneuver(self, "thunder") end
+
+burden.decay_rate = 1
+function burden.decay()
+ for k in pairs(o) do
+ if o[k] > burden.decay_rate then
+ o[k] = o[k] - burden.decay_rate
+ elseif o[k] > 0 then
+ o[k] = 0
+ end
+ end
+ if burden.decay_event then
+ burden.decay_event()
+ end
+ coroutine.schedule(burden.decay, 3)
+end
+coroutine.schedule(burden.decay, os.date("*t").sec % 3)
+
+local count_to_decay_rate = {
+ [0] = 2,
+ [1] = 4,
+ [2] = 5,
+ [3] = 6,
+}
+function burden.update_decay_rate()
+ if heatsink then
+ local count = 0
+ for _, v in pairs(windower.ffxi.get_player().buffs) do
+ if v == 305 then
+ count = count + 1
+ end
+ end
+ burden.decay_rate = count_to_decay_rate[count];
+ else
+ burden.decay_rate = 1
+ end
+end
+
+return o
diff --git a/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/burdometer.lua b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/burdometer.lua
new file mode 100644
index 0000000..c36f645
--- /dev/null
+++ b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/burdometer.lua
@@ -0,0 +1,96 @@
+local sets = require("sets")
+local texts = require("texts")
+local burden = require("burden")
+
+local pet_actions =
+{
+ [136] = "activate",
+ [139] = "deactivate",
+ [141] = "fire",
+ [142] = "ice",
+ [143] = "wind",
+ [144] = "earth",
+ [145] = "thunder",
+ [146] = "water",
+ [147] = "light",
+ [148] = "dark",
+ [309] = "cooldown",
+ [310] = "deus_ex_automata",
+}
+
+local maneuvers =
+S{
+ 141,
+ 142,
+ 143,
+ 144,
+ 145,
+ 146,
+ 147,
+ 148,
+}
+
+str = 'Fire: \\cs(${color_fire|255,255,255})${fire|0}\\cr - ${time_fire|0}s - ${risk_fire|0}%'
+str = str .. '\nIce: \\cs(${color_ice|255,255,255})${ice|0}\\cr - ${time_ice|0}s - ${risk_ice|0}%'
+str = str .. '\nWind: \\cs(${color_wind|255,255,255})${wind|0}\\cr - ${time_wind|0}s - ${risk_wind|0}%'
+str = str .. '\nEarth: \\cs(${color_earth|255,255,255})${earth|0}\\cr - ${time_earth|0}s - ${risk_earth|0}%'
+str = str .. '\nThunder: \\cs(${color_thunder|255,255,255})${thunder|0}\\cr - ${time_thunder|0}s - ${risk_thunder|0}%'
+str = str .. '\nWater: \\cs(${color_water|255,255,255})${water|0}\\cr - ${time_water|0}s - ${risk_water|0}%'
+str = str .. '\nLight: \\cs(${color_light|255,255,255})${light|0}\\cr - ${time_light|0}s - ${risk_light|0}%'
+str = str .. '\nDark: \\cs(${color_dark|255,255,255})${dark|0}\\cr - ${time_dark|0}s - ${risk_dark|0}%'
+
+local hud = texts.new(str, settings)
+
+function update_hud(element)
+ hud[element] = burden[element]
+
+ risk = burden[element] - burden.threshold
+ hud["risk_" .. element] = risk > 0 and risk or 0
+ hud["color_" .. element] = "255," .. (risk > 33 and 0 or 255) .. "," .. (risk > 0 and 0 or 255)
+ hud["time_" .. element] = (burden[element] / burden.decay_rate) * 3
+end
+
+windower.register_event("action", function(act)
+ local abil_id = act['param']
+ local actor_id = act['actor_id']
+ local player = windower.ffxi.get_player()
+ local pet_index = windower.ffxi.get_mob_by_index(player.index).pet_index
+
+ if player.main_job_id ~= 18 then
+ return
+ end
+
+ if act["category"] == 6 and actor_id == player.id and pet_actions[abil_id] then
+ burden:update(pet_actions[abil_id]) -- Always assumes good burden (+15).
+ if maneuvers:contains(abil_id) then
+ if act.targets[1].actions[1].param > 0 then
+ burden[pet_actions[abil_id]] = burden.threshold + act.targets[1].actions[1].param -- Corrects for bad burden when over threshold.
+ end
+ update_hud(pet_actions[abil_id])
+ end
+ end
+end)
+
+local function decay_event()
+ for element in pairs(burden) do
+ update_hud(element)
+ end
+end
+burden.set_decay_event(decay_event)
+
+windower.register_event("zone change", function()
+ burden:zone()
+end)
+
+local function update_decay_rate(buff_id)
+ if buff_id == 305 then
+ burden:update_decay_rate()
+ end
+end
+
+windower.register_event("gain buff", update_decay_rate)
+windower.register_event("lose buff", update_decay_rate)
+
+decay_event()
+
+return hud
diff --git a/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/data/settings.xml b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/data/settings.xml
new file mode 100644
index 0000000..095c82e
--- /dev/null
+++ b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/data/settings.xml
@@ -0,0 +1,58 @@
+<?xml version="1.1" ?>
+<settings>
+ <global>
+ <autosets>
+ <default />
+ <healer>
+ <frame>Stormwaker Frame</frame>
+ <head>Soulsoother Head</head>
+ <slot01>Disruptor</slot01>
+ <slot02>Economizer</slot02>
+ <slot03>Mana Conserver</slot03>
+ <slot04>Vivi-Valve</slot04>
+ <slot05>Percolator</slot05>
+ <slot06>Damage Gauge</slot06>
+ <slot07>Eraser</slot07>
+ <slot08>Optic Fiber</slot08>
+ <slot09>Steam Jacket</slot09>
+ <slot10>Condenser</slot10>
+ <slot11>Mana Channeler</slot11>
+ <slot12>Stealth Screen</slot12>
+ </healer>
+ <melrng>
+ <frame>Sharpshot Frame</frame>
+ <head>Valoredge Head</head>
+ <slot01>Tension Spring</slot01>
+ <slot02>Turbo Charger</slot02>
+ <slot03>Equalizer</slot03>
+ <slot04>Dynamo</slot04>
+ <slot05>Tension Spring II</slot05>
+ <slot06>Scope</slot06>
+ <slot07>Auto-Repair Kit II</slot07>
+ <slot08>Coiler</slot08>
+ <slot09>Tactical Processor</slot09>
+ <slot10>Armor Plate II</slot10>
+ <slot11>Optic Fiber</slot11>
+ <slot12>Volt Gun</slot12>
+ </melrng>
+ </autosets>
+ <bg>
+ <blue>0</blue>
+ <green>0</green>
+ <red>0</red>
+ </bg>
+ <padding>0</padding>
+ <pos>
+ <x>1600</x>
+ <y>920</y>
+ </pos>
+ <text>
+ <blue>255</blue>
+ <font>Consolas</font>
+ <green>255</green>
+ <red>255</red>
+ <size>10</size>
+ </text>
+ <visible>false</visible>
+ </global>
+</settings>
diff --git a/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/readme.md b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/readme.md
new file mode 100644
index 0000000..eb14bce
--- /dev/null
+++ b/Data/BuiltIn/Libraries/lua-addons/addons/autocontrol/readme.md
@@ -0,0 +1,22 @@
+**Author:** Ricky Gall
+**Version:** 2.0.4
+**Description:**
+Addon to make setting automaton attachments easier. Currently only works as pup main. Includes burden tracker.
+
+**Abbreviations:** acon, autocontrol
+
+**Commands:**
+ 1. help - Brings up this menu.
+ 2. setlist - list all saved automaton sets.
+ 3. saveset &lt;setname&gt; - saves &lt;setname&gt; to your settings.
+ 4. equipset &lt;setname&gt; - equips &lt;setname&gt; to your automaton.
+ 5. attlist &lt;setname&gt; - gets the attachment list for &lt;setname&gt;
+ 6. list - gets the list of currently equipped attachments.
+ 7. maneuvertimers - Toggle showing maneuver timers (abbreviation mt)
+
+**The following all correspond to the burden tracker:**
+ 1. fonttype &lt;name&gt; | fontsize &lt;size&gt; | pos &lt;x&gt; &lt;y&gt;
+ 2. bgcolor &lt;r&gt; &lt;g&gt; &lt;b&gt; | txtcolor &lt;r&gt; &lt;g&gt; &lt;b&gt;
+ 3. settings - shows current settings
+ 4. show/hide - toggles visibility of the tracker so you can make changes.
+