From ff8c91a4e9b3d3b2f604bce24c58ddedae7340e8 Mon Sep 17 00:00:00 2001 From: atom0s Date: Sat, 19 Jan 2019 19:41:37 -0800 Subject: [PATCH] AllMaps should now be able to display maps while viewing homepoints, waypoints, and other warping features that will automatically open the map to display the area. --- allmaps.lua | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/allmaps.lua b/allmaps.lua index 86bb537..c95e625 100644 --- a/allmaps.lua +++ b/allmaps.lua @@ -25,7 +25,7 @@ _addon.author = 'atom0s'; _addon.name = 'allmaps'; -_addon.version = '3.0.0'; +_addon.version = '3.0.1'; require 'common' @@ -33,7 +33,8 @@ require 'common' -- allmaps Table --------------------------------------------------------------------------------------------------- local allmaps = { }; -allmaps.pointer = ashita.memory.findpattern('FFXiMain.dll', 0, '50??????????83C4048886????????0FBF8E????????8A', 0x01, 0); +allmaps.pointer1 = ashita.memory.findpattern('FFXiMain.dll', 0, '50??????????83C4048886????????0FBF8E????????8A', 0x01, 0); +allmaps.pointer2 = ashita.memory.findpattern('FFXiMain.dll', 0, '50??????????83C4048886????????0FBF96????????8A', 0x01, 0); ---------------------------------------------------------------------------------------------------- -- func: load @@ -41,18 +42,21 @@ allmaps.pointer = ashita.memory.findpattern('FFXiMain.dll', 0, '50??????????83C4 ---------------------------------------------------------------------------------------------------- ashita.register_event('load', function() -- Validate the pointers.. - if (allmaps.pointer == 0) then - print('\31\200[\31\05' .. 'allmaps'.. '\31\200]\30\01 ' .. '\30\68Failed to find required signature.\30\01'); + if (allmaps.pointer1 == 0 or allmaps.pointer2 == 0) then + print('\31\200[\31\05' .. 'allmaps'.. '\31\200]\30\01 ' .. '\30\68Failed to find required signature(s).\30\01'); return; end -- Backup the function data.. - allmaps.backup = ashita.memory.read_array(allmaps.pointer, 5); + allmaps.backup1 = ashita.memory.read_array(allmaps.pointer1, 5); + allmaps.backup2 = ashita.memory.read_array(allmaps.pointer2, 5); -- Overwrite the function.. local patch = { 0xB8, 0x01, 0x00, 0x00, 0x00 }; - ashita.memory.write_array(allmaps.pointer, patch); + ashita.memory.write_array(allmaps.pointer1, patch); + ashita.memory.write_array(allmaps.pointer2, patch); print(string.format('\31\200[\31\05' .. 'allmaps'.. '\31\200] \31\130Function patched; /map should now display all maps as if you own them.')); + print(string.format('\31\200[\31\05' .. 'allmaps'.. '\31\200] \31\130Function patched; viewing homepoint/waypoint warps should now display maps.')); end); ---------------------------------------------------------------------------------------------------- @@ -61,7 +65,10 @@ end); ---------------------------------------------------------------------------------------------------- ashita.register_event('unload', function() -- Restore the map function patch.. - if (allmaps.backup ~= nil) then - ashita.memory.write_array(allmaps.pointer, allmaps.backup); + if (allmaps.backup1 ~= nil) then + ashita.memory.write_array(allmaps.pointer1, allmaps.backup1); + end + if (allmaps.backup2 ~= nil) then + ashita.memory.write_array(allmaps.pointer2, allmaps.backup2); end end); \ No newline at end of file