Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using WindowsInput;
- using WindowsInput.Native;
- using System.Threading;
- using System.Runtime.InteropServices;
- namespace test
- {
- static class ThreadCreationProgram
- {
- public static int seconds = 0;
- public static int input = 24;
- public static void Clicker()
- {
- InputSimulator s = new InputSimulator();
- Console.WriteLine("Starting Clicker");
- s.Mouse.Sleep(2000);
- while (true)
- {
- for (int i = 0; i < 150; i++)
- {
- s.Mouse.LeftButtonClick();
- }
- Thread.Sleep(1000);
- }
- }
- /*
- public static void Clock()
- {
- Thread.Sleep(2000);
- while (seconds < input)
- {
- Thread.Sleep(1000);
- seconds++;
- Console.WriteLine("second {0}", seconds);
- }
- }
- */
- }
- class Program
- {
- static void Main(string[] args)
- {
- int seconds = 0;
- int input = 25;
- ThreadStart clicker = new ThreadStart(ThreadCreationProgram.Clicker);
- Thread click = new Thread(clicker);
- click.Start();
- Thread.Sleep(1000);
- while (seconds < input)
- {
- Thread.Sleep(1000);
- seconds++;
- Console.WriteLine("second {0}", seconds);
- }
- Console.WriteLine("aborting clicking");
- click.Abort();
- Console.WriteLine("Clicking aborted");
- Console.Read();
- }
- }
- }
- /*
- int sec = 0;
- ThreadCreationProgram thread = new ThreadCreationProgram();
- Testy t = new Testy();
- InputSimulator s = new InputSimulator();
- ThreadStart childref = new ThreadStart(ThreadCreationProgram.CallToChildThread);
- Console.WriteLine("In Main: Creating the Child thread");
- Thread childThread = new Thread(childref);
- childThread.Start();
- while(sec <10)
- {
- Thread.Sleep(1000);
- sec++;
- Console.WriteLine("Sec = {0}", sec);
- }
- Console.ReadKey();
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement