自动评论脚本

被某个UP主欺骗了那么久,很气遂写下...............

#include
#include
#include
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0) 
using namespace std;
int main() {
	int now = 0;
    cout << "1.先把评论内容复制到剪贴板上" << endl;
	cout << "2.输入次数后请按回车" << endl;
	cout << "3.把鼠标箭头放到发表评论上,在按Q即可" << endl;
	cout << "4.本脚本将按照每20秒一次的速度评论,防止验证码" << endl;
	cout << "5.按空格可以中途停止退出" << endl;
	cout << "*************************************" << endl;
	cout << "          请输入自动评论次数" << endl;
	cout << "**************************************" << endl;
	cout << endl;
	cout << endl;
	cin >> now;
	int count = 0;
	int stop = 1;
	int go = 0;
	int stoptime = 0;
	while (stop)
	{
		if (KEY_DOWN('Q'))
		{
			go = 1;
		}
		if (go == 1)
		{


			count++;
			stoptime++;
			mouse_event(MOUSEEVENTF_LEFTDOWN, 10, 10, 0, 0);
			Sleep(100);
			mouse_event(MOUSEEVENTF_LEFTUP, 10, 10, 0, 0);
			keybd_event(VK_CONTROL, 0, 0, 0);
			keybd_event('V', 0, 0, 0);
			keybd_event('V', 0, KEYEVENTF_KEYUP, 0);
			keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
			mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
			Sleep(100);
			mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
			for (int i = 0; i <= 100; i++)
			{


				if (KEY_DOWN(VK_SPACE)) 
				//VK_SPACE 是空格
					{
						Sleep(100);
						now = 0;
						count = 0;
						cout << "1.暂停成功,输入次数按回车,再按Q继续" << endl;
						cout << "2.输入0按回车,退出" << endl;
						cin >> now;
						go = 0;
						if (now == 0)
						{
							return 0;
						}
						else
							break;
					}
				Sleep(100);
			}
			if (stoptime==3) //每发送三次停一分钟
			{
				stoptime = 0;
				for (int i = 0; i <= 1000; i++)
				{


					if (KEY_DOWN(VK_SPACE))
						//VK_SPACE 是空格的虚拟键值   
					{
						Sleep(100);
						now = 0;
						count = 0;
						cout << "1.暂停成功,输入次数按回车,再按Q继续" << endl;
						cout << "2.输入0按回车,退出" << endl;
						cin >> now;
						go = 0;
						
						if (now == 0)
						{
							return 0;
						}
						else
							break;
					}
					Sleep(60);
				}
			}
			
		}


		if (count == now)
		{
			now = 0;
			count = 0;
			cout << "1.任务完成,输入次数按回车,再按Q继续" << endl;
			cout << "2.输入0按回车,退出" << endl;
			cin >> now;
			go = 0;
			if (now == 0)
			{
				break;
			}
		}
	}
	cout << "退出";
	return 0;
	
}

你可能感兴趣的:(自动评论脚本)