How to check if you've stopped following.
I'm trying to write an addon that sends a messsage from my slaves to my main whenever they stop following, but there doesn't seem to be anything in the API that returns whether or not the character's in the "following" state.
Wondering if anyone has some good ideas about how to do this.
RE: How to check if you've stopped following.
Quote:
Originally Posted by 'mmcookies',index.php?page=Thread&postID=105805#po st105805
I'm trying to write an addon that sends a messsage from my slaves to my main whenever they stop following, but there doesn't seem to be anything in the API that returns whether or not the character's in the "following" state.
Wondering if anyone has some good ideas about how to do this.
Check for the "You are following blah" frame being visible. Don't know it's name, but it's the yellow text in the middle of your screen. This is the absolute most reliable way I found to handle this.
RE: How to check if you've stopped following.
Quote:
Originally Posted by 'mmcookies',index.php?page=Thread&postID=105805#po st105805
I'm trying to write an addon that sends a messsage from my slaves to my main whenever they stop following, but there doesn't seem to be anything in the API that returns whether or not the character's in the "following" state.
Wondering if anyone has some good ideas about how to do this.
There is an event in the API AUTOFOLLOW_END. So when your addon loads make sure you run <frame name>:RegisterEvent("AUTOFOLLOW_END");, than in your event function you can check (i would check that you aren't in combat first because you stop following if you attack something a lot of times, and you don't want the spam, or maybe you do), combat is also an event PLAYER_ENTER_COMBAT (or LEAVE, dont' forget to check for both, just like follow follows other is BEGIN). Anyways in the event function if (not in combat and autofollow_end) then sendchatmessage("<name> has stopped following you.","WHISPER","COMMOND",<name of main>);
This is all off the top of my head, so grammar and maybe i got something wrong, but generally this is how you do that. I used to write addons, but now i just do it for myself. I used to get alot of tells on my other toons, so i wrote addon to autoreply with a canned response, I also can whisper my other accounts and make them do stuff (although that i don't do as much anymore since i've found this sight and AHK, i've been dual boxing for over a year, but was very inneffecient), but anytime I need something simple, and don't need a huge mod to take care of it, i'll just write it myself. If you ever need api info the WoWWiki is where I usually go to find it. http://www.wowwiki.com/World_of_Warcraft_API
RE: RE: How to check if you've stopped following.
Quote:
Originally Posted by 'dardack',index.php?page=Thread&postID=105870#post 105870
There is an event in the API AUTOFOLLOW_END. So when your addon loads make sure you run <frame name>:RegisterEvent("AUTOFOLLOW_END");, than in your event function you can check (i would check that you aren't in combat first because you stop following if you attack something a lot of times, and you don't want the spam, or maybe you do), combat is also an event PLAYER_ENTER_COMBAT (or LEAVE, dont' forget to check for both, just like follow follows other is BEGIN). Anyways in the event function if (not in combat and autofollow_end) then sendchatmessage("<name> has stopped following you.","WHISPER","COMMOND",<name of main>;);
Word of warning: I found that "AUTOFOLLOW_END" was somewhat unreliable for some reason. I wrote a mod that used that event, and occasionally I would find a slave not following and had never received any notification. My best guess is that there is some other event that occurs, which also implies AUTOFOLLOW_END, so it doesn't post that event, but I was never able to narrow it down further.
Zanthor's suggestion has some merit too.
What I wound up doing is checking distances, and if any of my slaves were beyond a certain distance, it would flash an annoying message. I had it so it could be toggled, in case you had one off training or something. This worked really well overall.