Skip to content

Instantly share code, notes, and snippets.

@Schroedi
Created July 7, 2022 10:57
Show Gist options
  • Save Schroedi/5260ff666d37df6e5d900bf6b8ab815d to your computer and use it in GitHub Desktop.
Save Schroedi/5260ff666d37df6e5d900bf6b8ab815d to your computer and use it in GitHub Desktop.
Fast move an item from the inventory holding shift to ignore tab affinity
public static FastMoveResult FastMoveFromInvNoAffinity(int itemLocalId)
{
if (!LokiPoe.ProcessHookManager.IsEnabled)
{
return FastMoveResult.ProcessHookManagerNotEnabled;
}
LokiPoe.ProcessHookManager.ClearAllKeyStates();
var inventorySlotUiElement = LokiPoe.InGameState.InventoryUi.InventoryControl_Main.InventorySlotUiElement;
var slot = inventorySlotUiElement.PlacementGraph.FirstOrDefault(s => s.Value.LocalId == itemLocalId);
var clickPos = inventorySlotUiElement.SlotClickLocation(slot.Key);
MouseManager.SetMousePosition(clickPos);
LokiPoe.ProcessHookManager.SetKeyState(Keys.ControlKey, short.MinValue);
LokiPoe.ProcessHookManager.SetKeyState(Keys.ShiftKey, short.MinValue);
Thread.Sleep(20);
MouseManager.ClickLMB(0, 0);
Thread.Sleep(5);
LokiPoe.ProcessHookManager.SetKeyState(Keys.ControlKey, 0);
LokiPoe.ProcessHookManager.SetKeyState(Keys.ShiftKey, 0);
return FastMoveResult.None;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment