private async void Write_Time_Click(object sender, EventArgs e) { Delg.SetEnabled(Num_Hour, false); Delg.SetEnabled(Num_Min, false); Delg.SetEnabled(Num_Sec, false); Delg.SetEnabled(Write_Time, false); if (Num_Hour.Value > 999) { Num_BP.Value = 999; } if (Num_Min.Value > 59) { Num_Min.Value = 59; } if (Num_Sec.Value > 59) { Num_Sec.Value = 59; } byte[] data = new byte[4]; BitConverter.GetBytes(Convert.ToUInt16(Num_Hour.Value)).CopyTo(data, 0); data[2] = Convert.ToByte(Num_Min.Value); data[3] = Convert.ToByte(Num_Sec.Value); RAMreader = Program.helper.waitNTRwrite(LookupTable.GamePlayTimeOffset, data, Program.gCmdWindow.pid); if (!(await RAMreader)) { MessageBox.Show("A error ocurred while writting data to RAM.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } Delg.SetEnabled(Num_Hour, true); Delg.SetEnabled(Num_Min, true); Delg.SetEnabled(Num_Sec, true); Delg.SetEnabled(Write_Time, true); }
private void DisableControls() { Delg.SetEnabled(Mode, false); Delg.SetEnabled(Species, false); Delg.SetEnabled(LoadFilters, false); Delg.SetEnabled(ClearAll, false); }
private void SetControls(bool state) { foreach (Control c in Ctrls) { Delg.SetEnabled(c, state); } }
private void EnableControls() { Delg.SetEnabled(Mode, true); Delg.SetEnabled(Species, true); Delg.SetEnabled(LoadFilters, true); Delg.SetEnabled(ClearAll, true); }
/// <summary> /// Updates the value of the egg RNG seed. /// </summary> /// <param name="data"></param> /// <returns></returns> private string UpdateSeed(byte[] data) { string seed = BitConverter.ToString(data.Reverse().ToArray()).Replace("-", ""); Delg.SetText(EggSeed, seed); return(seed); }
private uint bagOut = 0x00000000; // 1.0: 0x03; public Bot_SoftReset7() { InitializeComponent(); Species.DisplayMember = "Text"; Species.ValueMember = "Value"; Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource.Where(s => s.Value <= Program.gCmdWindow.SAV.MaxSpeciesID).ToList(), null); Delg.SetSelectedValue(Species, 1); Program.gCmdWindow.SetResetLabel("Number of resets:"); }
private void DisableControls() { Delg.SetEnabled(Box, false); Delg.SetEnabled(Slot, false); Delg.SetEnabled(Trades, false); Delg.SetEnabled(WTSource, false); Delg.SetEnabled(WTAfter, false); Delg.SetEnabled(runEndless, false); }
private void EnableControls() { Delg.SetEnabled(Box, true); Delg.SetEnabled(Slot, true); Delg.SetEnabled(Trades, true); Delg.SetEnabled(WTSource, true); Delg.SetEnabled(WTAfter, true); Delg.SetEnabled(runEndless, true); }
private void RunStop_Click(object sender, System.EventArgs e) { DisableControls(); if (botworking) { // Stop bot Delg.SetEnabled(RunStop, false); Delg.SetText(RunStop, "Start Bot"); botworking = false; userstop = true; } else { string modemessage; switch (Mode.SelectedIndex) { case 0: modemessage = "Simple: This bot will produce " + Eggs.Value + " eggs and deposit them in the pc, starting at the first available slot in box " + Box.Value + ".\r\n\r\n"; break; case 1: modemessage = "Filter: This bot will start producing egss and deposit them in the pc, starting at the first available slot in box " + Box.Value + ". Then it will check against the selected filters and if it finds a match the bot will stop. The bot will also stop if it produces " + Eggs.Value + " eggs before finding a match.\r\n\r\n"; break; case 2: modemessage = "ESV/TSV: This bot will start producing egss and deposit them in the pc, starting at the first available slot in box " + Box.Value + ". Then it will check the egg's ESV and if it finds a match with the values in the TSV list, the bot will stop. The bot will also stop if it produces " + Eggs.Value + " eggs before finding a match.\r\n\r\n"; break; case 3: modemessage = "Accept/Reject: This bot will talk to the Nursery Lady and accept " + Accept.Value + " eggs, then it will reject " + Reject.Value + " eggs and stop.\r\n\r\n"; break; default: modemessage = "No mode selected. Select one and try again.\r\n\r\n"; break; } DialogResult dialogResult; dialogResult = MessageBox.Show("This bot will start producing eggs from the Nursery using the following rules:\r\n\r\n" + modemessage + "Make sure that your party is full and the Party/Box option is set to Automatic. Please read the Wiki at Github before starting. Do you want to continue?", "Breeding bot", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (dialogResult == DialogResult.OK && Mode.SelectedIndex >= 0) { // Configure GUI Delg.SetText(RunStop, "Stop Bot"); // Initialize variables botworking = true; userstop = false; botState = BotState.botstart; attempts = 0; maxreconnect = 10; // Run the bot Program.gCmdWindow.SetBotMode(true); RunBot(); } else { EnableControls(); } } }
/// <summary> /// Enables the controls in the form. /// </summary> private void EnableControls() { Delg.SetEnabled(Breed_options, true); Delg.SetEnabled(TSVlistNum, true); Delg.SetEnabled(tsvAdd, true); Delg.SetEnabled(tsvRemove, true); Delg.SetEnabled(tsvLoad, true); Delg.SetEnabled(tsvSave, true); Delg.SetEnabled(filterLoad, true); }
public void VerifyTilesAsync() { VerifyTileDelg Delg; AsyncCallback callbackdelg; Delg = this.VerifyTiles; callbackdelg = this.CallbackFunc; ITMBizControllerCallback cb = OperationContext.Current.GetCallbackChannel <ITMBizControllerCallback>(); Delg.BeginInvoke(callbackdelg, cb); }
/// <summary> /// Sets the reference to the next slot in the PC. /// </summary> private void GetNextSlot() { if (Slot.Value == 30) { Delg.SetValue(Box, Box.Value + 1); Delg.SetValue(Slot, 1); } else { Delg.SetValue(Slot, Slot.Value + 1); } }
/// <summary> /// Resets the form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ClearAll_Click(object sender, EventArgs e) { Delg.SetSelectedIndex(Mode, -1); Delg.SetValue(Box, 1); Delg.SetValue(Slot, 1); Delg.SetValue(Eggs, 1); Delg.SetValue(Accept, 0); Delg.SetValue(Reject, 0); Delg.SetChecked(ReadESV, false); esvList.Rows.Clear(); TSVlist.Items.Clear(); filterList.Rows.Clear(); }
private async void Write_Name_Click(object sender, EventArgs e) { Delg.SetEnabled(TB_Name, false); Delg.SetEnabled(Write_Name, false); byte[] data = Encoding.Unicode.GetBytes(TB_Name.Text.PadRight(13, '\0')); RAMreader = Program.helper.waitNTRwrite(LookupTable.TrainerNameOffset, data, Program.gCmdWindow.pid); if (!(await RAMreader)) { MessageBox.Show("A error ocurred while writting data to RAM.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } Delg.SetEnabled(TB_Name, true); Delg.SetEnabled(Write_Name, true); }
private async void Write_Lang_Click(object sender, EventArgs e) { Delg.SetEnabled(CB_Language, false); Delg.SetEnabled(Write_Lang, false); byte[] data = BitConverter.GetBytes(WinFormsUtil.getIndex(CB_Language)); RAMreader = Program.helper.waitNTRwrite(LookupTable.GameLanguageOffset, data, Program.gCmdWindow.pid); if (!(await RAMreader)) { MessageBox.Show("A error ocurred while writting data to RAM.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } Delg.SetEnabled(CB_Language, true); Delg.SetEnabled(Write_Lang, true); }
private async Task <uint> waitFestivalCoins() { RAMreader = Program.helper.waitNTRmultiread(LookupTable.festivalcoinsOff, 0x04); if (await RAMreader) { Delg.SetEnabled(Num_FestivalCoins, true); Delg.SetEnabled(Write_FestivalCoins, true); return(BitConverter.ToUInt32(Program.helper.lastmultiread, 0)); } else { return(0); } }
private async Task <uint> waitTotalFC() { RAMreader = Program.helper.waitNTRmultiread(LookupTable.totalfcOff, 0x04); if (await RAMreader) { Delg.SetEnabled(Num_TotalFC, true); Delg.SetEnabled(Write_TotalFC, true); return(BitConverter.ToUInt32(Program.helper.lastmultiread, 0)); } else { return(0); } }
private async Task <ushort> waitSID() { RAMreader = Program.helper.waitNTRmultiread(LookupTable.TrainerSIDOffset, 0x02); if (await RAMreader) { Delg.SetEnabled(Num_SID, true); Delg.SetEnabled(Write_SID, true); return(BitConverter.ToUInt16(Program.helper.lastmultiread, 0)); } else { return(0); } }
private async Task <uint> waitBP() { RAMreader = Program.helper.waitNTRmultiread(LookupTable.TrainerBPOffset, 0x04); if (await RAMreader) { Delg.SetEnabled(Num_BP, true); Delg.SetEnabled(Write_BP, true); return(BitConverter.ToUInt32(Program.helper.lastmultiread, 0)); } else { return(0); } }
private async Task <int> waitLang() { RAMreader = Program.helper.waitNTRmultiread(LookupTable.GameLanguageOffset, 0x01); if (await RAMreader) { Delg.SetEnabled(CB_Language, true); Delg.SetEnabled(Write_Lang, true); return(Convert.ToInt32(Program.helper.lastmultiread[0])); } else { return(0); } }
private async Task <string> waitName() { RAMreader = Program.helper.waitNTRmultiread(LookupTable.TrainerNameOffset, 0x1A); if (await RAMreader) { Delg.SetEnabled(TB_Name, true); Delg.SetEnabled(Write_Name, true); return(Util.TrimFromZero(Encoding.Unicode.GetString(Program.helper.lastmultiread))); } else { return(null); } }
private async Task <byte[]> waitTime() { RAMreader = Program.helper.waitNTRmultiread(LookupTable.GamePlayTimeOffset, 0x04); if (await RAMreader) { Delg.SetEnabled(Num_Hour, true); Delg.SetEnabled(Num_Min, true); Delg.SetEnabled(Num_Sec, true); Delg.SetEnabled(Write_Time, true); return(Program.helper.lastmultiread); } else { return(new byte[] { 0, 0, 0, 0 }); } }
private async void Write_SID_Click(object sender, EventArgs e) { Delg.SetEnabled(Num_SID, false); Delg.SetEnabled(Write_SID, false); if (Num_SID.Value > ushort.MaxValue) { Num_SID.Value = ushort.MaxValue; } byte[] data = BitConverter.GetBytes(Convert.ToUInt16(Num_SID.Value)); RAMreader = Program.helper.waitNTRwrite(LookupTable.sidOff, data, Program.gCmdWindow.pid); if (!(await RAMreader)) { MessageBox.Show("A error ocurred while writting data to RAM.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } Delg.SetEnabled(Num_SID, true); Delg.SetEnabled(Write_SID, true); }
private async void Write_BP_Click(object sender, EventArgs e) { Delg.SetEnabled(Num_BP, false); Delg.SetEnabled(Write_BP, false); if (Num_BP.Value > 9999) { Num_BP.Value = 9999; } byte[] data = BitConverter.GetBytes(Convert.ToUInt32(Num_BP.Value)); RAMreader = Program.helper.waitNTRwrite(LookupTable.TrainerBPOffset, data, Program.gCmdWindow.pid); if (!(await RAMreader)) { MessageBox.Show("A error ocurred while writting data to RAM.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } Delg.SetEnabled(Num_BP, true); Delg.SetEnabled(Write_BP, true); }
private async void Fill6() { SetControls(false); Delg.SetText(TB_Name, await waitName()); Delg.SetValue(Num_TID, await waitTID()); Delg.SetValue(Num_SID, await waitSID()); Delg.SetValue(Num_Money, await waitMoney()); Delg.SetValue(Num_Miles, await waitMiles()); Delg.SetValue(Num_BP, await waitBP()); Delg.SetSelectedValue(CB_Language, await waitLang()); byte[] time = await waitTime(); Delg.SetValue(Num_Hour, BitConverter.ToUInt16(time, 0)); Delg.SetValue(Num_Min, time[2]); Delg.SetValue(Num_Sec, time[3]); Delg.SetEnabled(ReloadFields, true); }
private void SetControls(bool state) { foreach (Control ctrl in controlList) { ctrl.Enabled = state; } if (state) { Delg.SetMinimum(numFor, 1); Delg.SetValue(numFor, 1); } else { Delg.SetMinimum(numFor, 0); Delg.SetValue(numFor, 0); } }
private void RunStop_Click(object sender, EventArgs e) { DisableControls(); if (botworking) { // Stop bot Delg.SetEnabled(RunStop, false); Delg.SetText(RunStop, "Start Bot"); botworking = false; userstop = true; } else { // Run bot DialogResult dialogResult = MessageBox.Show("This scirpt will try to Wonder Trade " + Trades.Value + " pokémon, starting from the slot " + Slot.Value + " of box " + Box.Value + ". Remember to read the wiki for this bot in GitHub before starting.\r\n\r\nDo you want to continue?", "Wonder Trade Bot", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialogResult == DialogResult.Yes && Trades.Value > 0) { if (Program.gCmdWindow.HaX) { MessageBox.Show("Illegal mode enabled. If using a WT folder mode, it will write any pokémon to the game, regardless of legality. It will also attempt to Wonder Trade illegal pokémon it finds.", "Illegal mode", MessageBoxButtons.OK, MessageBoxIcon.Warning); } // Configure GUI Delg.SetText(RunStop, "Stop Bot"); // Initialize variables botworking = true; userstop = false; botstate = BotState.botstart; attempts = 0; maxreconnect = 10; boxchange = true; startbox = Box.Value; startslot = Slot.Value; starttrades = Trades.Value; currentfile = 0; tradewait = 0; pklist = new List <PKM> { }; // Run the bot Program.gCmdWindow.SetBotMode(true); RunBot(); } else { EnableControls(); } } }
private void getNextSlot() { if (Slot.Value == 30) { Delg.SetValue(Box, Box.Value + 1); Delg.SetValue(Slot, 1); boxchange = true; } else { Delg.SetValue(Slot, Slot.Value + 1); } Delg.SetValue(Trades, Trades.Value - 1); if (Trades.Value > 0) { if (sourceBox.Checked) { botstate = BotState.readpoke; } else { botstate = BotState.writefromfolder; } attempts = 0; } else if (runEndless.Checked) { Delg.SetValue(Box, startbox); Delg.SetValue(Slot, startslot); Delg.SetValue(Trades, starttrades); if (sourceBox.Checked) { botstate = BotState.readpoke; } else { botstate = BotState.writefromfolder; } attempts = 0; } else { botstate = BotState.dumpafter; } }
private void handleDataReady(object sender, DataReadyEventArgs e) { if (e.seq != querySeq) //somebody else's data { return; } recvData = e.data; if (DumpSaveCB.Checked) { string folderPath = @Application.StartupPath + "\\Digger\\"; (new FileInfo(folderPath)).Directory.Create(); string fileName = Path.Combine(folderPath, "dump " + StartAddrText.Text + DateTime.Now.ToString("yyyyMMddHHmmss") + ".bin"); File.WriteAllBytes(fileName, recvData); } //Thanks to this, processing will be done in GUI thread //so we don't need to use SetBlahblahblah functions everywhere Delg.SetText(UglyMultithreadingHack, "b"); }
private void ResetForm() { Delg.SetChecked(filterShiny, false); Delg.SetSelectedIndex(filterNature, -1); Delg.SetSelectedIndex(filterAbility, -1); Delg.SetSelectedIndex(filterHPtype, -1); Delg.SetSelectedIndex(filterGender, -1); Delg.SetSelectedIndex(filterHPlogic, 0); Delg.SetSelectedIndex(filterATKlogic, 0); Delg.SetSelectedIndex(filterDEFlogic, 0); Delg.SetSelectedIndex(filterSPAlogic, 0); Delg.SetSelectedIndex(filterSPDlogic, 0); Delg.SetSelectedIndex(filterSPElogic, 0); Delg.SetSelectedIndex(filterPerIVlogic, 0); Delg.SetValue(filterHPvalue, 0); Delg.SetValue(filterATKvalue, 0); Delg.SetValue(filterDEFvalue, 0); Delg.SetValue(filterSPAvalue, 0); Delg.SetValue(filterSPDvalue, 0); Delg.SetValue(filterSPEvalue, 0); }