diff --git a/addons/ConsoleBG/ConsoleBG.lua b/addons/ConsoleBG/ConsoleBG.lua index 3c7b88606..db6ed5c5a 100644 --- a/addons/ConsoleBG/ConsoleBG.lua +++ b/addons/ConsoleBG/ConsoleBG.lua @@ -8,16 +8,16 @@ require('logger') defaults = {} defaults.bg = {} -defaults.bg.alpha = 255 +defaults.bg.alpha = 192 defaults.bg.red = 0 defaults.bg.green = 0 defaults.bg.blue = 0 defaults.pos = {} -defaults.pos.x = 1 -defaults.pos.y = 25 +defaults.pos.x = 0 +defaults.pos.y = 0 defaults.extents = {} -defaults.extents.x = 600 -defaults.extents.y = 314 +defaults.extents.x = 7680 +defaults.extents.y = 360 settings = config.load(defaults) @@ -76,11 +76,11 @@ windower.register_event('addon command', function(command1, ...) end elseif (command1 == 'Position' or command1 == 'Size') then if ((2 > argcount) or (argcount > 2)) then - error('Invalid syntax. Check the "help" command.') + error('Invalid syntax. Check the "help" command.') else consolesettings(command1, ...) end - + end elseif command1 == 'help' then @@ -94,7 +94,7 @@ windower.register_event('addon command', function(command1, ...) else error('Unknown command! Use the "help" command for a list of commands.') - + end end) diff --git a/addons/Dimmer/Dimmer.lua b/addons/Dimmer/Dimmer.lua index 6520909b0..bf64f9bfb 100644 --- a/addons/Dimmer/Dimmer.lua +++ b/addons/Dimmer/Dimmer.lua @@ -75,7 +75,7 @@ function search_item() log_flag = false log('Item use within 3 seconds..') end - until ext.usable or delay > 10 + until ext.usable or delay > 30 end windower.chat.input('/item '..windower.to_shift_jis(stats[lang])..' ') break; @@ -101,4 +101,4 @@ windower.register_event('ipc message',function (msg) if msg == 'dimmer' then windower.chat.input('//dimmer') end -end) \ No newline at end of file +end) diff --git a/addons/MyHome/MyHome.lua b/addons/MyHome/MyHome.lua index 46dfe658a..5116cc343 100644 --- a/addons/MyHome/MyHome.lua +++ b/addons/MyHome/MyHome.lua @@ -74,7 +74,7 @@ function search_item() log_flag = false log('Item use within 3 seconds..') end - until ext.usable or delay > 10 + until ext.usable or delay > 30 end windower.chat.input('/item '..windower.to_shift_jis(stats[lang])..' ') break; diff --git a/addons/addons.xml b/addons/addons.xml index 6286a66f4..bee570b84 100644 --- a/addons/addons.xml +++ b/addons/addons.xml @@ -819,8 +819,15 @@ IndiNope Lili - Block graphical effects from Geomancer's Indi- spells. + Blocks graphical effects from Geomancer's Indi- spells. https://github.com/Windower/Lua/issues https://github.com/lili-ffxi + + position_manager + Lili + Allows you to set a screen position per character name. Each character will be moved to that screen position on login. Requires the WinControl plugin to be installed. + https://github.com/Windower/Lua/issues + https://github.com/lili-ffxi + diff --git a/addons/battlemod/battlemod.lua b/addons/battlemod/battlemod.lua index f8d9ed365..b5bc7ba44 100644 --- a/addons/battlemod/battlemod.lua +++ b/addons/battlemod/battlemod.lua @@ -12,7 +12,7 @@ require 'generic_helpers' require 'parse_action_packet' require 'statics' -_addon.version = '3.25' +_addon.version = '3.26' _addon.name = 'BattleMod' _addon.author = 'Byrth, maintainer: SnickySnacks' _addon.commands = {'bm','battlemod'} diff --git a/addons/battlemod/parse_action_packet.lua b/addons/battlemod/parse_action_packet.lua index a0134df87..e45f9984c 100644 --- a/addons/battlemod/parse_action_packet.lua +++ b/addons/battlemod/parse_action_packet.lua @@ -159,8 +159,9 @@ function parse_action_packet(act) for i,v in pairs(act.targets) do for n,m in pairs(v.actions) do if m.message ~= 0 and res.action_messages[m.message] ~= nil then + local col = res.action_messages[m.message].color local targ = assemble_targets(act.actor,v.target,act.category,m.message) - local color = color_filt(res.action_messages[m.message].color,v.target[1].id==Self.id) + local color = color_filt(col,v.target[1].id==Self.id) if m.reaction == 11 and act.category == 1 then m.simp_name = 'parried by' elseif m.reaction == 12 and act.category == 1 then m.simp_name = 'blocked by' elseif m.message == 1 then m.simp_name = 'hit' @@ -188,7 +189,7 @@ function parse_action_packet(act) elseif m.message == 437 or m.message == 438 then m.simp_name = act.action.name..' (JAs and TP)' elseif m.message == 439 or m.message == 440 then m.simp_name = act.action.name..' (SPs, JAs, TP, and MP)' elseif T{252,265,268,269,271,272,274,275,379,650}:contains(m.message) then m.simp_name = 'Magic Burst! '..act.action.name - elseif not act.action then + elseif not act.action then m.simp_name = '' act.action = {} else m.simp_name = act.action.name or '' @@ -262,7 +263,7 @@ function parse_action_packet(act) :gsub('${item2}',color_it(act.action.item2 or 'ERROR 121',color_arr.itemcol)) :gsub('${weapon_skill}',color_it(act.action.weapon_skill or 'ERROR 114',color_arr.wscol)) :gsub('${abil}',m.simp_name or 'ERROR 115') - :gsub('${numb}',numb or 'ERROR 116') + :gsub('${numb}',col == 'D' and color_it(numb or 'ERROR 116', color_arr[act.actor.damage]) or (numb or 'ERROR 116')) :gsub('${actor}',color_it((act.actor.name or 'ERROR 117' ) .. (act.actor.owner_name or "") ,color_arr[act.actor.owner or act.actor.type])) :gsub('${target}',targ) :gsub('${lb}','\7') @@ -275,7 +276,8 @@ function parse_action_packet(act) end if m.has_add_effect and m.add_effect_message ~= 0 and add_effect_valid[act.category] then local targ = assemble_targets(act.actor,v.target,act.category,m.add_effect_message) - local color = color_filt(res.action_messages[m.add_effect_message].color,v.target[1].id==Self.id) + local col = res.action_messages[m.add_effect_message].color + local color = color_filt(col,v.target[1].id==Self.id) if m.add_effect_message > 287 and m.add_effect_message < 303 then m.simp_add_name = skillchain_arr[m.add_effect_message-287] elseif m.add_effect_message > 384 and m.add_effect_message < 399 then m.simp_add_name = skillchain_arr[m.add_effect_message-384] elseif m.add_effect_message > 766 and m.add_effect_message < 769 then m.simp_add_name = skillchain_arr[m.add_effect_message-752] @@ -295,7 +297,7 @@ function parse_action_packet(act) :gsub('${item}',act.action.item or 'ERROR 129') :gsub('${weapon_skill}',act.action.weapon_skill or 'ERROR 130') :gsub('${abil}',m.simp_add_name or act.action.name or 'ERROR 131') - :gsub('${numb}',numb or 'ERROR 132') + :gsub('${numb}',col == 'D' and color_it(numb or 'ERROR 132', color_arr[act.actor.damage]) or (numb or 'ERROR 132')) :gsub('${actor}',color_it(act.actor.name,color_arr[act.actor.owner or act.actor.type])) :gsub('${target}',targ) :gsub('${lb}','\7') @@ -308,20 +310,25 @@ function parse_action_packet(act) end if m.has_spike_effect and m.spike_effect_message ~= 0 and spike_effect_valid[act.category] then local targ = assemble_targets(act.actor,v.target,act.category,m.spike_effect_message) - local color = color_filt(res.action_messages[m.spike_effect_message].color,act.actor.id==Self.id) + local col = res.action_messages[m.spike_effect_message].color + local color = color_filt(col,act.actor.id==Self.id) + local actor = act.actor if m.spike_effect_message == 14 then m.simp_spike_name = 'from counter' elseif T{33,606}:contains(m.spike_effect_message) then m.simp_spike_name = 'counter' + actor = v.target[1] --Counter dmg is done by the target, fix for coloring the dmg elseif m.spike_effect_message == 592 then m.simp_spike_name = 'missed counter' elseif m.spike_effect_message == 536 then m.simp_spike_name = 'retaliation' + actor = v.target[1] --Retaliation dmg is done by the target, fix for coloring the dmg elseif m.spike_effect_message == 535 then m.simp_spike_name = 'from retaliation' else m.simp_spike_name = 'spikes' + actor = v.target[1] --Spikes dmg is done by the target, fix for coloring the dmg end local msg = simplify_message(m.spike_effect_message) @@ -332,7 +339,7 @@ function parse_action_packet(act) :gsub('${item}',act.action.item or 'ERROR 144') :gsub('${weapon_skill}',act.action.weapon_skill or 'ERROR 145') :gsub('${abil}',m.simp_spike_name or act.action.name or 'ERROR 146') - :gsub('${numb}',numb or 'ERROR 147') + :gsub('${numb}',col == 'D' and color_it(numb or 'ERROR 147', color_arr[actor.damage]) or (numb or 'ERROR 147')) :gsub((simplify and '${target}' or '${actor}'),color_it(act.actor.name,color_arr[act.actor.owner or act.actor.type])) :gsub((simplify and '${actor}' or '${target}'),targ) :gsub('${lb}','\7') @@ -460,7 +467,7 @@ end function player_info(id) local player_table = windower.ffxi.get_mob_by_id(id) - local typ,owner,filt,owner_name + local typ,dmg,owner,filt,owner_name if player_table == nil then return {name=nil,id=nil,is_npc=nil,type='debug',owner=nil, owner_name=nil,race=nil} @@ -471,10 +478,13 @@ function player_info(id) typ = i if i == 'p0' then filt = 'me' + dmg = 'mydmg' elseif i:sub(1,1) == 'p' then filt = 'party' + dmg = 'partydmg' else filt = 'alliance' + dmg = 'allydmg' end end end @@ -485,11 +495,13 @@ function player_info(id) typ = 'other_pets' filt = 'other_pets' owner = 'other' + dmg = 'otherdmg' for i,v in pairs(windower.ffxi.get_party()) do if type(v) == 'table' and v.mob and v.mob.pet_index and v.mob.pet_index == player_table.index then if i == 'p0' then typ = 'my_pet' filt = 'my_pet' + dmg = 'mydmg' end owner = i owner_name = showownernames and '(' .. v.mob.name .. ')' @@ -498,6 +510,7 @@ function player_info(id) if i == 'p0' then typ = 'my_fellow' filt = 'my_fellow' + dmg = 'mydmg' end owner = i owner_name = showownernames and '(' .. v.mob.name .. ')' @@ -507,6 +520,7 @@ function player_info(id) else typ = 'mob' filt = 'monsters' + dmg = 'mobdmg' if filter.enemies then for i,v in pairs(Self.buffs) do @@ -531,10 +545,11 @@ function player_info(id) else typ = 'other' filt = 'others' + dmg = 'otherdmg' end end if not typ then typ = 'debug' end - return {name=player_table.name,id=id,is_npc = player_table.is_npc,type=typ,filter=filt,owner=(owner or nil), owner_name=(owner_name or nil),race = player_table.race} + return {name=player_table.name,id=id,is_npc = player_table.is_npc,type=typ,damage=dmg,filter=filt,owner=(owner or nil), owner_name=(owner_name or nil),race = player_table.race} end function get_spell(act) diff --git a/addons/blist/blist.lua b/addons/blist/blist.lua index a04dfd497..509d6c1a5 100644 --- a/addons/blist/blist.lua +++ b/addons/blist/blist.lua @@ -33,7 +33,7 @@ _addon.version = '1.2.0.1' require 'tables' require 'strings' -require 'colors' +require 'chat/colors' local config = require 'config' require 'logger' diff --git a/addons/libs/packets/fields.lua b/addons/libs/packets/fields.lua index 97f4b6ae1..8f97f064e 100644 --- a/addons/libs/packets/fields.lua +++ b/addons/libs/packets/fields.lua @@ -925,7 +925,7 @@ fields.outgoing[0x0C0] = L{ -- /makelinkshell fields.outgoing[0x0C3] = L{ {ctype='unsigned char', label='_unknown1'}, -- 04 - {ctype='unsigned char', label='Linkshell Numbger'}, -- 05 + {ctype='unsigned char', label='Linkshell Number'}, -- 05 {ctype='data[2]', label='_junk1'} -- 05 } @@ -2641,7 +2641,7 @@ fields.incoming[0x056] = function (data, type) end func.incoming[0x056].type = L{ - {ctype='int', label='Type', fn=e+{'quest_mission_log'}} -- 24 + {ctype='short', label='Type', fn=e+{'quest_mission_log'}} -- 24 } func.incoming[0x056][0x0080] = L{ @@ -3408,7 +3408,7 @@ fields.incoming[0x0E0] = L{ -- Party Member List fields.incoming[0x0E1] = L{ {ctype='unsigned short', label='Party ID'}, -- 04 For whatever reason, this is always valid ASCII in my captured packets. - {ctype='unsigned short', label='_unknown1', const=0x0080}, -- 06 Likely contains information about the current chat mode and vote count + {ctype='unsigned short', label='_unknown1', const=0x8000}, -- 06 Likely contains information about the current chat mode and vote count } -- Char Info diff --git a/addons/libs/xml.lua b/addons/libs/xml.lua index 075b34e4c..fc5c9bc45 100644 --- a/addons/libs/xml.lua +++ b/addons/libs/xml.lua @@ -567,7 +567,7 @@ function table.to_xml(t, indentlevel) end if type(val) == 'table' and next(val) then str = str..indent..'<'..key..'>\n' - str = str..table.to_xml(val, indentlevel + 1)..'\n' + str = str..table.to_xml(val, indentlevel + 1) str = str..indent..'\n' else if type(val) == 'table' then diff --git a/addons/pointwatch/pointwatch.lua b/addons/pointwatch/pointwatch.lua index bc4f181ff..8eac64d95 100644 --- a/addons/pointwatch/pointwatch.lua +++ b/addons/pointwatch/pointwatch.lua @@ -315,13 +315,13 @@ function exp_msg(val,msg) elseif msg == 371 or msg == 372 then lp.registry[t] = (lp.registry[t] or 0) + val lp.current = lp.current + val - if lp.current + val >= lp.tnm and lp.number_of_merits ~= lp.maximum_merits then + if lp.current >= lp.tnm and lp.number_of_merits ~= lp.maximum_merits then -- Merit Point gained! - lp.number_of_merits = lp.number_of_merits + math.min(math.floor(lp.current/lp.tnm),lp.maximum_merits) + lp.number_of_merits = math.min(lp.number_of_merits + math.floor(lp.current/lp.tnm),lp.maximum_merits) lp.current = lp.current%lp.tnm else -- If a merit point was not gained, - lp.current = math.min(lp.current+val,lp.tnm-1) + lp.current = math.min(lp.current,lp.tnm-1) end end update_box() diff --git a/addons/position_manager/README.md b/addons/position_manager/README.md new file mode 100644 index 000000000..541d0c4e4 --- /dev/null +++ b/addons/position_manager/README.md @@ -0,0 +1,31 @@ +# Position Manager + +Set and save screen position per-character. + +Command: `//pm set [name]` + +`pos_x` and `pos_y` are obligatory and must be numbers. +`name` is optional. If no name is provided, settings will be saved for the current character. +`:all` is a special name that can be used to set the default position. + +**Note**: Characters are only moved after they're logged in. The `:all` position will be used for the character login screen as well. + +### Examples: +`//pm set 0 0` +Will set your _current_ character to the position X: 0, Y: 0. + +`//pm set 0 60 :all` +Will set the default positioning for all characters to X: 0 and Y: 60 (the height of the Windows 10 taskbar with 150% UI scaling.), and delete all other character-specific settings. + +`//pm set 1920 0 Yourname` +Will set the default position for the character called "Yourname" to X: 1920 and Y: 0. +This will make the character appear on the secondary screen that is to the right of the main screen - useful for multi-screen setups. + +`//pm set Yourmain 0 40` +`//pm set Youralt 800 40` +Will set your main to X: 0, Y: 40, and your alt to the X: 800, Y: 40. +If your laptop screen is 1600px wide, and your instances are both set at 800x600, this will put them side by side. + +**Warning:** the `all` name will delete every other character-specific settings that are already saved! It's best to use it only once after you install the addon, to set default position for non-specified characters. + +Enjoy. diff --git a/addons/position_manager/position_manager.lua b/addons/position_manager/position_manager.lua new file mode 100644 index 000000000..bdc289930 --- /dev/null +++ b/addons/position_manager/position_manager.lua @@ -0,0 +1,97 @@ +--Copyright © 2020, Lili +--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 position_manager 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 Lili 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 = 'position_manager' +_addon.author = 'Lili' +_addon.version = '1.0.1' +_addon.command = 'pm' + +if not windower.file_exists(windower.windower_path .. '\\plugins\\WinControl.dll') then + print('position_manager: error - Please install the WinControl plugin in the launcher.') + windower.send_command('lua u position_manager') + return +else + print('position_manager: loading WinControl...') + windower.send_command('load wincontrol') +end + +config = require('config') + +default = { + x = 0, + y = 0, +} + +settings = config.load(default) + +function move(settings) + windower.send_command('wincontrol move %s %s':format(settings.x, settings.y)) +end + +function handle_commands(cmd, pos_x, pos_y, name) + cmd = cmd:lower() or 'help' + + if cmd == 'r' then + windower.send_command('lua r position_manager') + elseif cmd == 'set' and pos_x and pos_y then + if name ~= nil and type(name) ~= 'string' then + windower.add_to_chat(207, 'plugin_manager: ERROR - invalid name provided.') + windower.send_command('pm help') + return + elseif not name then + name = windower.ffxi.get_player().name + elseif name == ':all' then + name = 'all' + end + + settings.x = tonumber(pos_x) + settings.y = tonumber(pos_y) + if settings.x and settings.y then + config.save(settings, name) + else + windower.add_to_chat(207, 'plugin_manager: ERROR - invalid position provided.') + windower.send_command('pm help') + return + end + + -- TODO: possibly add IPC + if windower.ffxi.get_info().logged_in then + player_name = windower.ffxi.get_player().name + if name:lower() == player_name:lower() then + move(settings) + end + end + elseif cmd == 'help' then + windower.add_to_chat(207, 'position_manager: Usage: //pm set [name]') + windower.add_to_chat(207, 'position_manager: See the readme for details.') + else + windower.add_to_chat(207, 'position_manager: %s command not found.':format(cmd)) + windower.send_command('pm help') + end +end + +config.register(settings, move) +windower.register_event('addon command', handle_commands)