Advertisement
Guest User

Untitled

a guest
Dec 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text.RegularExpressions;
  5. using System.Runtime.InteropServices;
  6. namespace samael
  7.  {
  8.   public class Program
  9.   { {
  10. [DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)] public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo);
  11. private const int MOUSEEVENTF_LEFTDOWN = 0x02; private const int MOUSEEVENTF_LEFTUP = 0x04;
  12. private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
  13. private const int MOUSEEVENTF_RIGHTUP = 0x10;
  14. public void autoclick() {
  15.  uint X = (uint)Cursor.Position.X;
  16. uint Y = (uint)Cursor.Position.Y; mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
  17. }
  18. Console.WriteLine("clicca *invio* quando vuoi far partire l'autoclick, clicca alt per farlo smettere");
  19. ConsoleKeyInfo key = Console.ReadKey();
  20. boolean loop = true;
  21. boolean actived = false;//per non far crashare il software
  22. if(key.KeyChar == (char) 13){
  23. Thread t = new Thread(autothread);
  24. t.Start();
  25. }else if(key.KeyChar ==Keys.Alt){
  26. loop = false;
  27. }
  28. if(
  29. static void autothread(){
  30. while(loop){
  31. autoclick();
  32. }
  33. }
  34.  }
  35.   }
  36.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement