【WF】WF benben自动机
_WF_
·
·
个人记录
#include<bits/stdc++.h>
#include<windows.h>
#include<stdio.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
#define down(a) keybd_event(a,0,0,0)//按下
#define up(a) keybd_event(a,0,2,0)//弹起
#define press(a) down(a),up(a)//a+b
using namespace std;
string s[10];
struct mosese{
int x,y;
}m[100];
void GetMouseCurPoint(int x)
{
POINT mypoint;
GetCursorPos(&mypoint);
m[x].x=mypoint.x;m[x].y=mypoint.y;
Sleep(1000);
}
void MouseMove(int x, int y)//鼠标移动到指定位置
{
double fScreenWidth = ::GetSystemMetrics(SM_CXSCREEN) - 1;//获取屏幕分辨率宽度
double fScreenHeight = ::GetSystemMetrics(SM_CYSCREEN) - 1;//获取屏幕分辨率高度
double fx = x * (65535.0f / fScreenWidth);
double fy = y * (65535.0f / fScreenHeight);
// printf("fScreenWidth %lf , fScreenHeight %lf, fx %lf, fy %lf \n", fScreenWidth, fScreenHeight, fx, fy);
INPUT Input = { 0 };
Input.type = INPUT_MOUSE;
Input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
Input.mi.dx = fx;
Input.mi.dy = fy;
SendInput(1, &Input, sizeof(INPUT));
}
void check(int x){
MouseMove(m[x].x,m[x].y);
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);//模拟鼠标键按下
Sleep(10);//要留给某些应用的反应时间
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);//模拟鼠标键抬起
}
void put(string sc){
cout<<sc<<endl;
for(int i=0;i<sc.size();i++){
if(sc[i]=='@'){
down(50);down(109);
up(50);up(109);
}
if(sc[i]=='_'){
down(16);down(109);
up(16);up(109);
}
if(sc[i]<='z'&&sc[i]>='a'){
int idc=sc[i];
down(idc);
up(idc);
}
if(sc[i]<='Z'&&sc[i]>='A'){
int idc=sc[i];
press(20);
down(idc);
up(idc);
press(20);
}
}
}
/*
@snow_Dog7 @merlin_Meow @Mynxzh @Cheatme @scean_Tong
*/
int main(){
for(int i=1;i<=4;i++){
Sleep(1000);
cout<<i<<" ";
while(1){
if(KEY_DOWN('A')){
GetMouseCurPoint(i);
break;
}
}
}
int T=50;
while(T--){
// check(1);
// Sleep(2000);
// down(17);Sleep(100);down(86);
// up(17);up(86);
// Sleep(2000);
// check(2);
// Sleep(2000);
check(3);
Sleep(200);
check(4);
Sleep(200);
}
}