Advertisement
Guest User

Untitled

a guest
Feb 21st, 2016
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. local Pickmail_origfunc;
  2.  
  3. function PickMail_mailfunc()
  4. if (PickMail_origfunc ~= nil) then
  5. PickMail_origfunc();
  6. end;
  7. if (not InboxFrame.openMailID or OpenMailFrame.cod or not IsShiftKeyDown()) then
  8. return;
  9. end;
  10. local bodyText, texture, isTakeable = GetInboxText(InboxFrame.openMailID);
  11. if (OpenMailFrame.money) then
  12. TakeInboxMoney(InboxFrame.openMailID);
  13. end
  14. if (OpenMailFrame.itemName) then
  15. TakeInboxItem(InboxFrame.openMailID);
  16. end
  17. local packageIcon, stationeryIcon, sender, subject, money, CODAmount, daysLeft, itemID, wasRead, wasReturned, textCreated = GetInboxHeaderInfo(InboxFrame.openMailID);
  18. if ( money == 0 and not itemID and (bodyText == nil or bodyText == ""
  19. or (string.find(string.lower(bodyText), "item [0-9]+ out of [0-9]+") ~= nil))) then
  20. OpenMail_Delete();
  21. OpenMailFrame:Hide();
  22. end
  23. end
  24.  
  25. -- OnFoo Functions
  26. function PickMail_OnLoad()
  27. if (Sea ~= nil and Sea.util ~= nil and Sea.util.hook ~= nil) then
  28. Sea.util.hook("OpenMail_Update", "PickMail_mailfunc", "after");
  29. else
  30. PickMail_origfunc = OpenMail_Update;
  31. OpenMail_Update = PickMail_mailfunc;
  32. end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement