Log in

View Full Version : How to check if you've stopped following.



mmcookies
08-18-2008, 01:20 PM
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.

moog
08-18-2008, 01:42 PM
Check out "OhNoes", written by Depherios...

[Addon] OhNoes: Screen Coloring/Alert addon. Updated! ('http://www.dual-boxing.com/forums/index.php?page=Thread&postID=93601')

It flashes the whole screen red if you drop off follow.

Not quite what you asked for but thought it worth bringing to your attention :)

zanthor
08-18-2008, 01:43 PM
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.

Ughmahedhurtz
08-18-2008, 01:45 PM
Check out "OhNoes", written by Depherios...

[Addon] OhNoes: Screen Coloring/Alert addon. Updated! ('http://www.dual-boxing.com/forums/index.php?page=Thread&postID=93601')

It flashes the whole screen red if you drop off follow.

Not quite what you asked for but thought it worth bringing to your attention :)This. HIGHLY recommended. It's a very annoying screen flash, especially if you tweak it a bit. Makes it totally obvious when someone breaks follow. Also doesn't spam you silly with it every time you press the follow key again like that other mod did.

dardack
08-18-2008, 03:08 PM
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

BobGnarly
08-18-2008, 04:25 PM
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.

Ughmahedhurtz
08-18-2008, 05:00 PM
Hmm....apologies for my first response. Space cadet Ugh didn't read. :P On a related note, though, I've NEVER seen that mod fail to report a stopped /follow, so I'd look at the events he's trapping and just do something like that.

Talos
08-18-2008, 05:04 PM
have you checked out the Multiboxer V2 addon which was created by one of our own and posted on this forum ???

besides handy tricks like autoaccepting trades and quests it also shows a window
showing the party members name in green when they are in /follow followed by the name they are following
and the name in red when they are not in /follow

let me grab you a link

edit: [Addon] Multiboxer V2 ('http://www.dual-boxing.com/forums/index.php?page=Thread&threadID=7195&pageNo=1&highlight=multiboxerv2')
edit2: http://www.dual-boxing.com/wiki/index.php/Category:Addon:MultiboxerV2

dardack
08-18-2008, 07:06 PM
Edited: What I posted, was fixed soon there after, please ignore.

Thanks for the link. I've written my own that has some of that, but am anxious to check it out, hope i can ditch my own efforts.

mmcookies
12-23-2008, 02:41 PM
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.So after working on other higher priority addons, I've recently came back to this...

In response to zanthor's comment, I went and dug up some wow's ui code

The following is in ZoneText.lua


function AutoFollowStatus_OnEvent(self, event, ...)
if ( event == "AUTOFOLLOW_BEGIN" ) then
local arg1 = ...;
self.unit = arg1;
self.fadeTime = nil;
self:SetAlpha(1.0);
AutoFollowStatusText:SetFormattedText(AUTOFOLLOWST ART,self.unit);
self:Show();
end
if ( event == "AUTOFOLLOW_END" ) then
self.fadeTime = AUTOFOLLOW_STATUS_FADETIME;
AutoFollowStatusText:SetFormattedText(AUTOFOLLOWST OP,self.unit);
self:Show();
end
if ( event == "PLAYER_ENTERING_WORLD" ) then
self:Hide();
end
end
As you can see, the autfollow status frame is also hidden by the "PLAYER_ENTERING_WORLD" event.

Perhaps this is the implied AUTOFOLLOW_END that's causing inconsistencies?

eqjoe
12-23-2008, 03:41 PM
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.TwoBoxToolkit is an addon that has this built in. Check it out and see how that handles follow breaking...

-j

zanthor
12-23-2008, 03:44 PM
Personally at this point I'd check Jamba-Follow. It's very good at notifications of follow failure.

mmcookies
12-23-2008, 05:25 PM
Personally at this point I'd check Jamba-Follow. It's very good at notifications of follow failure.Nah, after having some room to think about the features I need, I'm probably just going to make the AutoFollowStatusText more noticeable (bigger and brighter).

mmcookies
12-23-2008, 06:23 PM
Success! This is the extremely simple addon I wrote just now.
I run the 4 shammies on a second comp and monitor so this is perfect for me.
It makes the follow text big and bright yellow on my slave screens (with shadowed outline).
On breaking follow, it displays huge red text that fades away as normal.


function PM_BigFollow_OnLoad()
this:RegisterEvent("AUTOFOLLOW_BEGIN");
this:RegisterEvent("AUTOFOLLOW_END");
end;

function PM_BigFollow_OnEvent(event)
if PM_IsSlave(UnitName("player")) then
if event == "AUTOFOLLOW_BEGIN" then
AutoFollowStatusText:SetFontObject(NumberFont_Outl ine_Huge);
AutoFollowStatusText:SetTextHeight(40);
AutoFollowStatusText:SetTextColor(1.0, 1.0, 0.0, 1.0);
elseif event == "AUTOFOLLOW_END" then
AutoFollowStatusText:SetFontObject(NumberFont_Outl ine_Huge);
AutoFollowStatusText:SetTextHeight(80);
AutoFollowStatusText:SetTextColor(1.0, 0.0, 0.0, 1.0);
end;
end;
end;