• 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
      It's sleeping Average Latency * 2 after every purchase to avoid mistakes. Still it's not 100% accurate if you lag spike. There is no function to wait until the item is purchased, I could build it myself... Maybe later.
      I didn't test if not using this sleep will change anything.
      Task is executed everytime the bot is in town/hideout after vendoring and stashing everything.


      EDIT: Ok I was bored and made a function that wait's until the item is appeared in the inventory. So it's buying as fast as possible.

      Code:
      public static async Task<bool> WaitForCurrencyToBeBought(string itemname, int currentAmount, int timeout = 1000)
              {
                  var deadlock = Stopwatch.StartNew();
                  while (deadlock.ElapsedMilliseconds < timeout)
                  {
                      var newAmount = Inventory.MainInventory.Items.Where(itemC => itemC.Name == itemname).Sum(b => b.StackCount);
                      if (newAmount > currentAmount)
                      {
                          StashBuddy.Log.DebugFormat("[WaitForCurrencyToBeBought] \"{0}\" bought after {1} miliseconds.", itemname, deadlock.ElapsedMilliseconds);
                          return true;
                      }
                         
                      await Coroutine.Sleep(20);
                  }
      
                  StashBuddy.Log.ErrorFormat("[WaitForCurrencyToBeBought] Timeout.");
                  return false;
              }
      
       
      Last edited: Jan 9, 2016
    2. DocBrown

      DocBrown Member

      Joined:
      Mar 24, 2015
      Messages:
      362
      Likes Received:
      11
      Trophy Points:
      18
      that transmutes and tp scrolls to wisdom scrolls was a smart idea. Can you also add armor and weapon scraps to wisdom scrolls while your at it
       
    3. darkbluefirefly

      darkbluefirefly Community Developer

      Joined:
      Nov 8, 2013
      Messages:
      1,927
      Likes Received:
      18
      Trophy Points:
      38
      API can handle buying.

      Code:
      var err = LokiPoe.InGameState.PurchasePanel.Purchase(item);
                      if (err != LokiPoe.InGameState.PurchaseError.None) return err;
       
    4. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      I'll add it to todo, but initial release's going to have only buying task to narrow possible errors.

      I got it already
      Code:
      if (LokiPoe.InGameState.PurchasePanel.Purchase(ToBuy) != LokiPoe.InGameState.PurchaseError.None)
                          return false;
      
      But I'm 90% sure it's not waiting until item is bought only returns an error if it can't be bought (look at PurchaseError enum) and buying too fast in loop will result with some of them being skipped.
       
    5. Dbuddy

      Dbuddy Member

      Joined:
      Jun 18, 2012
      Messages:
      963
      Likes Received:
      0
      Trophy Points:
      16
      currency exchange is a really really nice feature.
      *thumbs up*
       
    6. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      I decided to delay the official beta because of new AIF release. Until all major bugs in IAF will be fixed, I'd don't release new plugin that may cause errors.
      This is because I want to not make tonyx life harder with catching the bugs.

      Here is the (pre)beta release, but do not post any error's in AIF thread while using StashBuddy. This version may not work because I've changed many things without testing.
       

      Attached Files:

    7. zeratult6

      zeratult6 New Member

      Joined:
      Jul 12, 2012
      Messages:
      9
      Likes Received:
      1
      Trophy Points:
      3
      Tested, its work well with me :) thanks u for this project :)
      And can u make it buy Portal Scroll with Scroll of Wisdom, and i'll manual make item filter sell Armourer's Scrapy and Blacksmith's Whetstone to Scroll of Wisdom :D
       
    8. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      Thanks for the first feedback. Good that it works well for you. If you encounter any bugs, write it.

      I have Currency downgrade in plans for the next update(s). But buying portals with wisdoms? That's a waste of time and wisdom's.
       
    9. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,770
      Likes Received:
      35
      Trophy Points:
      48
      Definitely. but it could be decent to have it as an option for the mongoloids that would want to use it Kappa
       
    10. zeratult6

      zeratult6 New Member

      Joined:
      Jul 12, 2012
      Messages:
      9
      Likes Received:
      1
      Trophy Points:
      3
      I know, but with bot >10 char (and Town Portal gem maybe), you have too much wisdoms/portal and cant do everything with it :( cant sell and cant use all :(
       
    11. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      New AIF have option to not pickup scrolls after you reach certain amount.

      I can't change my thread name QQ. If any mod is reading this please change it to "[Plugin] StashBuddy"
       
    12. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,770
      Likes Received:
      35
      Trophy Points:
      48
      Yesh, after few days of testing, it works pretty nicely. Basically if you fall under a given amount of scrolls it starts picking them up to the max amount you've set. this save lot of space in stash. :D
       
    13. DontBeAfraid

      DontBeAfraid Active Member

      Joined:
      Oct 2, 2015
      Messages:
      742
      Likes Received:
      30
      Trophy Points:
      28
      how does stashbuddy interact with map running from hideout?
      does it move the bot to town and a currency swap merchant every time he reaches the threshold amount?
       
    14. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      Exactly. I'm thinking about adding some timer on that to check amounts for example every 10 minutes. Stopwatch is added already into the code, just need to make the logic and GUI for it.
       
    15. DontBeAfraid

      DontBeAfraid Active Member

      Joined:
      Oct 2, 2015
      Messages:
      742
      Likes Received:
      30
      Trophy Points:
      28
      hm wouldnt it even be enough to check that just once per day?
      cause like this it makes hideout mapping pretty pointless imo since u kinda use the town all the time ^^


      but i guess i can adjust the timer once its build-in in the json anyways afterwards, right?
       
    16. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      Why use the town all the time? Use high tresholds like 200 and you won't see townrunning too often. If you are getting 200 alts per run then Kudos for you ;p
      Next version may be released in a bit because I'm going to work on some private plugin to connect EB with my relogger.
       
    17. DontBeAfraid

      DontBeAfraid Active Member

      Joined:
      Oct 2, 2015
      Messages:
      742
      Likes Received:
      30
      Trophy Points:
      28
      hmm, i probably should go back to bed xD
      you're totally right, a timer isnt even needed since u can just control the trigger with a high start threshold.
      thx!
       
    18. Laugh

      Laugh New Member

      Joined:
      Apr 26, 2014
      Messages:
      46
      Likes Received:
      0
      Trophy Points:
      0
      This plugin needs to limit itself to like the first 10 tabs or something or stop checking ALL the tabs after every map. takes forever so only use i have for it is to turn it on every few hours to get rid of the crap (minus the hundreds of scrolls cluttering up the stash lol; throw those in the guild stash for other to waste)
       
    19. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,770
      Likes Received:
      35
      Trophy Points:
      48
      Welcome to our world brah!
       
    20. Tormiasz

      Tormiasz Community Developer

      Joined:
      Jun 16, 2014
      Messages:
      701
      Likes Received:
      5
      Trophy Points:
      18
      Additional configuration options will come in time. Im busy now on other things. Basically I made this plugin for myself but I wanted to help the community as well :)
       
    Thread Status:
    Not open for further replies.

    Share This Page