This repository has been archived by the owner on Mar 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.c
61 lines (54 loc) · 2.09 KB
/
Main.c
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
#include <stdio.h>
#include <windows.h>
POINT Point;
POINT DefaultPoint;
void clearconsole() {
COORD topLeft = { 0, 0 };
HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO screen;
DWORD written;
GetConsoleScreenBufferInfo(console, &screen);
FillConsoleOutputCharacterA(console, ' ', screen.dwSize.X * screen.dwSize.Y, topLeft, &written);
FillConsoleOutputAttribute(console, FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE,screen.dwSize.X * screen.dwSize.Y, topLeft, &written);
SetConsoleCursorPosition(console, topLeft);
}
void gotoxy(int x, int y) {
COORD pos = {x, y};
HANDLE output = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(output, pos);
}
int main() {
HWND STD_HANDLE = GetStdHandle(STD_OUTPUT_HANDLE);
clearconsole();
SetConsoleTextAttribute(STD_HANDLE, 11);
printf(" ______\n / ____/___ ____ ________ _________ ___ ____ _____\n / / __/ __ \\/ __ \\/ ___/ _ \\/ ___/ __ `__ \\/ __ \\/ ___/\n / /_/ / /_/ / / / / /__/ __/ / / / / / / / /_/ / /\n \\____/\\____/_/ /_/\\___/\\___/_/ /_/ /_/ /_/\\____/_/\n\n");
SetConsoleTextAttribute(STD_HANDLE, 15);
printf(" Goncermor Mouse Mover V1\n\n");
for (int i = 4; i > 0; i--) {
printf(" Starting in %d", i);
Sleep(1000);
gotoxy(0,8);
}
GetCursorPos(&Point);
GetCursorPos(&DefaultPoint);
while (1) {
for (int i = 0; i < 100; i += 5) {
Point.x = DefaultPoint.x + i;
Point.y = DefaultPoint.y + i;
SetCursorPos(Point.x ,Point.y);
gotoxy(0,8);
printf(" Current Loc: X = %d, Y = %d", Point.x, Point.y);
Sleep(20);
}
Sleep(1000);
for (int i = 0; i < 100; i += 2) {
Point.x = DefaultPoint.x - i;
Point.y = DefaultPoint.y - i;
SetCursorPos(Point.x ,Point.y);
gotoxy(0,8);
printf(" Current Loc: X = %d, Y = %d", Point.x, Point.y);
Sleep(20);
}
}
return 0;
}