Make filters reload when zoning #1

Merged
atom0s merged 2 commits from :master into master 6 years ago
  1. 22
      filters.lua

22
filters.lua

@ -25,7 +25,7 @@
_addon.author = 'atom0s'; _addon.author = 'atom0s';
_addon.name = 'filters'; _addon.name = 'filters';
_addon.version = '3.0.0'; _addon.version = '3.0.1';
require 'common' require 'common'
@ -37,6 +37,7 @@ filters.pointer = ashita.memory.findpattern('FFXiMain.dll', 0, 'C3C740040000
filters.pointer2 = 0; filters.pointer2 = 0;
filters.offset = 0; filters.offset = 0;
filters.current = nil; filters.current = nil;
filters.currentName = '(None)';
---------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
-- func: msg -- func: msg
@ -101,6 +102,7 @@ ashita.register_event('command', function(command, ntype)
-- Write the filters to memory.. -- Write the filters to memory..
local pointer = ashita.memory.read_uint32(filters.pointer2); local pointer = ashita.memory.read_uint32(filters.pointer2);
filters.current = f.filters; filters.current = f.filters;
filters.currentName = name;
-- Send the filter update packet.. -- Send the filter update packet..
local packet = local packet =
@ -177,6 +179,24 @@ ashita.register_event('incoming_packet', function(id, size, data)
packet[0x15] = realpacket[0x15]; packet[0x15] = realpacket[0x15];
return packet; return packet;
-- Zone In packet
elseif (id == 0x000A) then
if (filters.current ~= nil and #filters.current > 0) then
-- Send the filter update packet..
local packet =
{
0xB4, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x40, 0x02, 0x00, 0x00, 0x00
};
-- Set the packet filter info..
for x = 1, #filters.current do
packet[4 + x] = filters.current[x];
end
AddIncomingPacket(0xB4, packet);
msg('Re-loaded filter set: ' .. filters.currentName);
end
end end
return false; return false;

Loading…
Cancel
Save