Advertisement
Guest User

AH fix cata

a guest
Jun 26th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. local last_search = 0;
  2. local version = "1.2";
  3.  
  4. local frame = CreateFrame("FRAME");
  5. frame:RegisterEvent("AUCTION_ITEM_LIST_UPDATE");
  6. frame:RegisterEvent("AUCTION_HOUSE_SHOW");
  7.  
  8. local origCanSendAuctionQuery = CanSendAuctionQuery;
  9. CanSendAuctionQuery = function(...)
  10. if (last_search + 1.2 > GetTime()) then
  11. return false, false;
  12. else
  13. return origCanSendAuctionQuery(...);
  14. end
  15. end
  16.  
  17. local origQueryAuctionItems = QueryAuctionItems;
  18. QueryAuctionItems = function(...)
  19. last_search = GetTime();
  20. return origQueryAuctionItems(...);
  21. end
  22.  
  23. local eventHandler = function(self, event, ...)
  24. if (event == "AUCTION_ITEM_LIST_UPDATE") then
  25. if (last_search + 0.2 < GetTime()) then
  26. last_search = GetTime() - 0.2;
  27. end
  28. elseif (event == "AUCTION_HOUSE_SHOW") then
  29. DEFAULT_CHAT_FRAME:AddMessage("Molten AH-fix v"..version.." loaded.", 0.5, 0.5, 1);
  30. frame:UnregisterEvent("AUCTION_HOUSE_SHOW");
  31. end
  32. end
  33. frame:SetScript("OnEvent", eventHandler);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement