Thread Tools Display Modes
Today, 01:26 AM   #1
foxy93
Join Date: Jul 2024
Posts: 1
Question New to coding addons, having issues with bank

Hi!! I'm new to making addons!

I'm trying to make a simple 'bank everything' addon that was supposed to get all the items in the selected inventory filter like if I select reagents (or its 'sub filters' like woodworking, alchemy, etc), or select weapons or armour and then press the designated keybinding, it would deposit everything (or as much stuff as possible) in the bank.

I know there are some banking add-ons out there, but they either are not working/outdated or they are full of functions I don't need and probably will never use, I just need a simple one that will do this and I decided to venture into making my own to see if I could do it. Alas... it is not working as I expected...

After hours of looking for information, I found some and was trying to use the PickupInventoryItem() and PlaceInInventory(), but apparently they are protected and I had to use that secure call thingy, and indeed, it seems to be picking the items, but that is when the problem happen... I keep getting kicked out of the server for 'spamming messaging' for some reason when the function tries to do this and I don't know why. Not even an error message, it just kicks me out of the game when I fire the function and I dont know what to do to make this work...

Also for some reason my addon don't appear in the Controls menu to set a different keybinding, I think I might have done the xml wrong?

I wonder if I can get some help here? I hosted the code on my GitHub so you guys can see what I'm trying to do: https://github.com/TheLastDarkthorne/AmyBankEverything

Thank you very much!

Last edited by foxy93 : Today at 01:43 AM. Reason: wrong function name
  Reply With Quote
Today, 02:29 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,169
Hi foxy,

for your simple purpose you can use my addon DoItAll as it got a simple bank all, extract all (glyphs), deconstruct all, attach all to mail and automatically send and repeat until nothing left, attach all to player tarde functions for the currently visible/filtered (also repecting filtered by AdvancedfIlters, FCOItemSaver filtered, FCOCraftFilter filtered, blocked, proteted by FCOItemSaver) items.

If you think that's still too much for your purpose and you want to learn spy my code there for the BankAll.
For all of the features it basically reuses a class "Slots" that get's all the slots of the current inventory, and then loops them and skips protected and also delays the deposit or withdraw by a defined (LAM Settings menu) delay so you do not get kicked by the server for message spam.
-> search for zo_callLater for the delay.

Also for some reason my addon don't appear in the Controls menu to set a different keybinding, I think I might have done the xml wrong?
<Layer name="Amy's Bank Everything">
That's not working.
afaik you need to use the layer
SI_KEYBINDINGS_CATEGORY_GENERAL

And the binding itsself in the XML needs to strip the SI_BINDING_NAME_ prefix then!

And then use use the string constant there via e.g. SI_BINDING_NAME_* in your lua code.
Create the string for them in your addon like described here
https://wiki.esoui.com/How_to_add_lo...eating_strings


Example lua code (in your callback function for EVENT_ADD_ON_LOADED e.g.):
Lua Code:
  1. ZO_CreateStringId("SI_BINDING_NAME_FCOISFILTER1", "My keybind one")

Example XML code:
Code:
<Bindings>
  <Layer name="SI_KEYBINDINGS_CATEGORY_GENERAL">
    <Category name="|c00FF00FCO |cFFFF00Item Saver|r">

      <Action name="FCOISFILTER1">
        <Down>FCOIS.ShowFCOItemSaverSettings()</Down>
      </Action>

Last edited by Baertram : Today at 02:38 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » New to coding addons, having issues with bank


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off