Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions addons/organizer/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,28 @@ local items = {}
local bags = {}
local item_tab = {}

local nomad_moogle
local clear_moogles
do
local names = {'Nomad Moogle', 'Pilgrim Moogle'}
local moogles = {}
local poked = false
local block_menu = false

clear_moogles = function()
moogles = {}
poked = false
end

local poke_moogle = function(npc)
local p = packets.new('outgoing', 0x1a, {
["Target"] = npc.id,
["Target Index"] = npc.index,
})
poked = true
block_menu = true
packets.inject(p)
repeat
coroutine.sleep(0.4)
until not block_menu
end

nomad_moogle = function()
Expand All @@ -53,11 +67,21 @@ do
for _, moo_index in ipairs(moogles) do
local moo = windower.ffxi.get_mob_by_index(moo_index)
if moo and (moo.x - player.x)^2 + (moo.y - player.y)^2 < 36 then
return true
if not poked then
poke_moogle(moo)
end
return moo.name
end
end
return false
end

windower.register_event('incoming chunk',function(id)
if id == 0x02E and block_menu then
block_menu = false
return true
end
end)
end

windower.register_event('zone change',function()
Expand Down
33 changes: 22 additions & 11 deletions addons/organizer/organizer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@
--(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
--SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

res = require 'resources'
files = require 'files'
require 'pack'
Items = require 'items'
extdata = require 'extdata'
logger = require 'logger'
require 'tables'
require 'lists'
require 'functions'
config = require 'config'
slips = require 'slips'
res = require('resources')
files = require('files')
require('pack')
Items = require('items')
extdata = require('extdata')
logger = require('logger')
require('tables')
require('lists')
require('functions')
config = require('config')
slips = require('slips')
packets = require('packets')

_addon.name = 'Organizer'
_addon.author = 'Byrth, maintainer: Rooks'
Expand Down Expand Up @@ -243,6 +244,11 @@ windower.register_event('addon command',function(...)
return
end

local moogle = nomad_moogle()
if moogle then
org_debug("command", "Using '" .. moogle .. "' for Mog House interaction")
end

local bag = 'all'
if inp[1] and (_static.bag_ids[inp[1]:lower()] or inp[1]:lower() == 'all') then
bag = table.remove(inp,1):lower()
Expand Down Expand Up @@ -299,6 +305,11 @@ windower.register_event('addon command',function(...)
windower.send_command('input /heal')
end

if moogle then
clear_moogle()
org_debug("command", "Clearing '" .. moogle .. "' status")
end

org_debug("command", "Organizer complete")

end)
Expand Down