From a19284c9267d73693b8f699564906d883de1c6b3 Mon Sep 17 00:00:00 2001 From: Tornac Date: Sat, 16 May 2020 09:18:23 -0700 Subject: [PATCH] default attachements on load error fixed I went a different way with getting the default attachments from memory. Tested and working. --- pupatt.lua | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/pupatt.lua b/pupatt.lua index 2743d84..ea976e3 100644 --- a/pupatt.lua +++ b/pupatt.lua @@ -25,7 +25,7 @@ _addon.author = 'tornac'; _addon.name = 'pupatt'; -_addon.version = '1.07'; +_addon.version = '1.10'; --------------------------------- --DO NOT EDIT BELOW THIS LINE @@ -96,6 +96,9 @@ ashita.register_event('incoming_packet', function(id, size, packet) end end end + if (id == 0x000A) then + attFromMemory() + end return false; end); @@ -238,7 +241,6 @@ end ashita.register_event('render', function() -- Process the objectives packet queue.. process_queue(); - attFromMemory(); end); --------------------------------------------------------------------------------------------------- @@ -294,21 +296,17 @@ end; --------------------------------------------------------------- function attFromMemory() - if (currentAttachments[1] == nil) then - local pointer1 = ashita.memory.findpattern('FFXiMain.dll', 0, 'C1E1032BC8B0018D????????????B9????????F3A55F5E5B', 10, 0); - if (pointer1 == 0) then - err('Failed to locate current attachments, please cycle a attachment to continue.'); - else - local offset1 = ashita.memory.read_uint32(pointer1); - pointer = ashita.memory.read_uint32(AshitaCore:GetPointerManager():GetPointer('inventory')); - pointer = ashita.memory.read_uint32(pointer); - currentAttachments = ashita.memory.read_array((pointer + offset1) + offset, 0x0E); - if (currentAttachments ~= nil) then - for i = 1, 14 do - currentAttachments[i] = string.format("0x%X" , currentAttachments[i]); - end - end - end + local pointer1 = ashita.memory.findpattern('FFXiMain.dll', 0, 'C1E1032BC8B0018D????????????B9????????F3A55F5E5B', 10, 0); + if (pointer1 == 0) then + err('Failed to locate current attachments, please cycle a attachment to continue.'); + else + local offset1 = ashita.memory.read_uint32(pointer1); + pointer = ashita.memory.read_uint32(AshitaCore:GetPointerManager():GetPointer('inventory')); + pointer = ashita.memory.read_uint32(pointer); + currentAttachments = ashita.memory.read_array((pointer + offset1) + offset, 0x0E); + for i = 1, 14 do + currentAttachments[i] = string.format("0x%X" , currentAttachments[i]); + end end end;