-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
60 lines (53 loc) · 2 KB
/
Program.cs
File metadata and controls
60 lines (53 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace AutoSwiper
{
class Program
{
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int wMsg, int wParam, int lParam);
const int WM_KEYDOWN = 0x0100;
const int WM_KEYUP = 0x0101;
const int VK_SPACE = 0x20;
static void ClickOnWindowContinually(IntPtr windowHandle)
{
while (true)
{
SendMessage(windowHandle, WM_KEYDOWN, VK_SPACE, 0);
Thread.Sleep(5);
SendMessage(windowHandle, WM_KEYUP, VK_SPACE, 0);
Thread.Sleep(5);
}
}
static void Main(string[] args)
{
const string tinderName = "Tinder | Dating, Make Friends & Meet New People";
List<IntPtr> tinderWindows = new List<IntPtr>();
//find all open tinders on the computer
Process[] processlist = Process.GetProcesses();
foreach (Process process in processlist)
{
if (!String.IsNullOrEmpty(process.MainWindowTitle))
{
Console.WriteLine("Process: {0} ID: {1} Window title: {2}", process.ProcessName, process.Id, process.MainWindowTitle);
if (process.MainWindowTitle.Contains(tinderName))
{
IntPtr WindowHandle = process.MainWindowHandle;
tinderWindows.Add(WindowHandle);
}
}
}
//loop through all tinder windows, create threads for each and send window message for automatic swiping
foreach (IntPtr windowHandle in tinderWindows)
new Thread(() => ClickOnWindowContinually(windowHandle)).Start();
while (true)
Thread.Sleep(100);
}
}
}