Haha... would you look at that i figured it out myself!
I was almost on the right track... I'll post this for anyone else who might be trying to do a similar thing....
Code:
function TargetInfoStuff()
local frame2 = CreateFrame("Frame");
frame2:RegisterEvent("UI_ERROR_MESSAGE");
local function eventHandler(self, event, ...)
if event == "UI_ERROR_MESSAGE" then
local message = ...;
if message == "You are too far away!" then
--I put a bunch of code here
end
if message == "You are facing the wrong way!" then
-- aaaaand I put a bunch of code here
end
end
yay!!!