-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
125 lines (117 loc) · 5.13 KB
/
Copy pathProgram.cs
File metadata and controls
125 lines (117 loc) · 5.13 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using WindowsInput;
namespace SnapchatBot
{
class Program
{
static void Main(string[] args)
{
while(true){
for(int y = 78; y < 700; y+=58){
Color pixelColor = GetColorAt(993, y);
//Color [A=255, R=243, G=70, B=95]
if(pixelColor.R > 238 && pixelColor.G > 60 && pixelColor.G < 80 && pixelColor.B > 85 && pixelColor.B < 105){
// Console.WriteLine(y);
// Console.WriteLine(pixelColor);
//483 425 368 310
// 58 57 58
float xMultiplier = 993f / 1366f;
float yMultiplier = y / 768f;
new InputSimulator().Keyboard
.Mouse
.MoveMouseToPositionOnVirtualDesktop(xMultiplier * 65535, yMultiplier * 65535)
.LeftButtonClick()
.Sleep(1000)
.LeftButtonClick()
.Sleep(2000);
}
}
for(int i = 0; i < 9; i++){
// 142 199 256 314 373 429 488 545 604
int y = 0;
if(i == 0){
y = 136;
}else if(i == 1){
y = 193;
}else if(i == 2){
y = 250;
}else if(i == 3){
y = 309;
}else if(i == 4){
y = 376;
}else if(i == 5){
y = 424;
}else if(i == 6){
y = 483;
}else if(i == 7){
y = 540;
}else if(i == 8){
y = 599;
}
Color pixelColor = GetColorAt(1295, y);
//Console.WriteLine(pixelColor);
//Color [A=255, R=243, G=70, B=95]
if(pixelColor.R < 80 && pixelColor.G < 80 && pixelColor.B < 80){
// Console.WriteLine(y);
// Console.WriteLine(pixelColor);
//483 425 368 310
// 58 57 58
float xMultiplier1 = 1295f / 1366f;
float yMultiplier1 = y / 768f;
float xMultiplier2 = 1130f / 1366f;
float yMultiplier2 = 670f / 768f;
float xMultiplier3 = 1303f / 1366f;
float yMultiplier3 = 86f / 768f;
float xMultiplier4 = 1280f / 1366f;
float yMultiplier4 = 735f / 768f;
new InputSimulator().Keyboard
.Mouse
.MoveMouseToPositionOnVirtualDesktop(xMultiplier1 * 65535, yMultiplier1 * 65535)
.LeftButtonClick()
.Sleep(6000)
.MoveMouseToPositionOnVirtualDesktop(xMultiplier2 * 65535, yMultiplier2 * 65535)
.LeftButtonClick()
.Sleep(2000)
.MoveMouseToPositionOnVirtualDesktop(xMultiplier3 * 65535, yMultiplier3 * 65535)
.LeftButtonClick()
.Sleep(2000)
.Keyboard
.ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_V)
.Sleep(2000)
.Mouse
.MoveMouseToPositionOnVirtualDesktop(xMultiplier3 * 65535, yMultiplier3 * 65535)
.LeftButtonClick()
.Sleep(2000)
.MoveMouseToPositionOnVirtualDesktop(xMultiplier4 * 65535, yMultiplier4 * 65535)
.LeftButtonClick()
.Sleep(2000);
}
}
}
// new InputSimulator().Keyboard
// // .ModifiedKeyStroke(VirtualKeyCode.CONTROL, VirtualKeyCode.VK_V);
// .Mouse
// .MoveMouseToPositionOnVirtualDesktop(47600, 16500);
}
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr GetDesktopWindow();
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr GetWindowDC(IntPtr window);
[DllImport("gdi32.dll", SetLastError = true)]
public static extern uint GetPixel(IntPtr dc, int x, int y);
[DllImport("user32.dll", SetLastError = true)]
public static extern int ReleaseDC(IntPtr window, IntPtr dc);
public static Color GetColorAt(int x, int y)
{
IntPtr desk = GetDesktopWindow();
IntPtr dc = GetWindowDC(desk);
int a = (int) GetPixel(dc, x, y);
ReleaseDC(desk, dc);
return Color.FromArgb(255, (a >> 0) & 0xff, (a >> 8) & 0xff, (a >> 16) & 0xff);
}
}
}
// this was sent by my automated snap program since i don't feel like using the app
// view the painful code behind it at github.com/decentishdev/snapchatbot