View Single Post
04-06-21, 10:37 AM   #19
DahkCeles
A Cliff Giant
 
DahkCeles's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2020
Posts: 73
Originally Posted by Walkerbo View Post
Yes, that was my goal, but I like a mystery and once I hit a limitation I wanted to follow it.

Well in that light.... here is the world's most inefficient way of doing it:

Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  3. f:HookScript("OnEvent", function(self, event, arg1, arg2, spellId)
  4.     if (event == "UNIT_SPELLCAST_SUCCEEDED" and GetSpellInfo(spellId):sub(1,10) == "Blingtron ") then
  5.         -- doSomething()
  6.     end
  7. end)

This checks every single spell cast, and queries for the spell name. If the first ten characters are "Blingtron " then it assumes it must be one of the Blingtron casts.

Suffice to say, I don't recommend actually trying this. The string function would probably be very wasteful on CPU resources in combat.
  Reply With Quote