"Leave" Add-on Easily Take You Out Of Event Zones

Eorzea Time
 
 
 
Language: JP EN FR DE
users online
Forum » Windower » General » "Leave" add-on easily take you out of event zones
"Leave" add-on easily take you out of event zones
Offline
Posts: 1274
By DaneBlood 2023-03-19 23:35:34
Link | Quote | Reply
 
so i got tired of using my glowing lamp rather than dropping to drop things when i needed to use so i started this little add-on called Leave
Leave will make you drop or use whatever items or Key items is needed to get out of the event zone

It works like Myhome:
leave - takes you out
leave all - takes all your characters out

It assume you have treasury loaded to handle the drop of items (I trust their code better than mine)(drop handling is now handled natively due to treasury's racing bug)
It will also pass on everything in the pool so you don't leave people waiting for the animation and warp time before they can get their loot.
Currently trying to get it to drop cells from salvage one so you don't have to do that cleanup manually

https://gist.github.com/DaneBlood/b1c1c48d4f07fc9cab54404871b0a596


New Link:
https://gist.github.com/SvenBent/98c8c52387de91c5aa3b111048f8c633
[+]
 
Offline
Posts:
By 2023-03-20 09:13:11
 Undelete | Edit  | Link | Quote | Reply
 
Post deleted by User.
[+]
Offline
Posts: 1274
By DaneBlood 2023-03-20 17:29:43
Link | Quote | Reply
 
KujahFoxfire said: »
Looks interesting!

One bit of feedback I would say is to avoid using the ingame treasury commands as a multiboxer always ends up messing up my settings.xml file. I wrote my own code a long time ago to drop ein lamp:
Code
function drop_lamp()
	local inventory = windower.ffxi.get_items(0)
	for i=1,inventory.max do
		if inventory[i].id == 5414 then
			windower.add_to_chat(007,'Lamp Found')
			windower.ffxi.drop_item(i,1)
			return
		end
	end
	windower.add_to_chat(007,'No Lamp')
end


You are spot on.
I for a moment forgot about the racing issue in treasury and it settings.xml.

I'll fix it in next release.
Really wish treasure saved settings in a file per character rather than a common one would fixed everything
VIP
Offline
Posts: 1088
By Lili 2023-03-21 16:57:03
Link | Quote | Reply
 
I did a buncha things.
necroskull Necro Bump Detected! [30 days between previous and next post]
Offline
Posts: 1274
By DaneBlood 2023-04-20 15:19:47
Link | Quote | Reply
 
I have update Leave.
Handles dropping of lamp natively so it no longer requires treasury (TY to KujahFoxfire)

It has experimental drop of cells from original salvage, when leaving. However it only drops 1 of each not the entire stack.
 Bismarck.Drakelth
Offline
Server: Bismarck
Game: FFXI
user: drakelth
Posts: 824
By Bismarck.Drakelth 2023-04-20 20:03:01
Link | Quote | Reply
 
DaneBlood said: »
It will also pass on everything in the pool so you don't leave people waiting for the animation and warp time before they can get their loot.
https://github.com/SvenBent/Leave/blob/main/Leave.lua

This is the best part imo, so many people don't realize just zoning slows it down for the other people waiting.
Offline
Posts: 1274
By DaneBlood 2023-05-15 12:14:33
Link | Quote | Reply
 
I fixed a bug where i had a space in the item name.
its an a new github account (im still trying to figure out github)
necroskull Necro Bump Detected! [296 days between previous and next post]
 Asura.Anybody
Offline
Server: Asura
Game: FFXI
user: Sisqo
Posts: 27
By Asura.Anybody 2024-03-06 14:40:30
Link | Quote | Reply
 
DaneBlood said: »
I fixed a bug where i had a space in the item name.
its an a new github account (im still trying to figure out github)

I love this Addon.

I just want to add a missing delve zone in line 158


Code
elseif var_thiszone == 271 or var_thiszone == 264 then -- Incursion & Delve
		greeting()
		windower.send_command('Input /item "Ontic Extremity" <me>')
[+]
necroskull Necro Bump Detected! [311 days between previous and next post]
Offline
Posts: 1274
By DaneBlood 2025-01-12 00:43:14
Link | Quote | Reply
 
Asura.Anybody said: »
DaneBlood said: »
I fixed a bug where i had a space in the item name.
its an a new github account (im still trying to figure out github)

I love this Addon.

I just want to add a missing delve zone in line 158


Code
elseif var_thiszone == 271 or var_thiszone == 264 then -- Incursion & Delve
		greeting()
		windower.send_command('Input /item "Ontic Extremity" <me>')


I took a break form the game before you posted this and just got back a few months ago.

ill get this fixed
 Asura.Lockhartt
Offline
Server: Asura
Game: FFXI
user: Dembe
Posts: 21
By Asura.Lockhartt 2025-01-12 08:10:53
Link | Quote | Reply
 
In addition to the above, I added this.
Code
elseif var_thiszone == 298 or var_thiszone == 279 then -- Odyssey & HTMB: A Stygian Pact, Champion of the Dawn, Divine Interference, Maiden of the Dusk
[+]
necroskull Necro Bump Detected! [40 days between previous and next post]
Offline
By Draylo 2025-02-20 20:11:56
Link | Quote | Reply
 
The download in OP didn't include the last line of code Lockhartt had posted. So not working in Maiden until you add the code he posted.
necroskull Necro Bump Detected! [177 days between previous and next post]
Offline
Posts: 1274
By DaneBlood 2025-08-16 20:41:59
Link | Quote | Reply
 
New updated, i honestly did this a long time ago but apparently never update it in public

https://gist.github.com/SvenBent/98c8c52387de91c5aa3b111048f8c633
[+]
necroskull Necro Bump Detected! [51 days between previous and next post]
 Fenrir.Brimstonefox
Offline
Server: Fenrir
Game: FFXI
user: Brimstone
Posts: 339
By Fenrir.Brimstonefox 2025-10-06 12:15:07
Link | Quote | Reply
 
DaneBlood said: »
KujahFoxfire said: »
Looks interesting!

One bit of feedback I would say is to avoid using the ingame treasury commands as a multiboxer always ends up messing up my settings.xml file. I wrote my own code a long time ago to drop ein lamp:
Code
function drop_lamp()
	local inventory = windower.ffxi.get_items(0)
	for i=1,inventory.max do
		if inventory[i].id == 5414 then
			windower.add_to_chat(007,'Lamp Found')
			windower.ffxi.drop_item(i,1)
			return
		end
	end
	windower.add_to_chat(007,'No Lamp')
end


You are spot on.
I for a moment forgot about the racing issue in treasury and it settings.xml.

I'll fix it in next release.
Really wish treasure saved settings in a file per character rather than a common one would fixed everything

So i copied this and renamed it to drop_wing (not that that matters) and changes the number for Obsid. Wing, to do the D obj. in sortie but it says "not found" any ideas why?

(best guess inventory.max doesn't account for the temp items in sortie?)
VIP
Offline
Posts: 1088
By Lili 2025-10-06 14:19:46
Link | Quote | Reply
 
Fenrir.Brimstonefox said: »
So i copied this and renamed it to drop_wing (not that that matters) and changes the number for Obsid. Wing, to do the D obj. in sortie but it says "not found" any ideas why?

The code you quoted specifies 0 as the parameter for get_items(), which means to only pull the list from the Inventory bag. The Temporary bag is separate from the Inventory bag. You will need to use the right number on the second line.
 Bismarck.Radec
Offline
Server: Bismarck
Game: FFXI
user: Radec
Posts: 164
By Bismarck.Radec 2025-10-06 14:49:05
Link | Quote | Reply
 
drop_item() takes an index without specifying the bag, as well - if the wing is 'index 4' in bag 3, won't drop_item(4,1) drop the 4th index in your inventory bag?
VIP
Offline
Posts: 1088
By Lili 2025-10-06 15:43:58
Link | Quote | Reply
 
Bismarck.Radec said: »
drop_item() takes an index without specifying the bag, as well - if the wing is 'index 4' in bag 3, won't drop_item(4,1) drop the 4th index in your inventory bag?

windower.ffxi.drop_item(slot, count) takes two arguments, but only lets you drop an item present in main Inventory, as for the longest time that was the only bag you could drop stuff from. Currently, to drop items from Temporary or other bags, you can inject manually a custom 0x028 packet.
 Fenrir.Brimstonefox
Offline
Server: Fenrir
Game: FFXI
user: Brimstone
Posts: 339
By Fenrir.Brimstonefox 2025-10-06 22:13:36
Link | Quote | Reply
 
Bismarck.Radec said: »
drop_item() takes an index without specifying the bag, as well - if the wing is 'index 4' in bag 3, won't drop_item(4,1) drop the 4th index in your inventory bag?

Wish i had seen this before I starting futzing and toss my mallquis trews +2, I immediately knew what happened, once my wife asked me to go to the store and get milk and then she says if they have eggs, get a dozen, then she yelled at me for bringing home 12 milks.

Thank God for the recycle bin!




Lili said: »
windower.ffxi.drop_item(slot, count) takes two arguments, but only lets you drop an item present in main Inventory, as for the longest time that was the only bag you could drop stuff from. Currently, to drop items from Temporary or other bags, you can inject manually a custom 0x028 packet.

Would this work?
Code
function drop_wing()
    local inventory = windower.ffxi.get_items(3)
    for i=1,inventory.max do
		windower.add_to_chat(007,i..inventory[i].id)
        if inventory[i].id == 6685 then
            windower.add_to_chat(007,'Wing Found')
            local drop_packet = packets.new('outgoing', 0x028, {
                    ["Count"] = 1,
                    ["Bag"] = 3,
                    ["Inventory Index"] = i,
                })
			packets.inject(drop_packet)
            return
        end
    end
    windower.add_to_chat(007,'No Wing')
end
VIP
Offline
Posts: 1088
By Lili 2025-10-07 04:40:20
Link | Quote | Reply
 
Fenrir.Brimstonefox said: »
Would this work?

Looks about right, try and see what happens.

Also, while it never happens, if item IDs ever get shifted around you risk losing something. I'd recommend to pull the item ID from resources at the start of the addon. I normally don't recommend this since item resources are by far the biggest table and take the most ram, but dropping items is a critical enough operation that you should do it.
 Fenrir.Brimstonefox
Offline
Server: Fenrir
Game: FFXI
user: Brimstone
Posts: 339
By Fenrir.Brimstonefox 2025-10-07 10:42:46
Link | Quote | Reply
 
Lili said: »
Also, while it never happens, if item IDs ever get shifted around you risk losing something. I'd recommend to pull the item ID from resources at the start of the addon. I normally don't recommend this since item resources are by far the biggest table and take the most ram, but dropping items is a critical enough operation that you should do it.

Given that its only the temp bag and recycle bin is a thing, its probably ok? I could probably restrict it to that zone as well, worst case I toss a temp item that is easy to get again?
[+]
 Carbuncle.Nynja
Offline
Server: Carbuncle
Game: FFXI
user: NynJa
Posts: 6149
By Carbuncle.Nynja 2025-10-07 11:09:19
Link | Quote | Reply
 
Couldnt you implement a check comparing item ID and name on use? Or is that the same thing wrt pulling resources on load?
 Fenrir.Brimstonefox
Offline
Server: Fenrir
Game: FFXI
user: Brimstone
Posts: 339
By Fenrir.Brimstonefox 2025-10-07 12:22:58
Link | Quote | Reply
 
Carbuncle.Nynja said: »
Couldnt you implement a check comparing item ID and name on use? Or is that the same thing wrt pulling resources on load?

I'm sure Lili would provide a better answer but since you'd still need to read the entire items resource to provide the table map, I'd say same thing. Although you could theoretically do this on load and throw an error (or set an error flag) if this one item doesn't match and then unload the table I suppose.
[+]
 Fenrir.Brimstonefox
Offline
Server: Fenrir
Game: FFXI
user: Brimstone
Posts: 339
By Fenrir.Brimstonefox 2025-10-07 21:37:32
Link | Quote | Reply
 
I tested it out and it works.