• Visit Rebornbuddy
  • [Plugin] StashBuddy

    Discussion in 'Archives' started by Tormiasz, Jan 8, 2016.

    Thread Status:
    Not open for further replies.
    1. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      [​IMG]

      Credits
      Kudos to toNyx for his AdvancedItemFilter. I've used many functions from that plugin.
      Thanks to ExVault for his AddTask and TakeWp function. :)

      How does it work?:
      Currency Exchange: Using sliders you can set the minimum value of currency to trigger the exchange task. If the bot detects you have above this amount, it'll go to Sarn in normal difficulty and do the exchange. You can also set "Min. to Save" value to make sure that you have enough currency left for example rerolling maps.


      CAUTION:
      StashBuddy requires CommunityLib to work!


      Frequently Asked Questions:

      Q) How to install this plugin?
      A) Place the zip inside the "3rdParty" folder of ExileBuddy. Then you'll have to enable it in the Settings. That's it.

      Q) My bot is returning errors at start!
      A) Make sure you have CommunityLib plugin installed and enabled. If you are still getting errors, post full log of the bot in this thread. You'll find in the Logs folder of ExileBuddy.

      Q) How to use this plugin?!
      A) Hover your mouse over the text to get the information what it's doing.
       

      Attached Files:

      Last edited: Jun 16, 2016
    2. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
    3. DontBeAfraid

      DontBeAfraid Active Member

      Joined:
      Oct 2, 2015
      Messages:
      746
      Likes Received:
      30
      Trophy Points:
      28
      oh my god i love you!
       
    4. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,771
      Likes Received:
      35
      Trophy Points:
      48
      I'm glad to see some snippets are used in this project :) good idea anyway, for the sliders, take a look at AIF's recipe items, there's some in the .xaml file, it's just about pointing to a specific data :) as you would do for anything else.

      Very good to see there's some other contributors around ! You can ask anything if you encounter an issue.
       
    5. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      I'll post credits, thank you's etc when it's released ;)
       
    6. botelho

      botelho Member

      Joined:
      Nov 13, 2013
      Messages:
      279
      Likes Received:
      12
      Trophy Points:
      18
      Well, since your plugin will problably search the whole stash, maybe you can squize in a feature to contabilize all the currency in the stashes? xD
       
    7. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      contabilize? You mean something like currency tracker? It's already in AIF, no need to double it.
       
    8. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,771
      Likes Received:
      35
      Trophy Points:
      48
      I'll add something in Execute() so you'll be able to retrieve the currency in stash :)

      // EDIT //

      You'll be able to retrieve the stash currency with the command "GetCurrencyInStash" with execute, it'll be in next version so you can already add it in your project ;)
      The type of the data is a Dictionary<string, int>
       
      Last edited: Jan 8, 2016
    9. darkbluefirefly

      darkbluefirefly Community Developer

      Joined:
      Nov 8, 2013
      Messages:
      1,927
      Likes Received:
      18
      Trophy Points:
      38
      You have to teach him how to grab AIF's instance as well.

      Code:
      var plugin = PluginManager.Plugins.FirstOrDefault(x => x.Name == [B]pluginName[/B]);
                  if (plugin != null) 
      {
                  var value = plugin.Execute("GetCurrencyInStash", null);
      }
      Alcor has a handy method for this, I think shuffler has it idk.
       
    10. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      Preview how the basic GUI is going to look. Howering the mouse over name of the column will tell what's the setting doing.

      [​IMG]

      I'm now working on reading the settings value on start and set the sliders. Changing the sliders will update the json, but it's by some reason not reading them. Fixed
       
      Last edited: Jan 9, 2016
    11. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,771
      Likes Received:
      35
      Trophy Points:
      48
      I'll ask to every "wannabedevs" around, here's the snippet I created to avoid re-write the logic code everytime to grab something in execute :

      Code:
              public static T GenericExecute<T>(string pluginName, string method, dynamic[] param)
              {
                  var plugin = PluginManager.Plugins.FirstOrDefault(x => x.Name == pluginName);
                  if (plugin == null) return (T)Convert.ChangeType(default(T), typeof(T));
                  var value = plugin.Execute(method, param);
                  return (T)Convert.ChangeType(value, typeof(T));
              }
      If you're brave enough try to understand what it does, else just consider it like a generic resolver, it's used like this :

      Code:
      var data = GenericExecute<YOUR_RETURN_TYPE>("YOUR_PLUGIN_NAME", "THE_EXECUTE_METHOD", YOUR_PARAMS);
      - Basically, your return type is set in stone by the destionation plugin, you can't really change that, if the return value in any plugins is bool, you'll have to put bool.
      - the plugin name is the name shown in the settings, not the Plugins tab be careful (I could name the project "AIF" and the name would be "AdvancedItemFilter")
      - The execute method is the same story as the destination type, it's set in stone in the destination plugin.
      - Your params, it's a bit different :) I made it dynamic because fuck the custom types, you can pass anything in the array, but that also means that even if the object is alone/single, it has to be an array.

      Here's how you declare it :

      Code:
      new[] { YOUR_VARS }
      So the entire bunch of code would look like :

      Code:
      var data = GenericExecute<YOUR_RETURN_TYPE>("YOUR_PLUGIN_NAME", "THE_EXECUTE_METHOD", new[] { YOUR_VARS });
      But there's a little thing you might be aware of, if you don't need those "parameters" or "vars" passed in destination plugin, you can also pass "null" :)
      People will tell me "Hey, couldn't you make it default value on use ?" like "public static T GenericExecute<T>(string pluginName, string method, dynamic[] param = null)"

      Because if you're aware that the signature is like that, cool, but some other people will wonder why it doesn't work is they don't pass vars but they can't retrieve it, just because they forgot that the params were in the sign.

      HF Coding bra :) and make good use of this awesome stuff !
       
    12. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      Currently I'm writing/copying stuff instead of using someone's else work to understand the API better. I know C# syntax but playing with the API myself will result in better code. Better make separate topic for that snippet.
       
    13. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,771
      Likes Received:
      35
      Trophy Points:
      48
      When you'll encounter the pain it is to use this, you'll understand why :)
       
    14. Naohl

      Naohl New Member

      Joined:
      Sep 20, 2015
      Messages:
      28
      Likes Received:
      0
      Trophy Points:
      0
      Interesting project, good luck with it !

      I made something like it for my first C# project (and also first time openning VS). The code must be so bad that i never dared to post it :eek:

      i'll use your plugin when it will be ready, for sure !
       
    15. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      Some aesthetic changes to GUI thanks to toNyx images folder :)

      [​IMG]
       
    16. DontBeAfraid

      DontBeAfraid Active Member

      Joined:
      Oct 2, 2015
      Messages:
      746
      Likes Received:
      30
      Trophy Points:
      28
      Why did you skip the Portal scrolls and Transmutations here? :(

      Also did you consider adding chance - scour - regrets as well?
       
      Last edited: Jan 9, 2016
    17. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      I've skipped portals and transmuts because I have plans to use them for downgrading to wisdom scrolls. I'll need to think how to handle it properly. Anybody is really converting portal's to transmuts or augs?
      Chance-Scour-Regret exchange is already added in newest version.
       
    18. DontBeAfraid

      DontBeAfraid Active Member

      Joined:
      Oct 2, 2015
      Messages:
      746
      Likes Received:
      30
      Trophy Points:
      28
      well maybe not scrolls anymore, since the ratio isnt really worth it. (i just do that since the AIF has still problems with the scroll pickup cap - which will be fixed soon according to tony)

      but transmutations? i don't see any reason to not add it! its quite a bunch of stacks every day tho
      I at least - would really really appriciate adding them! pretty please? :)
       
    19. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      [​IMG]

      That's all I'm doing with this plugin for this week. Coming back to this on Monday ;) Post your ideas/suggestions here, I'll read them all. If one want's his code to be implemented into this plugin to make it better for community, feel free to send it to me using Private Message (or post it here).
       
    20. DontBeAfraid

      DontBeAfraid Active Member

      Joined:
      Oct 2, 2015
      Messages:
      746
      Likes Received:
      30
      Trophy Points:
      28
      you're the best man! :)
      Make sure to post your pp donation address when you're done with the plugin!


      edit: oh i actually have a question. How fast will the plugin convert the currency (like delay between the purchases?) and when will he execute the task (everytime he visits the stash+vendor?)?
       
      Last edited: Jan 9, 2016
    Thread Status:
    Not open for further replies.

    Share This Page