How i can split item?
Can you explain a little bit more what you want do?
For example, I have a 1000 metal parts. I need to make 250 in each
Splitting an Item in the Inventory
First of all, I am expecting there is already one inventory window open.
Here is my idea how to do this:
- set shift key down
- a delay as I am not sure if the eve client will pick it up as intended when key and mouse input are too close
- drag the item to be splitted to a place in the list view that is appropriate to trigger the “Divide Stack” dialog.
- a delay as I am not sure if the eve client will pick it up as intended when key and mouse input are too close
- set shift key up
- check whether “Divide Stack” has been opened, if not → return error.
- enter the number to split off
- press return key
Finding a suitable destination for the dragging was more complicated than it should be, I ended up using the label in the lower right corner of the inventory window as this seemed simpler than finding a point in the list viewport which is not occupied by an item.
Here is a complete script that worked for me:
using Parse = Sanderling.Parse; MotionResult KeyDown(VirtualKeyCode key) => Sanderling?.MotionExecute(new Sanderling.Motor.MotionParam { KeyDown = new[]{key}, }); MotionResult KeyUp(VirtualKeyCode key) => Sanderling?.MotionExecute(new Sanderling.Motor.MotionParam { KeyUp = new[]{key}, }); Parse.IMemoryMeasurement measurement => Sanderling.MemoryMeasurementParsed?.Value; Parse.IWindowInventory windowInventory => measurement?.WindowInventory?.FirstOrDefault(); var amountToSplitOff = 4; var itemToSplit = windowInventory?.SelectedRightInventory?.ListView?.Entry?.FirstOrDefault(); // just pick a label in the lower right corner of the window. Dragging to there has been observed to trigger the split dialog too. var dragDestination = windowInventory?.LabelText?.OrderByCenterDistanceToPoint(new Vektor2DInt(3333,9999))?.FirstOrDefault(); // should be the label with the estimated price ("64 ISK <color=gray>Est. price") Host.Log("dragDestination: " + dragDestination?.Text + " (" + dragDestination?.Region.Center().ToString() + ")"); var delayDuration = 333; KeyDown(VirtualKeyCode.SHIFT); Host.Delay(delayDuration); Sanderling.MouseDragAndDrop(itemToSplit, dragDestination); Host.Delay(delayDuration); KeyUp(VirtualKeyCode.SHIFT); var divideWindow = measurement?.WindowOther?.FirstOrDefault(window => window?.Caption?.RegexMatchSuccessIgnoreCase(@"divide") ?? false); if(null == divideWindow) { Host.Log("opening divide dialog failed"); return; } // enter the quantity to split off Sanderling.TextEntry(amountToSplitOff.ToString()); Sanderling.KeyboardPress(VirtualKeyCode.RETURN);
How does that work for you?
I will add the KeyDown
and KeyUp
method to the library for next release, so that will reduce some LOCs.
nice, good! I w8 u
With release v16.06.11, I added the KeyDown
and KeyUp
method to the library, you can now use them like this:
Sanderling.KeyDown(VirtualKeyCode.SHIFT);