Season 15 and Demonbuddy, working as of 21th September 2018!
  • Visit Rebornbuddy
  • Visit Demonbuddy

[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
    CHANGELOG
    v0.8.0 - 16.06.2016
    + Changed the uniques format (again..) because it was bugging out with the comma in uniques names.
    + Some of the uniques have the internal name different than the one you see. For example "Rigwald's Charge" is in the memory as "Rigvald's Charge". I have to catch all of those manually.
    + The bot will try to go first to Highgate instead of Sarn for currency exchange.
    + Specialized uniques handling for Le Heup of All, Ventor's Gamble, Belly of the Beast, Black Sun Crest, Abyssus, Empire's Grasp, Facebreaker, Lioneye's Glare, Rain of Splinters, Reckless Defence, Rat's Nest. More will come in time.
    If they've got good rolls, they are going to be saved. If not, regular price checking will be used, and AIF's one.
    + GUI fixes.
    + Other small changes

    v.0.7.0 - 28.04.2016
    + Fixed a bug with parsing the uniques prices for some system languages.
    + Removed some "spaghetti" code. Settings structure has been changed! Your settings about currency exchange will be erased at first run!
    + Functions has been optimized to use new settings structure. They may contain bugs.
    + If the bot is in hideout and it want's to go to act 3, he'll try to do it on merciless first.
    + Bug fix/feature. Chancing and Vaaling will ignore the corrupted and mirrored items. Thanks PainfulDeath for the report.
    + Updated uniques prices. There is new format now, old files won't work!

    v.0.6.0 - 27.04.2016
    + Fixed an issue with AdvancedItemFilter and StashBuddy's Divination Card's Exchanging (more info
    + Fixed an issue with MapRunner that were running his tasks before StashBuddy's which cause leaving the hideout before StashBuddy's tasks hit. It's going to apply auto-rearrange of tasks after first zone change.
    + Fixed a bug where vendor would show "cannot afford" message if you don't visit the stash before buying... Sorry guys, it means the bot needs to refresh the whole stash before going to vendor. Blame GGG that they can't make the game without bugs.
    + Added Option to Vaal unique items. Currently working with toNyx to provide easy corruptions filtering with AdvancedItemFilter.
    + Added Option to use built-in uniques filter. You'll can choose the minimum value of unique you want to store. In case of any new league, new uniques will automatically be STASHED instead of sold, even if they are not in the filter. This feature is only working with softcore Standard and Perandus leagues. Please do not use it on Hardcore. I'll try to update the prices frequently for fresh values.
    Thanks to MATRASUS for his help. And big thanks for Fujiyama for his script to receive all uniques with prices.
    + Chancing and Vaaling list's got GUI upgrade. No need for buttons anymore. Thanks toNyx.
    + You can now set up minimum and maximum divination cards sets to process with Divination card's exchanging. The bot wouldn't start if there are less than minimum ready sets of cards and will use maximum of chosen value.

    v.0.5.0 - 23.04.2016
    + Updated for newest version of the bot. Caution! StashBuddy requires CommunityLib to work!
    + Added option to Chance items, hoping for uniques. Simply add the Base item name eg. "Sorcerer Boots". If you are using AdvancedItemFilter, you don't need to setup any pickup filters. It'll be done automatically.
    + Added option to automatize the Divination Card's exchanging.

    v0.4.0 - 04.02.2016
    + Added Option to sell Orb of Transmutation to Scroll of Wisdom. "Min to Save" values in Upgrade and Downgrade sections are binded. Selling have bigger priority than buying. Keep that in mind!
    + Added Option to buy Orb of Augmentation from Portal Scroll. "Min to Save" values in Upgrade and Downgrade sections are binded. Selling have bigger priority than buying. Keep that in mind!
    + Withdraw task had to be changed a bit because of Orb of Transmutation handling.
    + Removed unnecesary GUI code.
    + Parsing stashes while counting is now faster.
    + Traveling to sarn will now try to move on your current difficulty first. Useful for questing boys. Remember that Hideout = Normal.
    + If you are in act 4 the bot will use act 4 NPC and won't move anywhere. Downgrading to Wisdom's can be done in Hideout or in any city. Useful for questing boys.
    + Minor bug fix.

    v0.3.3 - 28.01.2016
    + Bug fix in currency counting.

    v0.3.2 - 25.01.2016
    + Bug fix in withdrawing currencies.

    v0.3.1 - 22.01.2016
    + Bug fix in counting currencies.

    v0.3.0 - 22.01.2016
    + New files: \Images\Armourer's Scrap.png, \Images\Blacksmith's Whetstone.png
    + Added Option to sell Armourer's Scrap and Blacksmith's Whetstone to Scroll of Wisdom.
    + Rewritten currency withdraw and sell logic.
    + Minor GUI changes in the Downgrade section.
    + Sliders are a bit wider.
    + Horizontal ScrollBar has been added to help the small screens.

    v0.2.0 - 20.01.2016
    + New files: \Images\Portal Scroll.png, \Images\Scroll of Wisdom.png,
    + Added Option to delay the currency exchange operations. Usefull function for people that has large amount of stash tabs.
    + Added Option to sell Portal Scroll for Scroll of Wisdom if the amount in stash is too low.
    + Switching tabs is now faster by 60-80%.
    + Doubled the maximum sliders values (to 496).
    + Fixed a bug that was causing last tab to be skipped.
    + Code cleaning.
    + Some minor fixes.

    v0.1.0 - 13.01.2016
    + Initial Release. Exchanging currency up to Orb of Regret.
     
    Last edited: Jun 16, 2016
  3. DontBeAfraid

    DontBeAfraid Active Member

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

    toNyx Well-Known Member

    Joined:
    Oct 29, 2011
    Messages:
    3,783
    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,783
    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,783
    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,783
    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:
    741
    Likes Received:
    28
    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:
    741
    Likes Received:
    28
    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:
    741
    Likes Received:
    28
    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