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.RegularExpressions;
- using System.Runtime.InteropServices;
- namespace samael
- {
- public class Program
- { {
- [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);
- private const int MOUSEEVENTF_LEFTDOWN = 0x02; private const int MOUSEEVENTF_LEFTUP = 0x04;
- private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
- private const int MOUSEEVENTF_RIGHTUP = 0x10;
- public void autoclick() {
- uint X = (uint)Cursor.Position.X;
- uint Y = (uint)Cursor.Position.Y; mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
- }
- Console.WriteLine("clicca *invio* quando vuoi far partire l'autoclick, clicca alt per farlo smettere");
- ConsoleKeyInfo key = Console.ReadKey();
- boolean loop = true;
- boolean actived = false;//per non far crashare il software
- if(key.KeyChar == (char) 13){
- Thread t = new Thread(autothread);
- t.Start();
- }else if(key.KeyChar ==Keys.Alt){
- loop = false;
- }
- if(
- static void autothread(){
- while(loop){
- autoclick();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement