跳到正文

个人记录

模仿人类

count_year约 9 分钟
原文
文章信息与版本

文章信息

发布
2025年11月7日
收录
2025年12月12日
更新
2026年11月17日
篇幅
约 9 分钟

版本

  1. v3当前
  2. v2
  3. v1
C++
#include<bits/stdc++.h>
#include<windows.h>
void asd(char a){
	keybd_event(a,0,0,0);
	Sleep(1);
	keybd_event(a,0,KEYEVENTF_KEYUP,0);
	Sleep(1);
}
void asdf(char a){
	keybd_event(VK_SHIFT,0,0,0);
	Sleep(1);
	keybd_event(a,0,0,0);
	Sleep(1);
	keybd_event(VK_SHIFT,0,KEYEVENTF_KEYUP,0);
	Sleep(1);
	keybd_event(a,0,KEYEVENTF_KEYUP,0);
	Sleep(1);
}
void asdd(char a){
	keybd_event(17,0,0,0);
	Sleep(1);
	keybd_event(a,0,0,0);
	Sleep(1);
	keybd_event(17,0,KEYEVENTF_KEYUP,0);
	Sleep(1);
	keybd_event(a,0,KEYEVENTF_KEYUP,0);
	Sleep(1);
}
int main() {
	srand(time(NULL));
    POINT pt;
    pt.x=100;
    pt.y=100;
    int len=1;
	double x=1;
	double y=1;
	bool flag=0;
    while(1){
    	while(!GetAsyncKeyState(38));
    	while(1){
	    	if(rand()%10==0){
	    		int t=rand()%8;
	    		for(int i=1;i<=rand()%100;i++){
	    			Sleep(10);
	    			if(rand()%2==0){
		    			x-=0.1*(rand()%5);
					}else{
						x+=0.1*(rand()%5);
					}
					if(x>1){
						x=1;
					}
					if(x<-1){
						x=-1;
					}
		    		if(rand()%2==0){
		    			y+=0.1;
					}else{
						y-=0.1;
					}
					if(y>1){
						y=1;
					}
					if(y<-1){
						y=-1;
					}
					if(x>0&&pt.x>=1590){
						x=-x;
					}
					if(x<0&&pt.x<=9){
						x=-x;
					}
					if(y>0&&pt.y>=890){
						y=-y;
					}
					if(y<0&&pt.y<=9){
						y=-y;
					}
		    		pt.x+=len*x;
		    		pt.y+=len*y;
					if(rand()%2==0){
						len++;
						if(len>15){
							len=15;
						}
					}else{
						len--;
						if(len<3){
							len=3;
						}
					}
	    			SetCursorPos(pt.x,pt.y);
				} 
			}
	    	SetCursorPos(pt.x,pt.y);
	    	if(rand()%10==0){
	    		flag=!flag;
	    		if(flag==1){
	    			mouse_event(MOUSEEVENTF_LEFTDOWN,pt.x,pt.y,0,NULL);
				}else{
					mouse_event(MOUSEEVENTF_LEFTUP,pt.x,pt.y,0,NULL);
				}
			}else if(rand()%30==0){
	    		mouse_event(MOUSEEVENTF_LEFTDOWN,pt.x,pt.y,0,NULL);
	    		Sleep(1);
				mouse_event(MOUSEEVENTF_LEFTUP,pt.x,pt.y,0,NULL);
				if(rand()%5==0){
					int v=0;
					for(int i=1;i<=rand()%400;i++){
						if(rand()%50==0){
							int kkk=rand()%4;
							if(kkk==0){
								asdd('A');
							}
							if(kkk==1){
								asdd('C');
							}
							if(kkk==2){
								asdd('V');
							}
							if(kkk==3){
								asdd('Z');
							}
						}else{
							if(v==0&&rand()%12==0){
								if(rand()%2==0){
									v=2;
									asd(188);
								}else{
									v=1;
									asd(190);
								}
							}else{
								int kkk=rand()%35;
								if(kkk<=25){
									if(v==1){
										v=0;
										asdf('A'+kkk);
									}else{
										asd('A'+kkk);
									}
								}else if(kkk<=30){
									if(v==1){
										asd(32);
									}
								}else if(kkk<=32){
									if(v==1){
										asd(13);
									}
								}else{
									asd(8);
								}
							}
						}
						Sleep(rand()%100);
					}
				}
			}
	    	if(GetAsyncKeyState(VK_ESCAPE)){
	            break;
	        }
		}
	}
	    
    return 0;
}
C++
#include<bits/stdc++.h>
#include<windows.h>
void asd(char a){
	keybd_event(a,0,0,0);
	Sleep(1);
	keybd_event(a,0,KEYEVENTF_KEYUP,0);
	Sleep(1);
}
void asdf(char a){
	keybd_event(VK_SHIFT,0,0,0);
	Sleep(1);
	keybd_event(a,0,0,0);
	Sleep(1);
	keybd_event(VK_SHIFT,0,KEYEVENTF_KEYUP,0);
	Sleep(1);
	keybd_event(a,0,KEYEVENTF_KEYUP,0);
	Sleep(1);
}
void asdd(char a){
	keybd_event(17,0,0,0);
	Sleep(1);
	keybd_event(a,0,0,0);
	Sleep(1);
	keybd_event(17,0,KEYEVENTF_KEYUP,0);
	Sleep(1);
	keybd_event(a,0,KEYEVENTF_KEYUP,0);
	Sleep(1);
}
int main() {
	srand(time(NULL));
    POINT pt;
    pt.x=100;
    pt.y=100;
    int len=1;
	double x=1;
	double y=1;
	bool flag=0;
    while(1){
    	while(!GetAsyncKeyState(38));
    	while(1){
			int v=0;
			for(int i=1;i<=rand()%400;i++){
				if(rand()%50==0){
					int kkk=rand()%4;
					if(kkk==0){
						asdd('A');
					}
					if(kkk==1){
						asdd('C');
					}
					if(kkk==2){
						asdd('V');
					}
					if(kkk==3){
						asdd('Z');
					}
				}else{
					if(v==0&&rand()%12==0){
						if(rand()%2==0){
							v=2;
							asd(188);
						}else{
							v=1;
							asd(190);
						}
					}else{
						int kkk=rand()%35;
						if(kkk<=25){
							if(v==1){
								v=0;
								asdf('A'+kkk);
							}else{
								asd('A'+kkk);
							}
						}else if(kkk<=30){
							if(v==1){
								asd(32);
							}
						}else if(kkk<=32){
							if(v==1){
								asd(13);
							}
						}else{
							asd(8);
						}
					}
				}
				Sleep(rand()%100);
			}
	    	if(GetAsyncKeyState(VK_ESCAPE)){
	            break;
	        }
		}
	}
    return 0;
}
原文