• Visit Rebornbuddy
  • [Bot] PokehBuddy (Conversion of Plugin)

    Discussion in 'Botbases' started by sychotix, Dec 16, 2013.

    1. sychotix

      sychotix New Member

      Joined:
      Dec 13, 2013
      Messages:
      727
      Likes Received:
      5
      Trophy Points:
      0
      Heavily based off of PokehBuddy the plugin! Huge thanks to Team Random for a bunch of functions!

      I sent him a PM and posted in the thread, but there was no reply. Since the bot still contains a lot of his functions, I will have this thread removed if he asks. (at least until I can minimize that)

      Anyways...

      This post will be brief for now. If I don't go over something, check the thread linked at the top.

      What it does (copy/pasted from thread):
      Wild pet Battle
      Leveling pets
      PVP Battle every X to Y minutes
      Catch by quality
      Catch if quality is better than what we have

      Avoid lowlevel
      Avoid high level
      Auto heal pets / Bandage pets
      Abandon fights if nothing catch worthy is in the fight.

      And more! [stuff I've added but forgotten]
      Why convert this to a BotBase:
      The overall design of the bot was honestly not well suited for a plugin, as well as the code (no offense to the developers) not being very elegant or optimized. Instead of trying to find a way to do what a BotBase should in a Plugin, I spent the last couple days converting and improving the old Plugin. Also, the bot can now be used with FrameLock on, flawlessly (at least for me)

      How to install:
      SVN: pokehbuddy - Revision 24: /trunk (Place into the folder /Bots/PokehBuddy/) CAPS ARE IMPORTANT FOR NOW

      I update this SVN quite often (I have already fixed/tweaked it 2 or 3 times since posting this). Make sure to update this often.

      How to use:
      1) Load up a profile which includes hotspots. I suggest using PetArea and the profiles listed in the thread linked at the top for pet (and player) leveling.
      2) Click Bot Settings
      3) Edit settings, especially the Pet Logic settings for each pet (you can find some premade pet logic settings in the thread linked above)
      4) Ensure you have 3 pets equipped and have the pet rez skill
      4) Press start
      5) ????
      6) Profit!

      Known Bugs/Todo:

      * WildPetBattleTarget (or w/e) is called twice, should only be called once if possible.
      *
      * Allow groundmount only movement [Flightor defaults to Navigator?]
      * clean up output [Should be pretty clean]
      * Sometimes lags when starting flight? [Flightor?]
      * Fights pets any time it sees them (If within level range), I like this feature however.
      * Cannot travel cross continent.
      * I don't think this will try to use flight-paths
      * Logics can continually swap pets in and out if all 3 pets are below their swapout threshold.
      * Swapping to second/swapping to third happens sometimes. Fix logic.
      * For some reason, always wants to switch when below 30 HP or something?
      * Some sort of memory leak in WoW. No idea what.
      *
      * Optimize and update legacy code

      Help! I'm having problems!
      Calm down bro! It will be alright! Ensure you are running the most up to date version, as I updated often. If you are, post in this thread and assume the party escort position so I, or some other awesome person, can be there to assist you shortly and bringing you to your cake.

      Battle Pet Swapper support:
      Apparently this plugin but this post has a fix for the pulse.

      If you have any suggestions or want to report bugs, please let me know! I've been deving and testing this pretty much non-stop for the past couple of days. Works really well by itself, or (only one tested) with BGBuddy!
       

      Attached Files:

      dutamulia likes this.
    2. sychotix

      sychotix New Member

      Joined:
      Dec 13, 2013
      Messages:
      727
      Likes Received:
      5
      Trophy Points:
      0
      Oh, and reserved.
       
    3. yajinni

      yajinni New Member

      Joined:
      Jan 20, 2011
      Messages:
      422
      Likes Received:
      1
      Trophy Points:
      0
      Man I have been hoping for sn update to that plugin. Can you implement pet switching for lvling purposes like the battle pet swapper plugin?

      Sent from my Samsung Note 2 using TheBuddyForum mobile app
       
    4. sychotix

      sychotix New Member

      Joined:
      Dec 13, 2013
      Messages:
      727
      Likes Received:
      5
      Trophy Points:
      0
      Pet swapping for leveling purposes as in what? It already swaps pets (that are equipped) to ensure that everyone gets experience equally.

      EDIT: Ahh, I see what you mean. This isn't something I would want to include by default, so I will have to work on adding settings. I haven't done anything with the settings yet, but do plan on making some changes to it. I doubt I will get to that tonight, so I'll probably look into that tomorrow.

      EDIT2: Actually, it looks like the battle pet swapper plugin is already well made. Unless it has problems while running my bot, I'd recommend just using it.
       
    5. AknA

      AknA Well-Known Member Buddy Store Developer

      Joined:
      Feb 11, 2012
      Messages:
      1,794
      Likes Received:
      65
      Trophy Points:
      48
      You might want to fix this asap, you're not allowed to release code that contains a .dll
       
    6. sychotix

      sychotix New Member

      Joined:
      Dec 13, 2013
      Messages:
      727
      Likes Received:
      5
      Trophy Points:
      0
      Fixed.

      Yes. In fact, that is all I have used it for. It has been pathing in one area all night leveling up a character for me.
       
    7. virtual

      virtual Member

      Joined:
      Jan 15, 2010
      Messages:
      753
      Likes Received:
      18
      Trophy Points:
      18
      It would be so awesome if you get the pet swapping working. I know there is a plug for swapping pets but they aren't around as far as i know there are no updates no replies and it does not work, it uses the same pet over and over again and does not swap pets.
      I know a lot of us are just using this plug in/ botbase to level our pets and it kinda defeats the purpose if it doesn't work for leveling.
       
    8. TreeK

      TreeK New Member

      Joined:
      Jul 10, 2012
      Messages:
      170
      Likes Received:
      1
      Trophy Points:
      0
      Easy enough to get the battle pet swapper plugin working: [PLUGIN] Pok?buddy - Gotto kill em all!
       
    9. sychotix

      sychotix New Member

      Joined:
      Dec 13, 2013
      Messages:
      727
      Likes Received:
      5
      Trophy Points:
      0
      The only function that plugin has over my bot is that it automatically will pull pets from the PetJournal. It works fine for leveling pets that you have equipped (Try using PetArea + 2 level 1's and a level 25, setting the level 1's logic to swap the pet out on the first round). I havn't quite tested the "ringer" logic, but as long as WildPetLevel - PetLevel is less than or equal to the fight pets X levels lower than my lowest pet setting, it should throw them out first.

      If you guys REALLY want the bot to try leveling every single pet in your journal, I can try to add the function though.

      EDIT: Or what he said ^.^

      Also, currently working on trying to completely redo the way that the BotBase gets information about the pets. Currently, this is done through a mass amount of LUA calls. I am going to try and reduce it down to one (or at least 3) LUA calls to update the info for our pets.
       
    10. TreeK

      TreeK New Member

      Joined:
      Jul 10, 2012
      Messages:
      170
      Likes Received:
      1
      Trophy Points:
      0
      Doesn't seem to be capturing pets correctly. Tried using capture when 'Rare', and 'when higher than I have', and in both cases the bot selected an attack rather than the capture action.

      Like how you cleaned up the messages and got rid of the endless mounting attempts. Nice job. Hope you and maybe can co-exist, or work together on this.

      Any chance you could grab the BPS plugin and host the fixed version on your svn? Might help keep you from getting overrun by people asking for that functionality...
       
    11. sychotix

      sychotix New Member

      Joined:
      Dec 13, 2013
      Messages:
      727
      Likes Received:
      5
      Trophy Points:
      0
      That is odd, I have yet to see it miss trapping something it should (when it could trap that is). I assume this would be a rare case where the mobs HP drops after it has passed through the shouldTrap decorator? Can you reproduce the problem?

      And I did WAY more than two simple things =P The overall structure is completely changed. It went from being a pulse function with a bunch of nested if-else statements to being a full blown behavior tree.
       
    12. TreeK

      TreeK New Member

      Joined:
      Jul 10, 2012
      Messages:
      170
      Likes Received:
      1
      Trophy Points:
      0
      It is reproducible here, have it set to capture better than I have and have been in many fights with pets I do not have and is has not tried to catch a single pet. I'm on a remote connection right now, hard to look into it too much. I'll take a look this evening and see if I can narrow it down a bit.
       
    13. sychotix

      sychotix New Member

      Joined:
      Dec 13, 2013
      Messages:
      727
      Likes Received:
      5
      Trophy Points:
      0
      Well, I haven't seen it happen and the logic looks fine to me (but, I assume if it does happen, it is caused by how fast the logic runs).

      In other news, I have made some HUGE changes to how we get and store our pets information. Previously, almost any time we needed information about our pets, a LUA call would be made for that one piece. This, in many cases, would lead to a large number of LUA calls being done unnecessarily. Now, all information about our pets have been stored and are updated at the start of any function that needs information about our pets. This may introduce problems with the bot not always having 100% up to date information, but I hope this will never be the case (or at least that it won't matter). The way it is currently setup also requires all 3 pets to be updated, as I have not worked on anything dealing with detection of who is currently in battle (i.e. our active pet and the enemies active pet). This will hopefully come in a future update.
       
    14. TreeK

      TreeK New Member

      Joined:
      Jul 10, 2012
      Messages:
      170
      Likes Received:
      1
      Trophy Points:
      0
      Yes, it was related to the speed at which the tree is processed. In effect shouldTrap() was being called before the opponent finsihed processing so CanFight() was always false at the time we checked if we should trap. I fixed this by skipping the tree until CanFight() returns true:

      Code:
              public Composite createPetCombatBehavior()
              {
                  return new PrioritySelector(
      		new Decorator(ret => mustSelectNew(),
                              SelectNewAction()),
      		[B]new Decorator(ret=>!CanFight(),
      			new ActionAlwaysSucceed()),[/B]
                      new Decorator(ret => shouldTrap(),
                              TrapPetAction()),
                      new Decorator(ret => shouldForfeit(),
                              forfeitBattleAction()),
                      PetBattleAttackAction()
                      );
              }
      One other thing I noticed is that when set to 'Is better...' poor quality pets are never caught. To fix this I modified 1 line in shouldTrap():

      Code:
      if (minrarity < 1) minrarity = 0;
      Feel free to test/modify/ignore as needed. I'm just starting to test here, will update if I run into any problems.
       
    15. TreeK

      TreeK New Member

      Joined:
      Jul 10, 2012
      Messages:
      170
      Likes Received:
      1
      Trophy Points:
      0
      The only issue I could see with that is when building the logic for a pet. I often change the settings on the fly and watch the battle to see if what I changed worked. I guess a simple stop/start would be all that is needed to get the logic updated after I changed the logic file now, correct?
       
    16. sychotix

      sychotix New Member

      Joined:
      Dec 13, 2013
      Messages:
      727
      Likes Received:
      5
      Trophy Points:
      0
      Logic should update the same as it did before. I am only changing the way that it gets stats such as health. Also, will look into your suggestions. Thanks!

      On a side note, working reducing the LUA calls for active pets. Got the functions setup, just have to make the bot use them.

      EDIT: Also, I have a question about your second suggestion. When will minrarity ever be less than 0? It seems like the purpose of that line was to make sure that we don't catch poor quality pets. I am going to add your suggestion as it won't hurt though (for now).

      EDIT2: I noticed I big error >.< Working on fixing it now, hope it didn't make its way into one of the updates.
       
    17. TreeK

      TreeK New Member

      Joined:
      Jul 10, 2012
      Messages:
      170
      Likes Received:
      1
      Trophy Points:
      0
      Okay, I misunderstood upon first read. Sounds like a good improvement.

      Good on the LUA reduction. I know on the CC side of things LUA is to be avoided whenever possible as it is slow. Sure it wouldn't hurt to reduce it as much as possible here as well.

      Well, I never use the "Is better..." option, so I'm not sure how it works in the plugin. I assumed that when selected it would capture any quality pet if you had none, which is not what it was doing. The lowest quality is 1 - poor. The change I made just sets the compare value to 0 if you have no pets to allow a poor quality pet to be captured. It is what I assumed the option would do. No biggy, I never use it myself (except when testing the capture code today...)
       
    18. sychotix

      sychotix New Member

      Joined:
      Dec 13, 2013
      Messages:
      727
      Likes Received:
      5
      Trophy Points:
      0
      Huge update, lots of internal changes. Swapping pets seems to still be a little wonky, but I haven't eaten today =P Should probably do that.

      EDIT: Oh god, I think I messed something up again >.< Well... back to trying to fix it. Minimizing the LUA calls this time messed up a lot of things. I'm pretty sure you can revert to a different version on the SVN if you need to.

      EDIT2: Thank god. Should be fixed now. I quite literally spent all of today making this BotBase run faster =P
       
    19. sychotix

      sychotix New Member

      Joined:
      Dec 13, 2013
      Messages:
      727
      Likes Received:
      5
      Trophy Points:
      0
      Btw, I have noticed that WoW sometimes runs out of memory when using my bot. I do not know why, but I suspect something to do with the LUA calls? If anyone has any ideas, let me know.

      EDIT: Btw, this is only after a very long time of use, which means you may want to restart wow before you go to AFK overnight. It is possible that this is not a gradual memory leak and is caused by repeatedly doing a single action due to a flaw in logic. No idea what though. The last thing it shows in the logs is trying to interact with something, but there is a blacklist after 30 seconds anyways.

      EDIT2: On a side note, fixed a bug where it wasn't correctly updating the party's info while in combat. Apparently stuff in the PetJournal API is completely incorrect during combat. It now updates accordingly.
       
    20. ynoorbz

      ynoorbz Member

      Joined:
      Nov 24, 2010
      Messages:
      114
      Likes Received:
      2
      Trophy Points:
      18
      Really glad that you've tried to rekindle some life into what was starting to seem like a dying plugin. Hopefully given time you can get it working better than before. Even though the plugin version worked fine for me most of the time there's s always room for improvement :). I look forward to future updates :D
       

    Share This Page