• Visit Rebornbuddy
  • How to get the position of an item which is placed in the currency stash tab?

    Discussion in 'Archives' started by Heilmann, Apr 18, 2017.

    1. Heilmann

      Heilmann Member Legendary

      Joined:
      Feb 7, 2010
      Messages:
      60
      Likes Received:
      3
      Trophy Points:
      8
      Hello community,

      I'm currently playing around with the API of Exilebuddy and I'm trying to do some basic actions like 6-linking, 6-socketing and color changing.

      What do I want to do?
      - I want to use a "Jeweller's Orb" on an item which is placed in the currency stash tab.


      Here is the code so far (for DevTab):
      Code:
      using System;
      using log4net;
      using Loki.Bot;
      using Loki.Common;
      using Loki.Game;
      using EXtensions;
      using EXtensions.CachedObjects;
      using InventoryUi = Loki.Game.LokiPoe.InGameState.InventoryUi;
      using StashUi = Loki.Game.LokiPoe.InGameState.StashUi;
      
      public class MyClass
      {
          private static readonly ILog Log = Logger.GetLoggerInstanceForType();
      
          public void Execute()
          {
              using(LokiPoe.AcquireFrame())
              {
                  //Start crafting sockets
                  var counterSockets = 0;
                  var item = StashUi.CurrencyTab.CraftingSlot.CurrencyTabItem;
                  Log.DebugFormat("[Crafter] Start crafting sockets");
                  while (counterSockets < 1)
                  {
                      //use Jewellers on item
                      var control = Inventories.GetControlWithCurrency(CurrencyNames.Jeweller);
                      control.PickItemToCursor(true);
                      InventoryUi.InventoryControl_Main.PlaceItemFromCursor(item.LocationTopLeft);
                      counterSockets++;
                      Log.DebugFormat(item.SocketCount.ToString());
                  }
              }
          }
      }
      Output of Exilebuddy Debug window:
      LokiPoe.ProcessHookManager.Enable pressed.
      [Crafter] Start crafting sockets
      [PickItemToCursor] Now going to pick "Jeweller's Orb" to cursor.
      [PlaceItemFromCursor] Now going to place "Jeweller's Orb" from cursor to {28, 0}.

      [PlaceItemFromCursor] Destination item is null.
      2

      Questions:
      1. How do I get the correct position of the item which is placed in the currency stash tab?
      2. Since Visual Studio is showing me that "'InventoryControlWrapper.CurrencyTabItem' is obsolete" what else should be used?

      Kind Regards
      Heilmann


       
      Last edited: Apr 18, 2017
    2. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,771
      Likes Received:
      35
      Trophy Points:
      48
      You don't pick item to cursor but Use it (orb) and the item in curr tab has its own wrapper, so you have to retrieve it using stashui.
       
    3. Heilmann

      Heilmann Member Legendary

      Joined:
      Feb 7, 2010
      Messages:
      60
      Likes Received:
      3
      Trophy Points:
      8
      Thanks toNyx.

      Code:
      //use Jewellers on item
                  var control = Inventories.GetControlWithCurrency(CurrencyNames.Jeweller);
                  control.UseItem();
                  StashUi.CurrencyTab.CraftingSlot.ApplyCursorTo();
                  counterSockets++;
                  Log.DebugFormat(item.SocketCount.ToString());
      It's working now, but is it the correct way?
       
    4. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,771
      Likes Received:
      35
      Trophy Points:
      48
      Looks good to me, not sure what is the counterSockets++ but i guess you wanna count the number of attempts. Else yes, looks like the good way ;)
       
    5. TheGracefulWorm

      TheGracefulWorm New Member

      Joined:
      Sep 25, 2016
      Messages:
      11
      Likes Received:
      0
      Trophy Points:
      1
      Maan i hope u gonna make it work, and hopefully you gonna share your plugin =) don't forget to check item base level coz only items above lvl50+ can be 6 socketed /linked
       

    Share This Page