Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using WindowsInput;
  7. using WindowsInput.Native;
  8. using System.Threading;
  9. using System.Runtime.InteropServices;
  10.  
  11.  
  12.  
  13. namespace test
  14. {
  15.  
  16.  
  17.  
  18.  
  19. static class ThreadCreationProgram
  20. {
  21.  
  22. public static int seconds = 0;
  23. public static int input = 24;
  24.  
  25.  
  26. public static void Clicker()
  27. {
  28. InputSimulator s = new InputSimulator();
  29.  
  30. Console.WriteLine("Starting Clicker");
  31.  
  32.  
  33. s.Mouse.Sleep(2000);
  34. while (true)
  35. {
  36. for (int i = 0; i < 150; i++)
  37. {
  38. s.Mouse.LeftButtonClick();
  39. }
  40. Thread.Sleep(1000);
  41. }
  42. }
  43. /*
  44. public static void Clock()
  45. {
  46. Thread.Sleep(2000);
  47. while (seconds < input)
  48. {
  49. Thread.Sleep(1000);
  50. seconds++;
  51. Console.WriteLine("second {0}", seconds);
  52.  
  53.  
  54. }
  55.  
  56. }
  57. */
  58.  
  59.  
  60. }
  61.  
  62.  
  63.  
  64. class Program
  65. {
  66.  
  67.  
  68. static void Main(string[] args)
  69. {
  70. int seconds = 0;
  71. int input = 25;
  72.  
  73.  
  74.  
  75. ThreadStart clicker = new ThreadStart(ThreadCreationProgram.Clicker);
  76.  
  77. Thread click = new Thread(clicker);
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. click.Start();
  85.  
  86.  
  87.  
  88. Thread.Sleep(1000);
  89. while (seconds < input)
  90. {
  91. Thread.Sleep(1000);
  92. seconds++;
  93. Console.WriteLine("second {0}", seconds);
  94.  
  95.  
  96. }
  97. Console.WriteLine("aborting clicking");
  98. click.Abort();
  99. Console.WriteLine("Clicking aborted");
  100. Console.Read();
  101.  
  102.  
  103. }
  104.  
  105.  
  106.  
  107.  
  108. }
  109. }
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119. /*
  120. int sec = 0;
  121.  
  122. ThreadCreationProgram thread = new ThreadCreationProgram();
  123. Testy t = new Testy();
  124. InputSimulator s = new InputSimulator();
  125.  
  126. ThreadStart childref = new ThreadStart(ThreadCreationProgram.CallToChildThread);
  127. Console.WriteLine("In Main: Creating the Child thread");
  128.  
  129. Thread childThread = new Thread(childref);
  130.  
  131.  
  132. childThread.Start();
  133.  
  134. while(sec <10)
  135. {
  136. Thread.Sleep(1000);
  137. sec++;
  138. Console.WriteLine("Sec = {0}", sec);
  139. }
  140.  
  141. Console.ReadKey();
  142. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement