Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- if "%~1"=="" (
- echo 未输入内容,将提问剪贴板
- ) else (
- echo %~1| clip
- )
- cd /d %~dp0
- for /f "usebackq tokens=1 delims=:" %%a in (`findstr -n "^###" %0`) do (if not DEFINED skip set skip=%%a)
- powershell -c "Get-Content '%~0' | Select-Object -Skip %skip% | Out-String | Invoke-Expression"
- exit
- ################################################################
- # 添加必要的类型
- Add-Type -TypeDefinition @"
- using System;
- using System.Runtime.InteropServices;
- using System.Diagnostics;
- public class KeyboardHook {
- private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
- private static LowLevelKeyboardProc _proc = HookCallback;
- private static IntPtr _hookID = IntPtr.Zero;
- [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);
- [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- private static extern bool UnhookWindowsHookEx(IntPtr hhk);
- [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
- [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
- private static extern IntPtr GetModuleHandle(string lpModuleName);
- private const int WH_KEYBOARD_LL = 13;
- private const int WM_KEYDOWN = 0x0100;
- private const int VK_F9 = 0x78;
- public static void SetHook() {
- using (Process curProcess = Process.GetCurrentProcess())
- using (ProcessModule curModule = curProcess.MainModule) {
- _hookID = SetWindowsHookEx(WH_KEYBOARD_LL, _proc, GetModuleHandle(curModule.ModuleName), 0);
- }
- }
- public static void UnsetHook() {
- UnhookWindowsHookEx(_hookID);
- }
- private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) {
- if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) {
- int vkCode = Marshal.ReadInt32(lParam);
- if (vkCode == VK_F9) {
- UnsetHook(); // 卸载钩子
- Environment.Exit(0); // 中止脚本的执行
- }
- }
- return CallNextHookEx(_hookID, nCode, wParam, lParam);
- }
- }
- "@
- # 设置钩子
- [KeyboardHook]::SetHook()
- # 添加必要的类型
- Add-Type -TypeDefinition @"
- using System;
- using System.Runtime.InteropServices;
- public class User32 {
- [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
- public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
- [DllImport("user32.dll")]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool SetCursorPos(int X, int Y);
- [DllImport("user32.dll")]
- public static extern bool GetCursorPos(out POINT lpPoint);
- [DllImport("user32.dll")]
- public static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo);
- [DllImport("user32.dll")]
- public static extern int GetSystemMetrics(int nIndex);
- public const int SM_CXSCREEN = 0;
- public const int SM_CYSCREEN = 1;
- public struct POINT {
- public int X;
- public int Y;
- }
- }
- "@
- # 定义按键事件常量
- $KEYEVENTF_KEYDOWN = 0x0000
- $KEYEVENTF_KEYUP = 0x0002
- $VK_CTRL = 0x11
- $VK_V = 0x56
- $VK_C = 0x43
- $VK_A = 0x41
- $VK_ENTER = 0x0D
- # 定义鼠标事件常量
- $MOUSEEVENTF_MOVE = 0x0001
- $MOUSEEVENTF_LEFTDOWN = 0x0002
- $MOUSEEVENTF_LEFTUP = 0x0004
- # 设置系统缩放比例
- $scaling = 1.25
- # 获取剪贴板内容
- $clipboard = Get-Clipboard
- ################################################################
- # 阿里通义千问
- Start-Process "https://tongyi.aliyun.com/qianwen/"
- # 等待一段时间
- Start-Sleep -Milliseconds 1000
- $targetString = "均由人工智能模型生成"
- do {
- # 获取剪贴板内容
- $clipboardContent = Get-Clipboard
- # 检查剪贴板内容是否包含目标字符串
- if ($clipboardContent -like "*$targetString*") {
- Set-Clipboard -Value $clipboard
- # 设置坐标并移动鼠标
- $X = [math]::Round(1000 / $scaling)
- $Y = [math]::Round(925 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 发送 Ctrl+V 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 模拟按下回车键
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 跳出循环
- break
- } else {
- # 设置坐标并移动鼠标
- $X = [math]::Round(1888 / $scaling)
- $Y = [math]::Round(1008 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 发送 Ctrl+A 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 发送 Ctrl+C 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- }
- } while ($true)
- ################################################################
- # 智谱清言
- Start-Process "https://chatglm.cn/main/alltoolsdetail"
- # 等待一段时间
- Start-Sleep -Milliseconds 1000
- $targetString = "京公网安备"
- do {
- # 获取剪贴板内容
- $clipboardContent = Get-Clipboard
- # 检查剪贴板内容是否包含目标字符串
- if ($clipboardContent -like "*$targetString*") {
- Set-Clipboard -Value $clipboard
- # 设置坐标并移动鼠标
- $X = [math]::Round(1000 / $scaling)
- $Y = [math]::Round(930 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 发送 Ctrl+V 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 模拟按下回车键
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 跳出循环
- break
- } else {
- # 设置坐标并移动鼠标
- $X = [math]::Round(1888 / $scaling)
- $Y = [math]::Round(1008 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 发送 Ctrl+A 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 发送 Ctrl+C 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- }
- } while ($true)
- ################################################################
- # 抖音豆包
- Start-Process "https://www.doubao.com/chat/"
- # 等待一段时间
- Start-Sleep -Milliseconds 1000
- $targetString = "选择技能"
- do {
- # 获取剪贴板内容
- $clipboardContent = Get-Clipboard
- # 检查剪贴板内容是否包含目标字符串
- if ($clipboardContent -like "*$targetString*") {
- Set-Clipboard -Value $clipboard
- # 设置坐标并移动鼠标
- $X = [math]::Round(1000 / $scaling)
- $Y = [math]::Round(960 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 发送 Ctrl+V 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 模拟按下回车键
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 跳出循环
- break
- } else {
- # 设置坐标并移动鼠标
- $X = [math]::Round(1888 / $scaling)
- $Y = [math]::Round(1008 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 发送 Ctrl+A 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 发送 Ctrl+C 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- }
- } while ($true)
- ################################################################
- # 月之暗面-KIMICHAT
- Start-Process "https://kimi.moonshot.cn/"
- # 等待一段时间
- Start-Sleep -Milliseconds 2000
- $targetString = "登录体验更多功能"
- do {
- # 获取剪贴板内容
- $clipboardContent = Get-Clipboard
- # 检查剪贴板内容是否包含目标字符串
- if ($clipboardContent -like "*$targetString*") {
- Set-Clipboard -Value $clipboard
- # 设置坐标并移动鼠标
- $X = [math]::Round(1000 / $scaling)
- $Y = [math]::Round(520 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 发送 Ctrl+V 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 1000
- # 模拟按下回车键
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 跳出循环
- break
- } else {
- # 设置坐标并移动鼠标
- $X = [math]::Round(1888 / $scaling)
- $Y = [math]::Round(1008 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 发送 Ctrl+A 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 发送 Ctrl+C 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- }
- } while ($true)
- ################################################################
- # 讯飞星火
- Start-Process "https://xinghuo.xfyun.cn/desk"
- # 等待一段时间
- Start-Sleep -Milliseconds 1000
- $targetString = "内容由讯飞星火大模型生成"
- do {
- # 获取剪贴板内容
- $clipboardContent = Get-Clipboard
- # 检查剪贴板内容是否包含目标字符串
- if ($clipboardContent -like "*$targetString*") {
- Set-Clipboard -Value $clipboard
- # 设置坐标并移动鼠标
- $X = [math]::Round(1300 / $scaling)
- $Y = [math]::Round(940 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 发送 Ctrl+V 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 跳出循环
- break
- } else {
- # 设置坐标并移动鼠标
- $X = [math]::Round(1888 / $scaling)
- $Y = [math]::Round(1008 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 发送 Ctrl+A 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 发送 Ctrl+C 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- }
- } while ($true)
- ################################################################
- # 百小应
- Start-Process "https://ying.baichuan-ai.com/chat"
- # 等待一段时间
- Start-Sleep -Milliseconds 1000
- $targetString = "所有内容均由AI大模型输出"
- do {
- # 获取剪贴板内容
- $clipboardContent = Get-Clipboard
- # 检查剪贴板内容是否包含目标字符串
- if ($clipboardContent -like "*$targetString*") {
- Set-Clipboard -Value $clipboard
- # 设置坐标并移动鼠标
- $X = [math]::Round(1000 / $scaling)
- $Y = [math]::Round(870 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 等待一段时间
- Start-Sleep -Milliseconds 500
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 等待一段时间
- Start-Sleep -Milliseconds 500
- # 发送 Ctrl+V 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 500
- # 模拟按下回车键
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 跳出循环
- break
- } else {
- # 设置坐标并移动鼠标
- $X = [math]::Round(1888 / $scaling)
- $Y = [math]::Round(1008 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 发送 Ctrl+A 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 发送 Ctrl+C 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- }
- } while ($true)
- ################################################################
- # 百度文心一言
- $clipboardContent = Get-Clipboard
- Start-Process "https://yiyan.baidu.com/?q=$clipboardContent"
- ################################################################
- # 腾讯混元
- Start-Process "https://yuanbao.tencent.com/chat/"
- # 等待一段时间
- Start-Sleep -Milliseconds 1000
- $targetString = "腾讯元宝隐私政策"
- do {
- # 获取剪贴板内容
- $clipboardContent = Get-Clipboard
- # 检查剪贴板内容是否包含目标字符串
- if ($clipboardContent -like "*$targetString*") {
- Set-Clipboard -Value $clipboard
- # 设置坐标并移动鼠标
- $X = [math]::Round(1000 / $scaling)
- $Y = [math]::Round(960 / $scaling)
- [User32]::SetCursorPos($X, $Y)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 模拟鼠标左键按下和抬起事件
- [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
- [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 发送 Ctrl+V 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- # 模拟按下回车键
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 跳出循环
- break
- } else {
- # 发送 Ctrl+A 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 发送 Ctrl+C 组合键
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
- # 等待一段时间
- Start-Sleep -Milliseconds 200
- }
- } while ($true)
- ################################################################
- # 清理资源
- [KeyboardHook]::UnsetHook()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement