public static void plantFlower(String flowerCombo) { DialogResult confirmation; //check if plant button is (0,0). True means continue, not (0,0) if (BotFunctions.checkCoordinates("1")) { confirmation = MessageBox.Show("Press OK when ready to begin!", "", MessageBoxButtons.OKCancel); if (confirmation.Equals(DialogResult.Cancel)) { return; } Thread.Sleep(2000); getCoords("1"); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); Thread.Sleep(2000); checkBeans("2"); char[] beans = flowerCombo.ToCharArray(); selectBeans(flowerCombo, beans); pressPlantButton(); Thread.Sleep(1500); MessageBox.Show("Done!"); } else { BotFunctions.updateCoordinates("1");//update the plant flower button coords plantFlower(flowerCombo); Thread.Sleep(2000); } }
private void button5_Click(object sender, EventArgs e) { MessageBox.Show("Press OK when ready to begin!"); Thread.Sleep(2000); BotFunctions.DoMouseClick(); Racing.startRacing(); Rectangle bounds = Screen.GetWorkingArea(Point.Empty); using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height)) { using (Graphics g = Graphics.FromImage(bitmap)) { g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size); } int x = 950; int y = 755; while (y <= 780 && x <= 970) { richTextBox1.AppendText(BotFunctions.HexConverter(bitmap.GetPixel(x, y)) + "\n"); x++; y++; } } }
// GOLF - Down the Hatch public static void downTheHatch()//yellow, needs fixed { BotFunctions.maximizeAndFocus(); Thread.Sleep(15000); InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL); Thread.Sleep(2340); InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL); }
//GOLF - Swing-A-Long public static void swingALong() { BotFunctions.maximizeAndFocus(); Thread.Sleep(15000); InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL); Thread.Sleep(2340);// 82% InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL); }
private static void send(String text) { BotFunctions.DoMouseClick(); Thread.Sleep(500); InputSimulator.SimulateTextEntry(text); Thread.Sleep(500); SendKeys.SendWait("{ENTER}"); }
public Form1() { //isTTRRunning(); InitializeComponent(); BotFunctions.readTextFile(); createDataFileMap(); loadCoordsIntoResetBox(); }
public Form1() { //File.SetAttributes(Path.GetFullPath("InputSimulator.dll"), FileAttributes.Hidden); isTTRRunning(); InitializeComponent(); BotFunctions.readTextFile(); createDataFileMap(); loadCoordsIntoResetBox(); }
//GOLF - Hot Links public static void hotLinks() { BotFunctions.maximizeAndFocus(); Thread.Sleep(15000); toonLookAtHole(); Thread.Sleep(3000); InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL); Thread.Sleep(1800); // 67% InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL); }
// GOLF- Afternoon Tee public static void afternoonTee()//works, finished { BotFunctions.maximizeAndFocus(); Thread.Sleep(15000); toonLookAtHole(); Thread.Sleep(3000); InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL); Thread.Sleep(2120); InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL); }
//GOLF - Peanut Putter public static void peanutPutter() { BotFunctions.maximizeAndFocus(); Thread.Sleep(15000); toonLookAtHole(); Thread.Sleep(3000); InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL); Thread.Sleep(1860); // 69-70% ? InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL); }
// GOLF - Seeing green public static void seeingGreen()//works, finished { BotFunctions.maximizeAndFocus(); Thread.Sleep(15000); toonLookAtHole(); Thread.Sleep(3000); InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL); Thread.Sleep(1790); // 67% InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL); }
// GOLF - Hole on the Range public static void holeOnTheRange()//needs fixed? Not sure { BotFunctions.maximizeAndFocus(); Thread.Sleep(15000); toonLookAtHole(); Thread.Sleep(3000); InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL); Thread.Sleep(1800); // 68% InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL); }
private void startFishing_Click(object sender, EventArgs e)//button to start fishing { string selected = (string)comboBox3.SelectedItem; int numberOfCasts = Convert.ToInt32(numericUpDown3.Value); int numberOfSells = Convert.ToInt32(numericUpDown4.Value); BotFunctions.tellFishingLocation(selected); MessageBox.Show("Make sure you're in the fishing dock before pressing OK!"); startFishingThread(selected, numberOfCasts, numberOfSells, false); }
public static void oneLittleBirdie() { BotFunctions.maximizeAndFocus(); Thread.Sleep(15000); //rotate the toon right InputSimulator.SimulateKeyDown(VirtualKeyCode.RIGHT); Thread.Sleep(700); InputSimulator.SimulateKeyUp(VirtualKeyCode.RIGHT); InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL); Thread.Sleep(1870); // 69-70% ? InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL); }
public static void openSpeedChat() { Thread.Sleep(1000); //Below is the location for the SpeedChat button location //check if coordinates for the button is (0,0). True means they're not (0,0). if (BotFunctions.checkCoordinates("20")) { getCoords("20"); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); Thread.Sleep(1000); //Below is the location for pets tab //check if coordinates for the button is (0,0). True means they're not (0,0). if (BotFunctions.checkCoordinates("21")) { getCoords("21"); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); Thread.Sleep(1000); //Below is the location for tricks tab //check if coordinates for the button is (0,0). True means they're not (0,0). if (BotFunctions.checkCoordinates("22")) { getCoords("22"); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); Thread.Sleep(1000); } else { BotFunctions.updateCoordinates("22"); Thread.Sleep(2000); openSpeedChat(); } } else { BotFunctions.updateCoordinates("21"); Thread.Sleep(2000); openSpeedChat(); } } else//means it was (0,0) and needs updated { BotFunctions.updateCoordinates("20"); Thread.Sleep(2000); openSpeedChat(); } }
// GOLF - Swing Time public static void swingTime()//yellow, needs fixed (move to the right?) { BotFunctions.maximizeAndFocus(); Thread.Sleep(100); //move toon to the right location InputSimulator.SimulateKeyDown(VirtualKeyCode.RIGHT); Thread.Sleep(50); InputSimulator.SimulateKeyUp(VirtualKeyCode.RIGHT); Thread.Sleep(100); Thread.Sleep(15000); InputSimulator.SimulateKeyDown(VirtualKeyCode.CONTROL); Thread.Sleep(2000); InputSimulator.SimulateKeyUp(VirtualKeyCode.CONTROL); }
private static void exitFishing() { if (BotFunctions.checkCoordinates("16"))//returns true if they are not 0,0 { getCoords("16"); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); } else { BotFunctions.updateCoordinates("16"); exitFishing(); } }
public static Boolean keepToonAwake(int min) { DateTime endTime = DateTime.Now.AddMinutes(min); BotFunctions.DoMouseClick(); while (endTime > DateTime.Now) { SendKeys.SendWait("^"); if (Control.ModifierKeys == Keys.Alt)//break out of loop { return(true); } } return(false); }
private static void checkBeans(String location) { if (Convert.ToInt32(location) <= 10) { if (!BotFunctions.checkCoordinates(location))//if they're 0,0 { BotFunctions.updateCoordinates(location); checkBeans(Convert.ToString(Convert.ToInt32(location) + 1)); } else { checkBeans(Convert.ToString(Convert.ToInt32(location) + 1)); } } }
private static void selectYESToRemove() { if (BotFunctions.checkCoordinates("14")) { getCoords("14"); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); } else { BotFunctions.updateCoordinates("14");//update the plant flower button coords selectYESToRemove(); Thread.Sleep(2000); } }
private void isTTRRunning() { ProcessStartInfo startInfo = new ProcessStartInfo("Toontown Rewritten [BETA]"); DialogResult confirmation; while (!(Process.GetProcessesByName("TTREngine").Length > 0)) { confirmation = MessageBox.Show("Press OK once running or Cancel.", "ToonTown Rewritten is not running!", MessageBoxButtons.OKCancel); if (confirmation.Equals(DialogResult.Cancel)) { Environment.Exit(0); } } BotFunctions.maximizeTTRWindow(); }
public static void scratchDoodle() { if (BotFunctions.checkCoordinates("19")) { getCoords("19"); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); Thread.Sleep(10000); } else { BotFunctions.updateCoordinates("19"); Thread.Sleep(2000); scratchDoodle(); } }
private static void castLine(bool fishVariance) { getCoords("15"); int randX = 0; int randY = 0; if (fishVariance) { randX = rand.Next(-VARIANCE, VARIANCE + 1); randY = rand.Next(-VARIANCE, VARIANCE + 1); } BotFunctions.MoveCursor(x + randX, y + randY); Debug.WriteLine("X variance: " + randX + " \nY Variance: " + randY); BotFunctions.DoFishingClick(); }
private static void sellFish() { if (BotFunctions.checkCoordinates("17"))//returns true if they are not 0,0 { Thread.Sleep(2100); getCoords("17"); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); } else { BotFunctions.updateCoordinates("17"); sellFish(); } Thread.Sleep(2000); }
private static void clickOKAfterPlant() { if (BotFunctions.checkCoordinates("12")) { getCoords("12"); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); Thread.Sleep(2000); } else { BotFunctions.updateCoordinates("12"); Thread.Sleep(2000); clickOKAfterPlant(); } }
private static void selectBeans(String flowerCombo, char[] beans) { for (int i = 0; i < flowerCombo.Length; i++) { switch (beans[i]) { case 'r': getCoords("2"); break; case 'g': getCoords("3"); break; case 'o': getCoords("4"); break; case 'u': getCoords("5"); break; case 'b': getCoords("6"); break; case 'i': getCoords("7"); break; case 'y': getCoords("8"); break; case 'c': getCoords("9"); break; case 's': getCoords("10"); break; } BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); Thread.Sleep(2000); } }
public static void feedDoodle() { //check if coordinates for the button is (0,0). True means they're not (0,0). if (BotFunctions.checkCoordinates("18")) { getCoords("18"); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); Thread.Sleep(11500); } else//means it was (0,0) and needs updated { BotFunctions.updateCoordinates("18"); Thread.Sleep(2000); feedDoodle(); } }
public static void removePlant() { if (BotFunctions.checkCoordinates("1")) { getCoords("1"); MessageBox.Show("Press OK when ready to begin!"); Thread.Sleep(2000); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); selectYESToRemove(); } else { BotFunctions.updateCoordinates("1");//update the plant flower button coords removePlant(); Thread.Sleep(2000); } }
private static bool checkIfFishCaught() { bool result = false; getCoords("15"); String color = BotFunctions.HexConverter(BotFunctions.GetColorAt(x, y - 600)); if (color.Equals("#FFFFBE") || color.Equals("#FFFFBF")) { result = true;//fish caught } // Check if boot caught (smaller catch window) color = BotFunctions.HexConverter(BotFunctions.GetColorAt(x, 110)); if (color.Equals("#FFFFBE") || color.Equals("#FFFFBF")) { result = true;//fish caught } return(result); }
public static void waterPlant() { if (BotFunctions.checkCoordinates("13")) { getCoords("13"); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); Thread.Sleep(4000); BotFunctions.MoveCursor(x, y); BotFunctions.DoMouseClick(); Thread.Sleep(2000); } else { BotFunctions.updateCoordinates("13"); Thread.Sleep(2000); waterPlant(); } }