Add/Remove Items To/From Player Bank?
Hey Guys,
I've tried to find the function for this but I cant seem to. I want to add and remove items from the player's bank when at the bank screen. I see these two functions...
Thanks. |
PlaceInInventory protected (integer bagId, integer slotIndex)
PickupInventoryItem protected (integer bagId, integer slotIndex, integer count) bagId would be 2 for the player bank, slotIndex the item you want taken out ( not necessarily the one you see at that position on screen though. |
Or
|
None of those worked for me...
I submitted an addon that uses the "protected" functions - and works.
You have to do something like: CallSecureProtected("PickupInventoryItem", fromBag, fromSlot, quantity) Here's a git repo https://github.com/bradgearon/eso-stuff Stuff.lua line 11 and 14 are the important chunks... |
Quote:
|
Thanks everyone for the replies. I'm sure one of these suggestions will work. :)
|
Quote:
Quote:
Quote:
I then tried CallSecureProtected("PlaceInInventory", fromBag, fromSlot) but this didn't seem to be able to move banked items into the inventory. So it seems I'm still stuck. Are we even supposed to be able to use protected functions? I thought the purpose of those was to not allow modders access to those. Seems pretty silly that moving items around in a player's inventory/bank space would be protected anyway. Edit: Actually I think I got it working... Here is my code that worked (for testing): Code:
CallSecureProtected("PickupInventoryItem", 1, 1, 1) |
Quote:
|
I see. That makes sense. So the protected functions can be called, they just have to or should be called using CallSecureProtected()?
|
Protected might be restricted from being use while in Combat, for example.
|
d'oh. Sometimes I am so brain dead.
Yes, if they are along the lines of WoW's secure handlers there is a distinct possibility you won't be able to do certain stuff during combat. |
Quote:
Code:
function stackItem(fromBag, fromSlot, toBag, toSlot, quantity, name) |
Ahh not a bad little function. I'm curious what the name parameter is for since it doesn't seem to be used anywhere within the function.
|
Name parameter
Was fallout from refactoring... At first I was logging in that function and wanted to see the name but later moved things around and my trust for the callsecureprotected thing increased :)
|
MovingItem
Hi,
i moved my item with the functions mentioned above and it works ... but than moving more than one FindFirstEmptySlotInBag(2) always reports the same position to insert new item, which does not work naturally ... how can I update bag so its finds a new empty SLot? -- must call secure protected (pickup the item via cursor) result = CallSecureProtected("PickupInventoryItem", item.bag, item.slot, item.stack) if (result) then -- must call secure protected (drop the item on the cursor) result = CallSecureProtected("PlaceInInventory", toBag, toSlot) end |
I just wanted to say thanks for this thread which has brought to my attention the CallSecureProtected method.
Where did you find out about it? Is there documentation somewhere which I can read? |
I dug...
I found out about that from digging, completely. There is no documentation anywhere. Hopefully there will be at some point, but it shows up in the raw dump -- so I simply tried calling it will string functionName and args purely by convention, assumption, and a tiny bit of trial and error. It did take me around 2-4 hours to finally find it though, during which I came very close to giving up (but giving up something like that for me is usually much more difficult that finishing it). thus....
|
Quote:
|
yes calling the moveItem function now with 200ms delay between each call and that works ...
|
All times are GMT -6. The time now is 04:58 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI