参考项目: OverStim

OpenCV https://github.com/opencv/opencv

AutoHotKey AHK

GUI:

https://github.com/qiekn/wxwidgets-notes

https://github.com/ennoxreal/csgo-imgui-cool-menu


Minkelxy/NZM_CMD

https://github.com/Minkelxy/NZM_CMD

首先看这个项目是如何实现模拟设备操作的,项目提供了两种选择

NZM Auto

https://github.com/qiekn/nzm-auto

通过上面的项目,我去了解了一下 Enigo,这个库底层实际是调用了 Windows SendInput API ,我们使用 C++ 可以直接调用,无需第三方库

#include <Windows.h>

// 鼠标绝对移动
void mouse_abs(int x, int y) {
  INPUT input = {};
  input.type = INPUT_MOUSE;
  input.mi.dx = x * 65535 / GetSystemMetrics(SM_CXSCREEN);
  input.mi.dy = y * 65535 / GetSystemMetrics(SM_CYSCREEN);
  input.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
  SendInput(1, &input, sizeof(INPUT));
}

// 键盘按键
void key_press(WORD vk) {
  INPUT inputs[2] = {};
  inputs[0].type = INPUT_KEYBOARD;
  inputs[0].ki.wVk = vk;
  inputs[1].type = INPUT_KEYBOARD;
  inputs[1].ki.wVk = vk;
  inputs[1].ki.dwFlags = KEYEVENTF_KEYUP;
  SendInput(2, inputs, sizeof(INPUT));
}

我们也来实现一层抽象

void MouseMove(float x, float y);
void 

DG-Lab

塔防模式:触发条件