BG Flag Clicker Current version: 0.3 IMPORTANT: This has not been heavily tested. I ran a few ABs after getting the worst of the bugs fixed, I'm releasing it now since it's more reliable than 0.2. The guarding is currently a little unreliable, sometimes it works fine, other times it moves right on after capturing. But it will reliably path to/capture flags. IF YOU HAVE PROBLEMS, PLEASE POST A LOG, ALONG WITH AS MUCH DETAIL AS YOU CAN. My current testing is limited by queue times, if you post a log it will help me find problems that may not have showed up during testing. I currently have the plugin spamming the hell out of the debug log with anything that might be useful, I'll turn that all off as things clear up. What it Does: In AB (Tested) and IoC (Not Tested), it will look at nearby BG flags to determine their status. If there's a capturable flag, it will head over to it and interact with it. How to Configure It: At the moment, there's no options menu. Near the top of the file are the few configurable options. Code: private int InteractRange = 200; // Longer range lets it pick a target a little more realistically, but the navigation may mess up private bool MountEarly = true; // true = mounts while the gate is closed, false = normal HB private bool TargetWhileRunning = false; // true = if it runs into an enemy along the path, stop, false = just run, don't stop unless attacked private bool PullGuards = true; // true = target enemy players near the flag, false = just run in and try to capture, ignoring players private bool TeamPlayer = true; // true = hang out at our flags, even if I didn't click them, false = just run to the next flag private bool StayAtFlag = true; // true = wait at the flag after interacting, false = either move on to another flag or let the profile take over private int ExtraWait = 30; // Hang around for this many seconds after the flag actually captures. private bool ActiveGuard = true; // true = actively look for targets while waiting, false = just wait, do nothing unless attacked private int minNum = 1; // Shortest time between pulses private int maxNum = 5; // Longest time between pulses These are the only parts you should edit (unless you REALLY know what you're doing, and if you manage to improve things, please let me know). They should be pretty self-explanatory. What's Coming: Soon Improvements to the guarding system. Temporary blacklisting for flags that it's died running to. Future (Not coded at all yet): Options menu Possible support for other BG interactions and interactable objects (soulwells, mage tables, etc). Versions: v0.1 Initial Release v0.2 Cleaned up a lot of code (thanks, Apoc) More reliable flag status checking Better pathing to the flag More consistent pulse timing v0.3 Even more reliable flag status checking (seems perfect for both factions) Guarding captured flags Attacking enemies en route to the flag, or just near the flag Mounting before the BG begins
eots would be bad. you dont want your bot grabbing that flag, because it wont know to run back to a base to clam it, same thing in WSG you dont want your bot clicking flags because it wont know what to do with it. AV is fine, because at least its not doing anything that can messup the game for others.
Since its your 'first' plugin, I'll be nice. The isDead() function you can do the following: Code: return StyxWoW.Me.Dead || StyxWoW.Me.IsGhost; The isAlliance() function should be the following: Code: switch(StyxWoW.Me.Faction) { case 1: case 4: case 3: case 115: case 1629: return true; default: return false; } This ensures you only ever read Me.Faction once, instead of possibly 5 times. (Plus, it's just plain faster.) The supportedZone() function: This will be completely broken on non english clients. You can do the following to resolve that issue: Code: switch(StyxWoW.Me.MapId) { case 529: // Arathi Basin map ID case 628: // IoC map ID return true; default: return false; } As for the main Pulse() func; If you're checking for the objects, the easiest way to do so is the following: (keep in mind, I haven't tested this, so the game object type may be wrong!) Code: var objList = ObjectManager.GetObjectsOfType<WoWGameObject>(false).Where(o => o.SubType == WoWGameObjectType.FlagStand).OrderBy(o => o.Distance).ToList(); That'll alleviate your need for ID checking, and the obvious issues with checking by name. NEVER EVER EVER drop a while loop in the middle of a Pulse() function. Especially if you don't sleep the thread! You're starving the process, and Navigator.MoveTo can't do it's thing since it hasn't been able to move anywhere yet!
Sweet! Can't wait to use it. That way I don't have to come back to whispers like "Dude, why didn't capture the flag? You ran right by it and that Horde guy got it." Now, I'll just "fit in" like the rest of the Alliance and capture the flag and run away. LOL!
Thanks, this is exactly the kind of thing I was looking for. I'm a VB guy from way back (don't laugh), but C#, and especially being efficient with it, is all new. I'll make some changes and give it another test run. I was originally using InteractType instead of Faction/Name checking on the banners, but it was giving weird results. Horde banners were coming up non-interactable to an Alliance character, and "Alliance Banner Aura" was showing up as interactable and resulted in just standing around. I feel like the most accurate way of doing it would be to have the IDs, but that would wind up with 5 for each flag (and only the "untouched" version has an entry on wowhead). I suppose if it came down to it, I could dump the ID of everything it finds, I'd have them all after running enough battles that both sides capture each base at least once. [edit] I think I found a cleaner answer, just waiting on queues so I can test it... The Horde does the same thing in my BG... The only reason I'm testing it Alliance-side is the queues are a lot faster.
Why couldn't you have made this before the AB weekend! Dude, this looks really cool... I'll test it out tomorrow night on my hunter, could do with some honor and AB seems like a nice BG for it. Thanks
I know, I was watching my bot run past flags, wishing there was a plugin. Well, by the next AB weekend, it should be in a lot better shape. I hope to have an updated one out later tonight that runs a lot smoother and more realistically.
I know, this would have been amazing last weekend lol. It is still amazing but I dont generally play AB unless AB weekend. Then again, it is about the best BG to bot on lower level chars. Big thanks for this.
Updated to 0.2, enjoy. Programmers, feel free to pick it apart and let me know what I'm still doing wrong.
well since my battle group doesnt ever do AV, im so happy for this! my level 72 shaman cant do AV and the only thing ive found that i dont look botty doing is AB, so i will use the hell out of this plug in.
How do i do so it dsnt try to click on horde flags? Im horde and it does this all the time, then moves away to just move back to the flag and try clicking it again
It could be adapted to work with AV. I wanted to wait until I have a working GUI/settings file though, since there are certain things people like to avoid capturing. As for the development status - the detection seems to be working 100% now (it was two issues - the way the model names were reported, and me only checking one of the two possible "you can't click this" situations), and it mounts up before the gate actually opens. As long as your cc doesn't try to buff you as soon as preparation ends, it's been getting the first flag cap. The "target/attack flag guards" function seems to be working ok as well. Unfortunately, there's a fairly major glitch that's making the whole plugin sieze up if the flag changes unexpectedly (like someone else capturing the flag it's headed to). I think I'm close to fixing it, but thanks to AV weekend I can't actually test it. Hopefully early next week I'll have 0.3 out, but it all depends on queue times and getting that one bug fixed.
I've been trying to run this on Alliance and in Ioc is tries to click the Alliance flags in the base at the start :0