private void DoLoginStuff() { if (LoginPhase == 0) { if (!LoginAttempted) { LoginAttempted = true; Core.Foreground(); //806x632 //Host.Actions.SetCursorPosition(350, 400);//crash EnumWindowsItem enumw = new EnumWindowsItem(Core.Decal.Hwnd); Input.MouseMoveAbsolute(enumw.Location.X + 350, enumw.Location.Y + 400); TimeSinceLoginStuffAction = Stopwatch.StartNew(); LoginPhase = 1; } } else if (LoginPhase == 1) { if (TimeSinceLoginStuffAction.ElapsedMilliseconds > 1000) { Core.Foreground(); Input.LeftClick(); TimeSinceLoginStuffAction = Stopwatch.StartNew(); LoginPhase = 0; } } }
private void DoLoginStuff() { if (LoginPhase == 0) { if (CharToLogin.HasValue && !LoginAttempted && TimeSinceLogoff != null && TimeSinceLogoff.ElapsedMilliseconds > 10000) { LoginAttempted = true; Core.Foreground(); EnumWindowsItem enumw = new EnumWindowsItem(Core.Decal.Hwnd); int index = CharSelectCoordFinder.GetCharacterIndexById(WarehouseFilterGlobals.Characters, CharToLogin.Value); if (index < 0) { throw new Exception("failed to get character to login's index in the list"); } Vector2D loc = CharSelectCoordFinder.GetCharacterListItemLocationByIndex(WarehouseFilterGlobals.CharacterSlots, index); Input.MouseMoveAbsolute(enumw.Location.X + loc.X, enumw.Location.Y + loc.Y); TimeSinceLoginStuffAction = Stopwatch.StartNew(); LoginPhase = 1; } } else if (LoginPhase == 1) { if (TimeSinceLoginStuffAction.ElapsedMilliseconds > 1000) { Core.Foreground(); Input.LeftClick(); TimeSinceLoginStuffAction = Stopwatch.StartNew(); LoginPhase = 2; } } else if (LoginPhase == 2) { if (TimeSinceLoginStuffAction.ElapsedMilliseconds > 1000) { //806x632 //Host.Actions.SetCursorPosition(350, 400);//crash Core.Foreground(); EnumWindowsItem enumw = new EnumWindowsItem(Core.Decal.Hwnd); Input.MouseMoveAbsolute(enumw.Location.X + 350, enumw.Location.Y + 400); TimeSinceLoginStuffAction = Stopwatch.StartNew(); LoginPhase = 3; } } else if (LoginPhase == 3) { if (TimeSinceLoginStuffAction.ElapsedMilliseconds > 1000) { Core.Foreground(); Input.LeftClick(); TimeSinceLoginStuffAction = Stopwatch.StartNew(); LoginPhase = 0; } } }
/// <summary> /// Add a new Window to the collection. Intended for /// internal use by EnumWindows only. /// </summary> /// <param name="hWnd">Window handle to add</param> public void Add(IntPtr hWnd) { EnumWindowsItem item = new EnumWindowsItem(hWnd); this.InnerList.Add(item); }