Exemple #1
0
        public static bool WaitUntil(Func <bool> condition, int frequency = 25, int timeout = -1, bool checkWindows = false)
        {
            var t = Task.Run(async delegate
            {
                var waitTask = Task.Run(async() =>
                {
                    while (!condition())
                    {
                        if (checkWindows)
                        {
                            RaptureAtkUnitManager.Update();
                        }
                        await Task.Delay(frequency);
                        await Task.Yield();
                    }
                });

                if (waitTask != await Task.WhenAny(waitTask, Task.Delay(timeout)))
                {
                    throw new TimeoutException();
                }

                return(condition());
            });

            try
            {
                t.Wait();
            }
            catch (AggregateException ae)
            {
            }

            return(condition());
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            RaptureAtkUnitManager.Update();
            listBox1.Items.Clear();
            listBox2.Items.Clear();
            //listBox1.Items.Add($"RaptureAtkUnitManager Updated");
            LlamaUI.Log("RaptureAtkUnitManager Updated");


            foreach (var window in RaptureAtkUnitManager.Controls)
            {
                listBox1.Items.Add($"{window.Name}");
            }

            button2.Enabled = true;
        }
Exemple #3
0
        private static async Task <bool> WindowEscapeSpam(string windowName)
        {
            for (var i = 0; i < 5 && RaptureAtkUnitManager.GetWindowByName(windowName) != null; i++)
            {
                RaptureAtkUnitManager.Update();

                if (RaptureAtkUnitManager.GetWindowByName(windowName) != null)
                {
                    RaptureAtkUnitManager.GetWindowByName(windowName).SendAction(1, 3UL, (ulong)uint.MaxValue);
                }

                await Coroutine.Wait(300, () => RaptureAtkUnitManager.GetWindowByName(windowName) == null);

                await Coroutine.Wait(300, () => RaptureAtkUnitManager.GetWindowByName(windowName) != null);

                await Coroutine.Yield();
            }

            return(RaptureAtkUnitManager.GetWindowByName(windowName) == null);
        }
Exemple #4
0
        private static void Render(Device device, DrawingContext ctx)
        {
            try
            {
                SetupRenderStates(device);
            }
            catch (Exception ex)
            {
                Logging.Write(LogLevel.Normal, "[D3d Overlay] Exception {0}", ex);
            }

            // Clear the backbuffer to a black color.
            device.Clear(ClearFlags.All, Color.FromArgb(0, 0, 0, 0), 1.0f, 0);

            device.BeginScene();
            try
            {
                //if (TreeRoot.IsRunning)
                RaptureAtkUnitManager.Update();

                if (!CommonBehaviors.IsLoading)
                {
                    using (Core.Memory.AcquireFrame(true))
                    {
                        ctx.UpdateZBuffer();
                        //device.SetRenderState(RenderState.ZWriteEnable, false);
                        Drawing?.Invoke(ctx);
                        Overlay3D.InvokeDrawing(new DrawingEventArgs(ctx));
                    }
                }
            }
            catch (Exception ex)
            {
                Logging.Write(LogLevel.Normal, "[D3d Overlay] Exception {0}", ex);
            }

            device.EndScene();
            device.Present();
        }
        private static void Render(Device device, DrawingContext ctx)
        {
            try
            {
                SetupRenderStates(device);
            }
            catch (Exception ex)
            {
                Logging.Write(LogLevel.Normal, "[SliceIsRightTracker] Exception {0}", ex);
            }

            // Clear the backbuffer to a black color.
            device.Clear(ClearFlags.All, Color.FromArgb(0, 0, 0, 0), 1.0f, 0);

            device.BeginScene();
            try
            {
                //if (TreeRoot.IsRunning)
                RaptureAtkUnitManager.Update();

                if (!CommonBehaviors.IsLoading)
                {
                    using (Core.Memory.AcquireFrame(true))
                    {
                        Drawing?.Invoke(ctx);
                    }
                }
            }
            catch (Exception ex)
            {
                Logging.Write(LogLevel.Normal, "[SliceIsRightTracker] Exception {0}", ex);
            }

            device.EndScene();
            device.Present();
        }
Exemple #6
0
 public GameWindowBase Refresh()
 {
     RaptureAtkUnitManager.Update();
     control = RaptureAtkUnitManager.GetWindowByName(Name);
     return(this);
 }