Пример #1
0
        public void CubeConverterDualSlot(IntPtr handle, CancellationTokenSource tokenSource, ConvertingSpeed speed)
        {
            var item      = transformService.TransformCoordinate(CommonCoordinate.InventoryTopLeftSpot, RelativeCoordinatePosition.Right);
            var step      = transformService.TransformSize(CommonSize.InventoryStepSize);
            var fill      = transformService.TransformCoordinate(CommonCoordinate.CubeFill);
            var transmute = transformService.TransformCoordinate(CommonCoordinate.CubeTransmute);
            var backwards = transformService.TransformCoordinate(CommonCoordinate.CubeBackwards);
            var forwards  = transformService.TransformCoordinate(CommonCoordinate.CubeForwards);

            var itemClickDelay = 130;
            var transmuteDelay = 130;
            var fillDelay      = 0;
            var backwardsDelay = 0;

            if (speed == ConvertingSpeed.Slow)
            {
                fillDelay      = 100;
                backwardsDelay = 100;
            }
            else if (speed == ConvertingSpeed.Fast)
            {
                itemClickDelay = 60;
                transmuteDelay = 60;
            }
            else if (speed == ConvertingSpeed.VerySlow)
            {
                fillDelay      = 150;
                backwardsDelay = 150;
                itemClickDelay = 250;
                transmuteDelay = 250;
            }

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    if (IsCancelled(tokenSource))
                    {
                        return;
                    }
                    InputHelper.SendClick(handle, MouseButtons.Right, item.X + j * step.Width, item.Y + i * step.Height * 2);
                    Thread.Sleep(itemClickDelay);

                    if (IsCancelled(tokenSource))
                    {
                        return;
                    }
                    InputHelper.SendClick(handle, MouseButtons.Left, fill);
                    Thread.Sleep(fillDelay);

                    if (IsCancelled(tokenSource))
                    {
                        return;
                    }
                    InputHelper.SendClick(handle, MouseButtons.Left, transmute);
                    Thread.Sleep(transmuteDelay);

                    if (IsCancelled(tokenSource))
                    {
                        return;
                    }
                    InputHelper.SendClick(handle, MouseButtons.Left, backwards);
                    Thread.Sleep(backwardsDelay);

                    if (IsCancelled(tokenSource))
                    {
                        return;
                    }
                    InputHelper.SendClick(handle, MouseButtons.Left, forwards);
                }
            }
        }
Пример #2
0
 private Size TransformFrom1440p(Size size)
 {
     return(transformService.TransformSize(size, originalWidth: 2560, originalHeight: 1440));
 }