Guest User

Untitled

a guest
Mar 30th, 2020
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local AutoDismount = CreateFrame("Frame")
  2.  
  3. AutoDismount.Errors = {
  4. [50] = SPELL_FAILED_NOT_MOUNTED,
  5. [198] = ERR_ATTACK_MOUNTED,
  6. [213] = ERR_TAXIPLAYERALREADYMOUNTED,
  7. }
  8.  
  9. function AutoDismount:UI_ERROR_MESSAGE(id)
  10. if self.Errors[id] then
  11. Dismount()
  12. end
  13. end
  14.  
  15. function AutoDismount:TAXIMAP_OPENED()
  16. Dismount()
  17. end
  18.  
  19. function AutoDismount:OnEvent(self, event, ...)
  20. if self[event] then
  21. self[event](self, ...)
  22. end
  23. end
  24.  
  25. AutoDismount:RegisterEvent("UI_ERROR_MESSAGE")
  26. AutoDismount:RegisterEvent("TAXIMAP_OPENED")
  27. AutoDismount:SetScript("OnEvent", AutoDismount.OnEvent)
RAW Paste Data