• 个人简介

    忍一时风平浪静,退一步海阔天空。

    但若步步退让,终无立锥之地!!!














    一个不错的连点器

    !!在某些电脑上可能会CE!!

    #include <windows.h>
    #include <stdio.h>
    #include <bits/stdc++.h>
    using namespace std;
    // 返回当前按下的大写字母(A-Z),但 Y 键返回 0,其他情况返回 0
    int IsLeftMouseButtonPressed() {
        return (GetAsyncKeyState(VK_LBUTTON) & 0x8000) ? 1 : 0;
    }
    char GetPressedLetter() {
        // 遍历 A-Z 的虚拟键码(VK_A 到 VK_Z)
        for (int vk = 'A'; vk <= 'Z'; vk++) {
            if (GetAsyncKeyState(vk) & 0x8000) { // 检查按键是否按下
                // 如果是 Y 键,返回 0
                if (vk == 'Y') {
                    return 0;
                }
                // 否则返回对应的大写字母
                return (char)vk;
            }
        }
        return 0; // 没有字母按下,或按下了 Y 键
    }
    void SimulateKeyPress(WORD vkCode, bool ctrl = false, bool alt = false, bool shift = false) {
        INPUT inputs[4] = {};
        int inputCount = 0;
        
        // 按下修饰键
        if(ctrl) {
            inputs[inputCount].type = INPUT_KEYBOARD;
            inputs[inputCount].ki.wVk = VK_CONTROL;
            inputCount++;
        }
        if(alt) {
            inputs[inputCount].type = INPUT_KEYBOARD;
            inputs[inputCount].ki.wVk = VK_MENU;  // Alt键
            inputCount++;
        }
        if(shift) {
            inputs[inputCount].type = INPUT_KEYBOARD;
            inputs[inputCount].ki.wVk = VK_SHIFT;
            inputCount++;
        }
        
        // 按下主键
        inputs[inputCount].type = INPUT_KEYBOARD;
        inputs[inputCount].ki.wVk = vkCode;
        inputCount++;
        
        // 释放主键
        inputs[inputCount] = inputs[inputCount - 1];
        inputs[inputCount].ki.dwFlags = KEYEVENTF_KEYUP;
        inputCount++;
        
        // 释放修饰键(逆序)
        if(shift) {
            inputs[inputCount].type = INPUT_KEYBOARD;
            inputs[inputCount].ki.wVk = VK_SHIFT;
            inputs[inputCount].ki.dwFlags = KEYEVENTF_KEYUP;
            inputCount++;
        }
        if(alt) {
            inputs[inputCount].type = INPUT_KEYBOARD;
            inputs[inputCount].ki.wVk = VK_MENU;
            inputs[inputCount].ki.dwFlags = KEYEVENTF_KEYUP;
            inputCount++;
        }
        if(ctrl) {
            inputs[inputCount].type = INPUT_KEYBOARD;
            inputs[inputCount].ki.wVk = VK_CONTROL;
            inputs[inputCount].ki.dwFlags = KEYEVENTF_KEYUP;
            inputCount++;
        }
        
        SendInput(inputCount, inputs, sizeof(INPUT));
    }
    POINT GetMousePosition() {
        POINT pt;
        GetCursorPos(&pt);
        return pt;
    }
    
    // 模拟鼠标左键点击
    void SimulateMouseClick() {
        INPUT inputs[2] = {};
        
        // 按下左键
        inputs[0].type = INPUT_MOUSE;
        inputs[0].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
        
        // 释放左键
        inputs[1].type = INPUT_MOUSE;
        inputs[1].mi.dwFlags = MOUSEEVENTF_LEFTUP;
        
        SendInput(2, inputs, sizeof(INPUT));
    }
    
    // 模拟右键点击
    void SimulateRightClick() {
        INPUT inputs[2] = {};
        
        inputs[0].type = INPUT_MOUSE;
        inputs[0].mi.dwFlags = MOUSEEVENTF_RIGHTDOWN;
        
        inputs[1].type = INPUT_MOUSE;
        inputs[1].mi.dwFlags = MOUSEEVENTF_RIGHTUP;
        
        SendInput(2, inputs, sizeof(INPUT));
    }
    
    // 设置光标到屏幕的绝对位置 (x, y)
    void SetMousePosition(int x, int y) {
        SetCursorPos(x, y);
    }
    
    bool IsKeyPressed(int vkCode) {
        // 最高位为1表示按键被按下
        return (GetKeyState(vkCode) & 0x8000) != 0;
    }
    
    void dianji(int mod){
    	if(mod == 1){
    		SimulateRightClick();
    	}
    	if(mod == 0){
    		SimulateMouseClick();
    	}
    }
    
    int main(){
    	POINT list[100010] = {};
    	char clist[100010] = {};
    	int waittime = 10;
    	int top = 0; 
    	int op = 0;
    	int isg = 0;
    	int nowtop = 1;
    	int mod = 0;
    	bool isclean = 1;
    	printf("MadeInQin秦制造 连点器\n  按住G键连点,松开结束\n  按Y开始标记连点位置,再按Y开始定点连点,再按Y结束\n  按H调整连点速度(多少毫秒一次)\n  C清屏\n  Esc退出\n\n按S启动\n");
    	while(true){
        	if(IsKeyPressed('S')){
        		break;
    		}
    	}
        while(true){
        	if(IsKeyPressed(VK_ESCAPE)){
        		return 1;//如果不想Esc退出(如在玩我的世界),可以把这一行注释掉 
    		}
        	POINT xy = GetMousePosition();
        	if(IsKeyPressed('R')){
        		mod++;
        		mod = mod%2;
    			Sleep(500);
    			//清屏
    			isclean = 1; 
    		}
        	if(IsKeyPressed('Y')){
    			//清屏
    			isclean = 1; 
        		op = op+1;
        		op = op%3;
    			Sleep(500);
    		}if(op == 1){
    			if(IsLeftMouseButtonPressed()){
    				top++;
    				list[top] = xy;
    				Sleep(100);
    				//清屏
    				isclean = 1; 
    			}
    			char cc = GetPressedLetter();
    			if(cc != 0){
    				clist[top] = cc; 
    				Sleep(100);
    				//清屏
    				isclean = 1; 
    			}
    		}if(op == 2){
    			nowtop++;
    			if(nowtop>top){
    				nowtop = 1;
    			}
    			SetMousePosition(list[nowtop].x,list[nowtop].y);
    			dianji(mod);
    			if(clist[nowtop]!=0){
    				SimulateKeyPress(clist[nowtop]);
    			}
    		}if(op == 0){
    			nowtop = 1;
    			if(top != 0){
    				for(int i = 0;i<=top+1;i++){
    					clist[i] = 0;
    					list[i].x = 0;
    					list[i].y = 0;
    				}top = 0;
    			}
    		}
    		if(IsKeyPressed('G') && op == 0){
    			if(isg == 0){
    				//清屏
    				isclean = 1; 
    			}
    			dianji(mod);
    			isg = 1;
    		}else{
    			if(isg == 1){
    				//清屏
    				isclean = 1; 
    			}
    			isg = 0;
    		}
    		if(IsKeyPressed('H') && op == 0){
    			system("cls");
    			printf("请输入新速度,原始速度%dms:\n  ms:",waittime);
    			cin>>waittime;
    			isclean = 1;
    		}
    		if(IsKeyPressed('C')){
    			isclean = 1;
    		}
    		if(isclean){
    			system("cls");
    			isclean = 0;
    			printf("MadeInQin秦制造 连点器\n连点速度%dms\n连点状态:  \n   ",waittime);
    			if(isg){
    				cout<<"G键长按";
    			}else if(op == 0){
    				cout<<"待命";
    			}else if(op == 1){
    				cout<<"计入坐标,上一个为("<<list[top].x<<","<<list[top].y<<")";
    				if(clist[top] != 0){
    					cout<<"与按下"<<clist[top]; 
    				}
    			}else if(op == 2){
    				cout<<"Y键连点中..."; 
    			}cout<<"\n   连点按键"; 
        		if(mod == 0){
        			cout<<"左键\n";
    			}else{
        			cout<<"右键\n"; 
    			}
    		}
    		Sleep(waittime);
    	}
    }
    
  • 最近活动