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

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

    1. standza

      standza Member

      Joined:
      Mar 16, 2012
      Messages:
      885
      Likes Received:
      4
      Trophy Points:
      18
      Keep swapping a pets for me 2. Nothing else :(
       
    2. hackersrage

      hackersrage Member Buddy Store Developer

      Joined:
      Nov 18, 2012
      Messages:
      342
      Likes Received:
      15
      Trophy Points:
      18
      It seems like this botbase has most of the kinks worked out from the plugin, however there is stil this error :

      Code:
      Compiler Error: d:\Library\Bots\HonorBuddy\Bots\PokehBuddy\PokehBuddy.cs(416,50) : error CS1501: No overload for method 'Dismount' takes 0 arguments
      
      I am looking into seeing what I can do to correct it.

      ---
      Update: This line needs to be updated to reference CommonCoroutines, however it is unclear how to reference this.

      I get " 'CommonCoroutines' does not exist in the current context" When I change the line to

      Code:
      if (Styx.StyxWoW.Me.Mounted) CommonCoroutines.LandAndDismount();
      
      or

      Code:
      if (Styx.StyxWoW.Me.Mounted) Styx.CommonCoroutines.LandAndDismount();
      
      The documentation just has this to say >> . From the reference list on the left, it looks like it is it's own class so it should be able to be called directly.

      The old command (in use that is erroring)
      says "ObsoleteAttribute("Use ActionLandAndDismount or CommonCoroutines.LandAndDismount instead")"

      ---------------
      Progress -- I think >>

      Code:
      \PokehBuddy\PokehBuddy.cs(418,71) : error CS1955: Non-invocable member 'Styx.CommonBot.Mount.ActionLandAndDismount' cannot be used like a method.
      
      Pretty sure I have the syntax correct
      Code:
      if (Styx.StyxWoW.Me.Mounted) Styx.CommonBot.Mount.ActionLandAndDismount();
      
      FIXED ---

      Code:
      if (Styx.StyxWoW.Me.Mounted) Styx.CommonBot.Coroutines.CommonCoroutines.LandAndDismount();
      
      ------

      Working on fixing PetArea to work again with it, and building all together.
       
      Last edited: Nov 5, 2014
    3. hackersrage

      hackersrage Member Buddy Store Developer

      Joined:
      Nov 18, 2012
      Messages:
      342
      Likes Received:
      15
      Trophy Points:
      18
      FIXED
      ---------
      I have corrected the plugin so that it now starts again. I can not attest to how well it will function, however I don't imagine it to be any more problematic than what it was originally. Hopefully the dev comes back and picks this up again. In the meantime, you can download a version that loads with Honorbuddy v2.5.11936.755.


      View attachment 149923
       
      Last edited: Nov 5, 2014
    4. Prostak

      Prostak Member

      Joined:
      Mar 17, 2013
      Messages:
      249
      Likes Received:
      16
      Trophy Points:
      18
      This default logic is intended to be used only with Ringerx2 BPS mode (1 low and 2 x 25 level) - I guess.
      One strike and SWAPOUT. Strangely, SWAPOUT can swap in a pet that needs to be immediately swapped out. Does any one know how to prevent this? Thank you.
      But with Ringerx2 setup this Strategy works ok.
       
    5. hackersrage

      hackersrage Member Buddy Store Developer

      Joined:
      Nov 18, 2012
      Messages:
      342
      Likes Received:
      15
      Trophy Points:
      18
      Prostak - That isn't true. I was using this when it was working, and it works well with 3 level 1 pets.

      The new one in the store seems to follow that logic of requiring level 25 pets as the ONLY place it levels is in Pandaria.


      Regarding this bot --- I thought I had it sorted, but it's not loading profiles . Perhaps someone can give some insight on how to fix :

      Code:
      System.FormatException: Additional non-parsable characters are at the end of the string.
         at System.ParseNumbers.StringToLong(String s, Int32 radix, Int32 flags, Int32* currPos)
         at System.Convert.ToUInt64(String value, Int32 fromBase)
         at PokehBuddy.MyPets.updateMyPets() in c:\Bots\HonorBuddy\Bots\PokehBuddy\MyPets.cs:line 59
         at PokehBuddy.PokehBuddy.Start() in c:\Bots\HonorBuddy\Bots\PokehBuddy\PokehBuddy.cs:line 125
         at Styx.CommonBot.TreeRoot.()
      
      Please note, there is an odd char at that last line, however I can not find any reference to Styx.CommonBot.TreeRoot anywhere.
       
    6. Prostak

      Prostak Member

      Joined:
      Mar 17, 2013
      Messages:
      249
      Likes Received:
      16
      Trophy Points:
      18
      That may be true, but I've run into the problem even with Ringerx2 when opponents are high enough to low one of my 25's below 30. Then incessant swapping begins until one of my dear pets dies. I've looked at the code. There seems to be a design problem. Indeed:
      1. The team task is defined in PBS plugin: Relative Level, Ringer, Ringerx2, Catch. Pet team is formed accordingly.
      2. When to do a swap - this is a team task level decision. Ringer should just expose a carrie, while catch team members are all expected to contribute. (The decision when to expose the carrie may depend on a battle situation: we may wish to avoid exposing the carrie to spiders with nets e.g. But spiders can be avoided by other means, so let's forget about them but not about the proper level to decide re swapout).
      3. Actual swapouts are currently written in individual pet logic files (I may be missing something here as I am a newb with this addon).
      4. When bot receives the SWAPOUT directive it calls an internal very fuzzy, very complicated logic, see WantSwapping routine, and worse: it is absolutely not related neither to the team task as set in PBS addon nor to the individual pet logic which just asked for a swap. Hence swapping at wrong times.

      I doubt that this fuzzy logic can be fixed. As I said, the swapout is a team level decision: blind opponents - swap to a pet taking advantage of blidness, etc.
      But we do not need to go to team level logic immediately. Instead, we may want to implement first a set of simple swapout logic choices in WantSwapping, corresponding to PBS choices:
      - Ringer: just expose carrie at the proper moment, fight with 25s until they are dead or low in health;
      - Relative and Catch: fight to a pre-set health level.
      We can probably even distinguish the situation based on a team composition as set by PBS.

      I am going to try this since I am a bit mad at a current swapping. But again, I am a newb here and may be missing something.

      As for your question re error. I did not get any errors. I did as follows: Got an original addon v.24 and on top of that unpacked the zip file from this thread, v.24 modified. Works nicely except these swapouts.
       
      Last edited: Nov 6, 2014
    7. hackersrage

      hackersrage Member Buddy Store Developer

      Joined:
      Nov 18, 2012
      Messages:
      342
      Likes Received:
      15
      Trophy Points:
      18
      I wonder if this is referencing stuff in the .svn folder. It really shouldn't be. I will try your method, and repack if it fixes the issue. Not sure about the pet logic. Perhaps adding a pet-health check before swap routine might not be bad -- or ... and/or a condition if pet type is blah and opponent is blah blah then no match -- check if has pet in bars that matches, if not -- continue (do battle with existing noswap ).

      I would need to review the code in depth as to where that logic is based, as well as some help with how to do those checks. The logic itself isn't a problem -- just the commands are quite extensive.
       
    8. NovemberLima

      NovemberLima New Member

      Joined:
      May 28, 2013
      Messages:
      85
      Likes Received:
      0
      Trophy Points:
      0

      The error happens because the petID is a GUID (and I'm guessing it wasn't prepatch).
      The specific error happens because you try to convert a GUID like "BattlePet-0-00000003B1AC9" to an int, which, of course, can't work.
      The solution is as simple as using String instead of UInt64 for petID.

      I have attached the fixed 2 files.

      View attachment MyPets.cs View attachment BattlePet.cs
       
    9. TreeK

      TreeK New Member

      Joined:
      Jul 10, 2012
      Messages:
      170
      Likes Received:
      1
      Trophy Points:
      0
      I did not do the conversion from plugin to botbase, Sychotix did. I just fixed a few issues related to the update (and added a few other things). The plugin version still exists in the plugin section of the forum.

      This is probably due to your default logic. The defaults I supplied are designed to be used with Ringerx2 settings from BattlePetSwapper, basically one low level pet and 2 25's. Using my settings with any other setup will likely result in very strange behavior like you describe.

      I use this exclusively with BattlePetSwapper in Ringerx2 mode and have never had to deal with pets dying before. Played around with the settings a bit so I could see what happens when a pet dies and did see the swapping problem. I've tweaked the code a bit and it is now swapping a bit more intelligently, hopefully this will work for you as well:

      View attachment Pokehbuddy.zip
       
    10. TreeK

      TreeK New Member

      Joined:
      Jul 10, 2012
      Messages:
      170
      Likes Received:
      1
      Trophy Points:
      0
      Most of what you guys want to do can be done now by changing the default logic. That is in effect where you can set the 'team task' as Prostak describes. The default logic in the zip files I have been posting works with the Ringerx2 setting in BPS, the one supplied in the original version of the plugin on the first post works best with the relative setting in BPS (I think). I have gone so far as to make default logics for specific teams when I did a lot of PVP - you can make very complex decisions, but it is not a very user friendly way of doing things. Also the current code does take into account pet health, bad 'your pet type' vs 'enemy pet type' combinations, etc. See BattleRating().

      A lot of the design choices in the plugin on which this is based might not have been the best as it does make it way too complicated to do some things that should be simple. But I fear that trying to change this to work in a more user friendly way is not the best path forward. I think you will spend way too much of your time fighting the design. Probably better off gutting it and starting something from scratch.

      Cheers!
       
    11. Sea

      Sea New Member

      Joined:
      Aug 17, 2014
      Messages:
      115
      Likes Received:
      0
      Trophy Points:
      0
      1st thing I did was create individual profiles for the 3 pets I wanted to level. But PkBuddy did not even read the correct skills from the active pet team. If I selected any, PkBuddy would cough up an error and hang himself.

      But thanks a lot for looking into it, your efforts are appreciated. Should you decide to start something on your own, I'd be happy to help testing - or later provide a small donation to compensate you for the time you put into it.
       
    12. Prostak

      Prostak Member

      Joined:
      Mar 17, 2013
      Messages:
      249
      Likes Received:
      16
      Trophy Points:
      18
      So you did not specify a logic for each pet in a team but placed everything in different default logics, one per team? I would like to see the sample to understand current possibilities better :)

      This is very true. Probably the only way forward if this was a paid, commercial project. But the time I can spend on it is limited, especially given the expansion almost at our doorsteps :)
      Still, it is always nice to formulate idealistic design goals. My previous experience like 2 years ago was based on a different bot + protected Lua addon "MyPetBattle". Bot is sued out of existence by Blizzard but the addon is probably still alive (it needs just a protected Lua hack to work). The combination worked as follows:
      1. The bot was taking care of visiting hotspots and clicking on a proper objects (wild pets in this case). Strangely, this functionality (custom object list to interact with) is missing from Gatherbuddy.
      2. Desired function before clicking is to setup a proper / best team for the pet about to be engaged - an attempt to do this was present but was working strangely.
      3. Protected Lua was taking care of the battle using individual pet strategies.
      4. After the battle the new team was set up. There was also a button to refresh a team deliberately between battles.

      There were very few parameters. Team level, individual level shifts for positions, health to swap - that's basically it. I've levelled about 200 pets using this tool (fixing individual logic on the way: the default was "button 1" as expected). Logic was separated by individual pets, but condition "when to press this button" was in Lua, so no limitation. Sample:
      Note "names, not numbers" approach.
      Endgame (fighting high-level pets and teams) was worse at the time. Probably need to check how are they doing now. Anyway, what is needed:
      2. (already mentioned above as desirable, but needed here) Team composition based on the current target and goal (defeat or level).
      5. Team logic. I was actually thinking about full game tree traversal at the time :)
       
      Last edited: Nov 6, 2014
    13. hackersrage

      hackersrage Member Buddy Store Developer

      Joined:
      Nov 18, 2012
      Messages:
      342
      Likes Received:
      15
      Trophy Points:
      18
      I do not believe this requires "going commercial" in order to make this work. There is already a "commercial" pet leveler but that only works if you have existing level 25 pets with a very specific set of skills. This base started out as a free plugin, and I believe that it is more benefit being free and open -- rather than paid and closed (or even free and closed) as many scripts/plugins have now gone. I am sure in time, there may be a way to adjust the XML files (or the loot/level decisions), however for now, any scripts/etc from the store are essentially in locked status. If there is a problem with them, you are at the mercy of the developer/developers to correct.

      I will continue to work on this as time permits, however the first and most important thing, was to get this back into operational status where it would load, and start. There are plenty of profiles, and it would be nice for them to automatically switch zones. The interface itself is also something to be desired. I will see what I can do to correct that to make it more user friendly. As for the errors in the interface when loading pets, I don't know enough about the HB api as of yet in order to figure out what specifically is causing the crash (if it still does it) -- I have been too afraid to test that as that (to my knowledge) has never worked for me. It didn't seem to affect pet leveling though.

      It is nice to see that people are active on this again :) ( glad to be of inspiration ^.^ )
       
    14. Prostak

      Prostak Member

      Joined:
      Mar 17, 2013
      Messages:
      249
      Likes Received:
      16
      Trophy Points:
      18
      I did not mean "make this addon commercial". I was meaning just that having a lot of time to work on a project and not having as much time as desired - can lead to different decisions.
      BTW I've checked the protected Lua addon I mentioned. It is here: https://github.com/tropicdome/MyPetBattle . It was not updated for a year, but loads fine and works... until protected Lua is triggered. I guess HB does not act as a Lua unlocker.
       
    15. hackersrage

      hackersrage Member Buddy Store Developer

      Joined:
      Nov 18, 2012
      Messages:
      342
      Likes Received:
      15
      Trophy Points:
      18
      So far I have the project migrated to use the same runtimes as Honorbuddy itself. Apparently, this plugin was built on 4.0, however HonorBuddy is using the current 4.5.1 .net framework. There was also an invalid reference to CalcEngine which could be the cause of some of the problems.

      Working on sorting this interface WITHOUT touching any of the underlying code, but I must admit -- it's a friggen mess. Credit where credit is due, the original author did a decent job at addressing this need, however the interface (I am seeing all to common) is quite sloppy. Unnamed groupboxes, labels overlapping elements --- COME ON GUYS --- Use the "Dock" and "Align" features ffs.

      Anywho --- this may take some time to re-organize. The elements themselves, I will be careful not to change, however their positions, readability, and just general clusterf**k of mangled together elements, I will try and adjust. It would be super cool if HonorBuddy would approve use of components such as Telerik, or DevExpress to really add some pizzaz to the UI's, however no DLL's are allowed in distribution, so that kills that. Will do what I can with the "basic" .net components, and at the very least dock/etc. I am unsure why this seems to be such a problem for plugin/bot developers. I would be more than happy to assist in cleaning up UI issues -- aka, nice stretchable windows where the elements stretch, no labels overlapping UI elements, etc --- pretty basic stuff here. I have yet to see a mod that would even come close to passing Windows Logo certification (which among other things, checks the UI that it conforms or mostly conforms with usability aspects that users are used to).


      Alas --- back to work :S . Will update when I have this in a somewhat more manageable display (feels like I am fixing beginner VB6 ui fyi)
       
    16. hackersrage

      hackersrage Member Buddy Store Developer

      Joined:
      Nov 18, 2012
      Messages:
      342
      Likes Received:
      15
      Trophy Points:
      18
      HB is capable of executing LUA included protected commands although that is not always the safest route.
       
    17. hackersrage

      hackersrage Member Buddy Store Developer

      Joined:
      Nov 18, 2012
      Messages:
      342
      Likes Received:
      15
      Trophy Points:
      18
      Update -- I am disabling / hiding all the crap that crash when you try to do something. Example : Fictional battle .... load pets ..... etc etc. It's very annoying when every other button you push, crashes the UI.
       
    18. otro

      otro New Member

      Joined:
      Oct 20, 2012
      Messages:
      112
      Likes Received:
      0
      Trophy Points:
      0
      I tried to use this botbase and failed miserably on pet logic and eventually abandoned everything, so all the fixing is really appreciated since i still want to pick this thing up again :D
       
    19. hackersrage

      hackersrage Member Buddy Store Developer

      Joined:
      Nov 18, 2012
      Messages:
      342
      Likes Received:
      15
      Trophy Points:
      18
      Ok, I have completed the UI update. I have hidden all the broken stuff. Will re-add the pet rules/logic section in a future revision, however I am not sure that is even necessary since it never really worked for me. I used the defaults and everything worked fine (in previous versions), however when attempting to add new rules/etc, thats when things just went all dorky.

      If it is absolutely necessary to have this page, list off the stuff you used (aka, only loaded settings from existing files) etc.

      The UI is MUCH easier to use and the labels are clearer in sections. While I was still limited to using ONLY the base controls available in .NET, I was able to add a bit of style (aka, the blacklist is black with white text, and the white list is white with black text). Also flattened some of the controls as the 3D beveled look is so 1994. Just testing the UI out for the last run, then need to figure out how to clean out the obj/bin/etc folders without breaking the project.

      Additionally, I made a solution file that loads the plugin AND the dependancy. I may have to update the references by hand though -- if someone could give an assist on that part as I am unfamiliar with how exactly this stuff should be distributed. I generally distribute compiled binaries with their dependancies, so source referencing a dependancy that is source, or an exe/dll (honorbuddy stuff) that is in whatever location is rather strange to me.
       
    20. hackersrage

      hackersrage Member Buddy Store Developer

      Joined:
      Nov 18, 2012
      Messages:
      342
      Likes Received:
      15
      Trophy Points:
      18
      UPDATE
      ---------------

      Updated base references from .NET 4.0 to .NET 4.5.1
      Complete UI overhaul. (too many changes to list them all)
      Removed all broken UI stuff.


      PokehBuddy Botbase
      View attachment 150061 - Updated 2014-11-06
       

    Share This Page