//public static bool ActivateClient(Interactor intr) { // //intr.ExecuteStatement("ActivateNeverwinter()"); // Screen.WindowActivate(intr, Game.GAMECLIENTEXE); // intr.Wait(1000); // return true; //} //public static bool LogOut(Interactor intr) { // //intr.ExecuteStatement("Logout()"); // intr.Log("Logging out...", LogEntryType.Info); // MoveAround(intr); // Keyboard.SendKey(intr, "Enter"); // intr.Wait(50); // Keyboard.Send(intr, "/gotocharacterselect"); // intr.Wait(100); // Keyboard.SendKey(intr, "Enter"); // intr.Wait(100); // intr.Wait(3000); // return true; //} public static bool ClientSignIn(Interactor intr) { intr.Log(LogEntryType.Info, "Signing in Client..."); //intr.ExecuteStatement("ClientLogin()"); intr.Wait(5000); ClearDialogues(intr); //if (!intr.WaitUntil(15, ClientState.LogIn, Game.IsClientState, null, 0)) { return false; } string gameUserName = intr.AccountSettings.GetSettingValOr("accountName", "general", ""); string gamePassword = intr.AccountSettings.GetSettingValOr("password", "general", ""); intr.Wait(1000); //var shiftHome = @"Send {Shift down} // Sleep 20 // Send { Home down} // Sleep 20 // Send { Shift up} // Sleep 20 // Send { Home up} // Sleep 20 //"; //intr.ExecuteStatement(shiftHome); Keyboard.SendKeyWithMod(intr, "Shift", "Tab", Keyboard.SendMode.Input); intr.Wait(200); Keyboard.SendKeyWithMod(intr, "Shift", "Home", Keyboard.SendMode.Input); Keyboard.Send(intr, gameUserName); Keyboard.SendKey(intr, "Tab"); intr.Wait(200); Keyboard.Send(intr, gamePassword); intr.Wait(200); Keyboard.SendKey(intr, "Enter"); intr.Wait(3000); // [TODO]: THIS NEEDS TO CLEAR VERIFY? DIALOGUE //ClearDialogues(intr); return(true); //ClientLogin() { // global // While ((ToggleInv && !FindClientLoginButton()) && (A_Index < 10)) { // LogAppend("[Attempting to find ClientLoginButton.]") // sleep 1500 // } // if (ToggleInv && !FindClientLoginButton()) { // LogAppend("[Not sure if we found ClientLoginButton but continuing...]") // ; msgbox ClientLogin() Waited too long for Login Screen to appear. If you are at login screen please check or remake %Lb_ImageFile%. // } // if (ToggleInv) { // Sleep 2000 + Ran(500) // Send {Shift down} // Sleep 20 // Send {Home down} // Sleep 20 // Send {Shift up} // Sleep 20 // Send {Home up} // Sleep 20 // Send %NwUserName% // Sleep 50 // Send {Tab} // Sleep 200 + Ran(100) // Send %NwActPwd% // Sleep 200 + Ran(100) // Send {Enter} // Sleep AfterLoginDelay + Ran(120) // } //} }
public static bool Redeem(Interactor intr, uint charIdx) { VaultOfPietyItem item; try { item = (VaultOfPietyItem)Enum.Parse(typeof(VaultOfPietyItem), intr.AccountSettings.GetCharSetting(charIdx, "vaultOfPietyItem"), true); } catch (Exception) { item = DEFAULT_REDEMPTION_ITEM; } intr.Log(LogEntryType.Debug, "VaultOfPietyItem: " + item.ToString()); intr.Wait(500); string cursorModeKey = intr.AccountSettings.GetSettingValOr("toggleMouseCursor", "gameHotkeys", Global.Default.ToggleMouseCursor); if (Screen.ImageSearch(intr, "InvocationMaximumBlessings").Found) { intr.Wait(200); Mouse.ClickImage(intr, "InvocationMaximumBlessingsVaultOfPietyButton"); } else { intr.Wait(1000); Keyboard.SendKey(intr, cursorModeKey); intr.Wait(500); bool clicked = false; clicked |= Mouse.ClickImage(intr, "InvocationNotReady"); clicked |= Mouse.ClickImage(intr, "InvocationReady"); if (!clicked) { intr.Log(LogEntryType.FatalWithScreenshot, "Unable to click Vault of Piety button"); } } intr.WaitRand(2100, 2500); if (!Screen.ImageSearch(intr, "VaultOfPietyWindowTitle").Found) { return(false); } Mouse.ClickImage(intr, "VaultOfPietyCelestialSynergyTabTitle"); intr.Wait(2000); string panelImage; string purchaseConfirmImage; //if (item == VaultOfPietyItem.ElixirOfFate) { // var panel = Screen.ImageSearch(intr, "VaultOfPietyCelestialSynergyElixirOfFate"); // if (panel.Found) { // Mouse.DoubleClick(intr, panel.Point); // intr.Wait(500); // Mouse.ClickImage(intr, "VaultOfPietyElixirOfFateSelectAmountOkButton"); // intr.Log(LogEntryType.Info, "Vault of Piety: 'Elixir of Fate' purchased successfully."); // } else { // intr.Log(LogEntryType.Fatal, "Vault of Piety Error: Could not find 'Elixir of Fate' icon/tile."); // return false; // } //} else if (item == VaultOfPietyItem.CofferOfCelestialArtifactEquipment) { // var panel = Screen.ImageSearch(intr, "VaultOfPietyCelestialSynergyCofferOfCelestialArtifactEquipment"); // if (panel.Found) { // Mouse.DoubleClick(intr, panel.Point); // intr.Wait(500); // Mouse.ClickImage(intr, "VaultOfPietyCofferOfCelestialArtifactEquipmentPurchaseConfirmOkButton"); // intr.Log(LogEntryType.Info, "Vault of Piety: 'Coffer of Celestial Artifact Equipment' purchased successfully."); // } else { // intr.Log(LogEntryType.Fatal, "Vault of Piety Error: Could not find 'Coffer of Celestial Artifact Equipment' icon/tile."); // return false; // } //} if (item == VaultOfPietyItem.ElixirOfFate) { panelImage = "VaultOfPietyCelestialSynergyElixirOfFate"; purchaseConfirmImage = "VaultOfPietyElixirOfFateSelectAmountOkButton"; } else if (item == VaultOfPietyItem.BlessedProfessionsElementalPack) { panelImage = "VaultOfPietyCelestialSynergyBlessedProfessionsElementalPack"; purchaseConfirmImage = "VaultOfPietyCofferOfCelestialArtifactEquipmentPurchaseConfirmOkButton"; } else if (item == VaultOfPietyItem.CofferOfCelestialEnchantments) { panelImage = "VaultOfPietyCelestialSynergyCofferOfCelestialEnchantments"; purchaseConfirmImage = "VaultOfPietyCofferOfCelestialArtifactEquipmentPurchaseConfirmOkButton"; } else if (item == VaultOfPietyItem.CofferOfCelestialArtifacts) { panelImage = "VaultOfPietyCelestialSynergyCofferOfCelestialArtifacts"; purchaseConfirmImage = "VaultOfPietyCofferOfCelestialArtifactEquipmentPurchaseConfirmOkButton"; } else if (item == VaultOfPietyItem.CofferOfCelestialArtifactEquipment) { panelImage = "VaultOfPietyCelestialSynergyCofferOfCelestialArtifactEquipment"; purchaseConfirmImage = "VaultOfPietyCofferOfCelestialArtifactEquipmentPurchaseConfirmOkButton"; } else { intr.Log(LogEntryType.Fatal, "Vault of Piety Error: Unknown item: '{0:G}'.", item); return(false); } var panel = Screen.ImageSearch(intr, panelImage); if (panel.Found) { Mouse.DoubleClick(intr, panel.Point); intr.Wait(500); Mouse.ClickImage(intr, purchaseConfirmImage); intr.Log(LogEntryType.Info, "Vault of Piety: '{0:G}' purchased successfully.", item); } else { intr.Log(LogEntryType.Fatal, "Vault of Piety Error: Could not find '{0:G}' icon/panel.", item); return(false); } // [FIXME]: Handle the fact that the VaultOfPietyItem is: `5` // [FIX THE HELL OUT OF ME][FIX THE HELL OUT OF ME] // [FIX THE HELL OUT OF ME][FIX THE HELL OUT OF ME][FIX THE HELL OUT OF ME][FIX THE HELL OUT OF ME] return(true); }