private void timer1_Tick(object sender, EventArgs e) { MouseFlag.MouseLeftClickEvent(Convert.ToInt16(xPosition), Convert.ToInt16(yPosition), 0); if (timerFlag >= Convert.ToInt16(textBox2.Text) * Convert.ToInt16(textBox1.Text)) { timer1.Stop(); timerFlag = 1; } timerFlag++; }
private void timer1_Tick(object sender, EventArgs e) { switch (timerFlag) { case 1: MouseFlag.MouseLeftClickEvent(500, 600, 0); System.Threading.Thread.Sleep(2 * 1000); break; case 2: MouseFlag.MouseLeftClickEvent(500, 320, 0); System.Threading.Thread.Sleep(2 * 1000); break; case 3: MouseFlag.MouseLeftClickEvent(970, 680, 0); System.Threading.Thread.Sleep(2 * 1000); timerFlag = 0; break; } timerFlag++; }