diff --git a/addons/salvage2/data/settings.xml b/addons/salvage2/data/settings.xml
deleted file mode 100644
index 08ba0f7f9..000000000
--- a/addons/salvage2/data/settings.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
- 1000
- 250
-
-
\ No newline at end of file
diff --git a/addons/salvage2/salvage2.lua b/addons/salvage2/salvage2.lua
index 4e8fb289a..1d9eb7cde 100644
--- a/addons/salvage2/salvage2.lua
+++ b/addons/salvage2/salvage2.lua
@@ -30,142 +30,146 @@ require('tables')
require('strings')
require('maths')
require('logger')
+texts = require ('texts')
config = require('config')
-----------------------------
-settingtab = config.load()
--variables
- posx = 1000
- posy = 250
- if settingtab['posx'] ~= nil then
- posx = settingtab['posx']
- posy = settingtab['posy']
- end
- pathos_ident = {'Main Weapon/Sub-Weapon restriction', 'Ranged Weapon/Ammo restriction', 'Head/Neck equipment restriction', 'Body equipment restriction', 'Hand equipment restriction', 'Earrings/Rings restriction', 'Back/Waist equipment restriction', 'Leg/Foot equipment restriction', 'Support Job restriction', 'Job Abilities restriction', 'Spellcasting restriction', 'Max HP Down', 'Max MP Down', 'STR Down', 'DEX Down', 'AGI Down', 'MND Down', 'INT Down', 'CHR Down', 'VIT Down'}
- pathos_short = {'Weapon', 'Ranged', 'Head/Neck', 'Body', 'Hand', 'Earrings/Rings', 'Back/Waist', 'Leg/Foot', 'Support Job', 'Job Abilities', 'Spellcasting', 'Max HP', 'Max MP', 'STR', 'DEX', 'AGI', 'MND', 'INT', 'CHR', 'VIT'}
+pathos_ident = {'Main Weapon/Sub-Weapon restriction', 'Ranged Weapon/Ammo restriction', 'Head/Neck equipment restriction', 'Body equipment restriction', 'Hand equipment restriction', 'Earrings/Rings restriction', 'Back/Waist equipment restriction', 'Leg/Foot equipment restriction', 'Support Job restriction', 'Job Abilities restriction', 'Spellcasting restriction', 'Max HP Down', 'Max MP Down', 'STR Down', 'DEX Down', 'AGI Down', 'MND Down', 'INT Down', 'CHR Down', 'VIT Down'}
+pathos_short = {'Weapon', 'Ranged', 'Head/Neck', 'Body', 'Hand', 'Earrings/Rings', 'Back/Waist', 'Leg/Foot', 'Support Job', 'Job Abilities', 'Spellcasting', 'MaxHP', 'MaxMP', 'STR', 'DEX', 'AGI', 'MND', 'INT', 'CHR', 'VIT'}
+salvage_zones = S{73, 74, 75, 76}
-function settings_create()
- -- get player's name
- player = windower.ffxi.get_player()['name']
- -- set all pathos as needed
- for i=1, #pathos_ident do
- if pathos_ident[i] ~= nil then
- pathos_ident[pathos_ident[i]] = 1
- end
- end
-end
+defaults = {}
+defaults.pos = {}
+defaults.pos.x = 1000
+defaults.pos.y = 150
+defaults.color = {}
+defaults.color.alpha = 200
+defaults.color.red = 200
+defaults.color.green = 200
+defaults.color.blue = 200
+defaults.bg = {}
+defaults.bg.alpha = 200
+defaults.bg.red = 30
+defaults.bg.green = 30
+defaults.bg.blue = 30
+
+settings = config.load(defaults)
+salvage_box2 = texts.new('No pathos', settings)
windower.register_event('addon command',function (...)
local params = {...};
- if #params < 1 then
- return
- end
- if params[1] then
- if params[1]:lower() == "help" then
- print('Salvage2 available commands:')
- print('s2 help : Shows this help message')
- print('s2 pos : Positions the list')
- print('s2 [hide/show] : Hides the box')
- print('s2 timer [start/stop] : Starts or stops the zone timer')
- print('s2 remove : Removes the pathos from the remaining list')
- elseif params[1]:lower() == "pos" then
- if params[3] then
- local posx, posy = tonumber(params[2]), tonumber(params[3])
- windower.text.set_location('salvage_box2', posx, posy)
- end
- elseif params[1]:lower() == "hide" then
- windower.text.set_visibility('salvage_box2', false)
- elseif params[1]:lower() == "show" then
- windower.text.set_visibility('salvage_box2', true)
- elseif params[1]:lower() == "timer" then
- if params[2] == "start" then
- windower.send_command('timers c Remaining 6000 up')
- elseif params[2] == "stop" then
- windower.send_command('timers d Remaining')
- end
- elseif params[1]:lower() == "debug" then
- if params[2]:lower() == "start" then
- windower.send_command('timers c Remaining 6000 up')
- settings_create()
- windower.text.set_visibility('salvage_box2', true)
- initialize()
- elseif params[2]:lower() == "stop" then
- windower.send_command('timers d Remaining')
- windower.text.set_visibility('salvage_box2', false)
- end
- elseif params[1]:lower() == "remove" then
- for i=1, #pathos_short do
- if pathos_short[i]:lower() == params[2]:lower() then
- pathos_ident[pathos_ident[i]] = 0
- initialize()
- end
- end
- end
- end
+ if #params < 1 then
+ return
+ end
+ if params[1] then
+ if params[1]:lower() == "help" then
+ print('Salvage2 available commands:')
+ print('s2 help : Shows this help message')
+ print('s2 pos : Positions the list')
+ print('s2 [hide/show] : Hides the box')
+ print('s2 timer [start/stop] : Starts or stops the zone timer')
+ print('s2 remove : Removes the pathos from the remaining list')
+ elseif params[1]:lower() == "pos" then
+ if params[3] then
+ local posx, posy = tonumber(params[2]), tonumber(params[3])
+ windower.text.set_location('salvage_box2', posx, posy)
+ end
+ elseif params[1]:lower() == "hide" then
+ salvage_box2:hide()
+ elseif params[1]:lower() == "show" then
+ salvage_box2:show()
+ elseif params[1]:lower() == "timer" then
+ if params[2] == "start" then
+ windower.send_command('timers c Remaining 6000 up')
+ elseif params[2] == "stop" then
+ windower.send_command('timers d Remaining')
+ end
+ elseif params[1]:lower() == "debug" then
+ if params[2]:lower() == "start" then
+ windower.send_command('timers c Remaining 6000 up')
+ settings_create()
+ salvage_box2:show()
+ initialize()
+ elseif params[2]:lower() == "stop" then
+ windower.send_command('timers d Remaining')
+ salvage_box2:hide()
+ end
+ elseif params[1]:lower() == "remove" then
+ for i=1, #pathos_short do
+ if pathos_short[i]:lower() == params[2]:lower() then
+ pathos_ident[pathos_ident[i]] = 0
+ initialize()
+ end
+ end
+ end
+ end
end)
windower.register_event('login', function(name)
- player = name
+ player = name
end)
-salvage_zones = S{73, 74, 75, 76}
+function settings_create()
+ -- get player's name
+ player = windower.ffxi.get_player()['name']
+ -- set all pathos as needed
+ for i=1, #pathos_ident do
+ if pathos_ident[i] ~= nil then
+ pathos_ident[pathos_ident[i]] = 1
+ end
+ end
+end
windower.register_event('zone change', function(id)
- if salvage_zones:contains(id) then
- windower.send_command('timers c Remaining 6000 up')
- settings_create()
- initialize()
- windower.text.set_visibility('salvage_box2', true)
- else
- windower.send_command('timers d Remaining')
- settings_create()
- initialize()
- windower.text.set_visibility('salvage_box2', false)
- end
+ if salvage_zones:contains(id) then
+ windower.send_command('timers c Remaining 6000 up')
+ settings_create()
+ initialize()
+ salvage_box2:show()
+ else
+ windower.send_command('timers d Remaining')
+ settings_create()
+ initialize()
+ salvage_box2:hide()
+ end
end)
windower.register_event('incoming text',function (original, new, color)
-
- a,b,pathos,name = string.find(original,'..(.*) removed for (%w+)\46')
-
- if pathos ~= nil then
- if name == player then
- -- Insert code to remove pathos from list
- for i=1, #pathos_ident do
- if pathos_ident[i]:lower() == pathos:lower() then
- if pathos_ident[pathos_ident[i]] == 1 then
- pathos_ident[pathos_ident[i]] = 0
- initialize()
- end
- end
- end
- end
- return new, color
- end
+ original = original:strip_format()
+ local pathos, name = original:match('(.*) removed for (%w+)')
+ if pathos ~= nil then
+ --print('Pathos found '..pathos)
+ if name == player then
+ for i=1, #pathos_ident do
+ if pathos_ident[i]:lower() == pathos:lower() then
+ if pathos_ident[pathos_ident[i]] == 1 then
+ pathos_ident[pathos_ident[i]] = 0
+ initialize()
+ end
+ end
+ end
+ end
+ return new, color
+ end
end)
function initialize()
- pathos_remain = (" Pathos Remaining: \n ")
- for i=1, #pathos_ident do
- if pathos_ident[pathos_ident[i]] == 1 then
- item = pathos_short[i]
- pathos_remain = (pathos_remain..item..' \n ')
- end
- end
- windower.text.create('salvage_box2')
- windower.text.set_bg_color('salvage_box2',200,30,30,30)
- windower.text.set_color('salvage_box2',255,200,200,200)
- windower.text.set_location('salvage_box2',posx,posy)
- windower.text.set_bg_visibility('salvage_box2',1)
- windower.text.set_font('salvage_box2','Arial',12)
- windower.text.set_text('salvage_box2', pathos_remain)
- if pathos_remain == (" Pathos Remaining: \n ") then
- windower.text.set_visibility('salvage_box2',false)
- end
+ pathos_remain = (" Pathos Remaining: \n ")
+ for i=1, #pathos_ident do
+ if pathos_ident[pathos_ident[i]] == 1 then
+ item = pathos_short[i]
+ pathos_remain = (pathos_remain..item..' \n ')
+ end
+ end
+ salvage_box2:text(pathos_remain)
+ if pathos_remain == (" Pathos Remaining: \n ") then
+ salvage_box2:hide()
+ end
end
windower.register_event('unload',function ()
- windower.text.delete('salvage_box2')
- windower.send_command('timers d Remaining')
+ windower.text.delete('salvage_box2')
+ windower.send_command('timers d Remaining')
end )
diff --git a/addons/thtracker/thtracker.lua b/addons/thtracker/thtracker.lua
index 1a045ccd1..e3be84364 100644
--- a/addons/thtracker/thtracker.lua
+++ b/addons/thtracker/thtracker.lua
@@ -30,8 +30,8 @@ _addon.author = 'Krizz'
_addon.version = 1.1
_addon.commands = {'thtracker', 'th'}
-config = require 'config'
-texts = require 'texts'
+config = require ('config')
+texts = require ('texts')
require('logger')
defaults = {}
@@ -75,32 +75,32 @@ windower.register_event('addon command', function(command, ...)
end)
windower.register_event('incoming text', function(original, new, color)
- original = original:strip_format()
- local name, count = original:match('Additional effect: Treasure Hunter effectiveness against[%s%a%a%a]- (.*) increases to (%d+).')
-
- if name and count then
- name = name.gsub(name, "the ", "")
- mob = name
- th:text(' '..name..'\n TH: '..count);
- th:show()
- end
+ original = original:strip_format()
+ local name, count = original:match('Additional effect: Treasure Hunter effectiveness against[%s%a%a%a]- (.*) increases to (%d+).')
+
+ if name and count then
+ name = name.gsub(name, "the ", "")
+ mob = name
+ th:text(' '..name..'\n TH: '..count);
+ th:show()
+ end
- local deadmob = original:match('%w+ defeats[%s%a%a%a]- (.*).')
-
- if deadmob then
- deadmob = deadmob.gsub(deadmob, "the ", "")
- end
-
- if deadmob == mob then
-
- th:text('No current mob')
- th:hide()
- mob = nil
- end
+ local deadmob = original:match('%w+ defeats[%s%a%a%a]- (.*).')
+
+ if deadmob then
+ deadmob = deadmob.gsub(deadmob, "the ", "")
+ end
+
+ if deadmob == mob then
+
+ th:text('No current mob')
+ th:hide()
+ mob = nil
+ end
end)
windower.register_event('zone change', function()
- th:text('No current mob')
- th:hide()
+ th:text('No current mob')
+ th:hide()
end)
\ No newline at end of file