[LUA] Postal Addon/Mailbox retrieve script help menu

User Tag List

Results 1 to 1 of 1
  1. #1
    dealerx's Avatar Member
    Reputation
    9
    Join Date
    May 2016
    Posts
    124
    Thanks G/R
    14/8
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA] Postal Addon/Mailbox retrieve script help

    Hello, I tried several addons for Mailbox management (like Postal), they are pretty much the same, they have this "Open all" button which opens every mail in the mailbox which contains golds/items/anything. The problem is these addons completely skip the trash mails, such as "Sale Pending" and similar, you need to cancel them manually one by one.

    So I wrote a simple script with PQR and it seemed to work, its basically something like this (the commands are fake, just so you understand the working, but if someone needs the real code I can give it, no problem)

    Code:
    mails = numbers of mails that can be retrieved (max 50, then you need to reloadUI if you have more pending)
    
    if mails > 0 then
     for i=1, mails do
      if email(slot1) has gold or email(slot1) has attachment then
      RetrieveItemsFromEmail(slot1)
      else
      DeleteEmail(slot1)
      end
      mails = mails -1
     end
    end
    And it worked perfectly with PQR. So I wrote that script into a LUA addon and put it on the Addons folder. I added a custom button "Open all" to fire the for cycle, and another one next to it that just ReloadUI().
    The problem is once I press the button, it does process the script only for the first email, so I need to click it for every single mail I have, to empty my mailbox. Yes, it deletes worthless mails without attachment and retrieves gold/items from the important ones, but I need to spam it and I don't know why it doesn't move to the next mail.
    I also put a debug "print(i)" when pressing the button, just to see the counter of the for cycle (I thought it was stucked after 1), and yes if I have let's say 12 emails, it prints correctly 1,2,3,4...until 12. But somehow instead of processing 12 emails, it processes the -script deletion- only for the first mail, and then stop it, and I need to press it again. As already said, the common addons work great, they loot one after one every email with just one click, but skipping the trash ones, and that's why I tried to write my personal script..
    Now I don't know if this is some stuff blocked by the server (I checked the lua commands and they are not protected), I don't know why these big and popular addons like Postal have the incapability of deleting trash mail such as money pending from AH.

    Concluding:
    1) Why using PQR the -for cycle- empties the mailbox flawless but writing the same code on an addon, it stop after first step of the for cycle and I need to keep pressing it?
    2) Why the addons are unable to auto delete trash mails? What's the deal?

    Thanks for reading

    [LUA] Postal Addon/Mailbox retrieve script help
  2. Thanks ninjabot (1 members gave Thanks to dealerx for this useful post)

Similar Threads

  1. LUA Script Help Thread
    By mager1794 in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 07-04-2008, 12:46 AM
  2. LuA Scripting Help
    By Jlp in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 06-27-2008, 03:33 AM
  3. Lua script help and general questions from beginner
    By WinKIller0 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 02-23-2008, 04:38 AM
  4. LUA Boss Script Help
    By neurothymia in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 02-05-2008, 02:57 PM
  5. Need LUA Scripting Help ?
    By Snailz in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 02-04-2008, 12:36 PM
All times are GMT -5. The time now is 03:28 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search