Advertisement
axutongxue

一键聚合提问ChatGPT(powershell版)

Jul 23rd, 2024 (edited)
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.29 KB | None | 0 0
  1. @echo off
  2. if "%~1"=="" (
  3. echo 未输入内容,将提问剪贴板
  4. ) else (
  5. echo %~1| clip
  6. )
  7.  
  8. cd /d %~dp0
  9. for /f "usebackq tokens=1 delims=:" %%a in (`findstr -n "^###" %0`) do (if not DEFINED skip set skip=%%a)
  10. powershell -c "Get-Content '%~0' | Select-Object -Skip %skip% | Out-String | Invoke-Expression"
  11. exit
  12.  
  13. ################################################################
  14. # 添加必要的类型
  15. Add-Type -TypeDefinition @"
  16. using System;
  17. using System.Runtime.InteropServices;
  18. using System.Diagnostics;
  19.  
  20. public class KeyboardHook {
  21. private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
  22. private static LowLevelKeyboardProc _proc = HookCallback;
  23. private static IntPtr _hookID = IntPtr.Zero;
  24.  
  25. [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
  26. private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);
  27.  
  28. [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
  29. [return: MarshalAs(UnmanagedType.Bool)]
  30. private static extern bool UnhookWindowsHookEx(IntPtr hhk);
  31.  
  32. [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
  33. private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
  34.  
  35. [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
  36. private static extern IntPtr GetModuleHandle(string lpModuleName);
  37.  
  38. private const int WH_KEYBOARD_LL = 13;
  39. private const int WM_KEYDOWN = 0x0100;
  40. private const int VK_F9 = 0x78;
  41.  
  42. public static void SetHook() {
  43. using (Process curProcess = Process.GetCurrentProcess())
  44. using (ProcessModule curModule = curProcess.MainModule) {
  45. _hookID = SetWindowsHookEx(WH_KEYBOARD_LL, _proc, GetModuleHandle(curModule.ModuleName), 0);
  46. }
  47. }
  48.  
  49. public static void UnsetHook() {
  50. UnhookWindowsHookEx(_hookID);
  51. }
  52.  
  53. private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) {
  54. if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) {
  55. int vkCode = Marshal.ReadInt32(lParam);
  56. if (vkCode == VK_F9) {
  57. UnsetHook(); // 卸载钩子
  58. Environment.Exit(0); // 中止脚本的执行
  59. }
  60. }
  61. return CallNextHookEx(_hookID, nCode, wParam, lParam);
  62. }
  63. }
  64. "@
  65.  
  66. # 设置钩子
  67. [KeyboardHook]::SetHook()
  68.  
  69. # 添加必要的类型
  70. Add-Type -TypeDefinition @"
  71. using System;
  72. using System.Runtime.InteropServices;
  73. public class User32 {
  74. [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
  75. public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
  76. [DllImport("user32.dll")]
  77. [return: MarshalAs(UnmanagedType.Bool)]
  78. public static extern bool SetCursorPos(int X, int Y);
  79. [DllImport("user32.dll")]
  80. public static extern bool GetCursorPos(out POINT lpPoint);
  81. [DllImport("user32.dll")]
  82. public static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo);
  83. [DllImport("user32.dll")]
  84. public static extern int GetSystemMetrics(int nIndex);
  85. public const int SM_CXSCREEN = 0;
  86. public const int SM_CYSCREEN = 1;
  87. public struct POINT {
  88. public int X;
  89. public int Y;
  90. }
  91. }
  92. "@
  93.  
  94. # 定义按键事件常量
  95. $KEYEVENTF_KEYDOWN = 0x0000
  96. $KEYEVENTF_KEYUP = 0x0002
  97. $VK_CTRL = 0x11
  98. $VK_V = 0x56
  99. $VK_C = 0x43
  100. $VK_A = 0x41
  101. $VK_ENTER = 0x0D
  102.  
  103. # 定义鼠标事件常量
  104. $MOUSEEVENTF_MOVE = 0x0001
  105. $MOUSEEVENTF_LEFTDOWN = 0x0002
  106. $MOUSEEVENTF_LEFTUP = 0x0004
  107.  
  108. # 设置系统缩放比例
  109. $scaling = 1.25
  110.  
  111. # 获取剪贴板内容
  112. $clipboard = Get-Clipboard
  113.  
  114. ################################################################
  115.  
  116. # 阿里通义千问
  117. Start-Process "https://tongyi.aliyun.com/qianwen/"
  118.  
  119. # 等待一段时间
  120. Start-Sleep -Milliseconds 1000
  121.  
  122. $targetString = "均由人工智能模型生成"
  123.  
  124. do {
  125. # 获取剪贴板内容
  126. $clipboardContent = Get-Clipboard
  127.  
  128. # 检查剪贴板内容是否包含目标字符串
  129. if ($clipboardContent -like "*$targetString*") {
  130. Set-Clipboard -Value $clipboard
  131. # 设置坐标并移动鼠标
  132. $X = [math]::Round(1000 / $scaling)
  133. $Y = [math]::Round(925 / $scaling)
  134. [User32]::SetCursorPos($X, $Y)
  135.  
  136. # 等待一段时间
  137. Start-Sleep -Milliseconds 200
  138.  
  139. # 模拟鼠标左键按下和抬起事件
  140. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  141. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  142.  
  143. # 等待一段时间
  144. Start-Sleep -Milliseconds 200
  145.  
  146. # 发送 Ctrl+V 组合键
  147. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  148. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  149. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  150. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  151.  
  152. # 等待一段时间
  153. Start-Sleep -Milliseconds 200
  154.  
  155. # 模拟按下回车键
  156. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  157. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  158. # 跳出循环
  159. break
  160. } else {
  161. # 设置坐标并移动鼠标
  162. $X = [math]::Round(1888 / $scaling)
  163. $Y = [math]::Round(1008 / $scaling)
  164. [User32]::SetCursorPos($X, $Y)
  165.  
  166. # 模拟鼠标左键按下和抬起事件
  167. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  168. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  169.  
  170. # 发送 Ctrl+A 组合键
  171. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  172. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  173. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  174. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  175.  
  176. # 发送 Ctrl+C 组合键
  177. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  178. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  179. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  180. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  181.  
  182. # 等待一段时间
  183. Start-Sleep -Milliseconds 200
  184. }
  185. } while ($true)
  186.  
  187. ################################################################
  188.  
  189. # 智谱清言
  190. Start-Process "https://chatglm.cn/main/alltoolsdetail"
  191.  
  192. # 等待一段时间
  193. Start-Sleep -Milliseconds 1000
  194.  
  195. $targetString = "京公网安备"
  196.  
  197. do {
  198. # 获取剪贴板内容
  199. $clipboardContent = Get-Clipboard
  200.  
  201. # 检查剪贴板内容是否包含目标字符串
  202. if ($clipboardContent -like "*$targetString*") {
  203. Set-Clipboard -Value $clipboard
  204. # 设置坐标并移动鼠标
  205. $X = [math]::Round(1000 / $scaling)
  206. $Y = [math]::Round(930 / $scaling)
  207. [User32]::SetCursorPos($X, $Y)
  208.  
  209. # 等待一段时间
  210. Start-Sleep -Milliseconds 200
  211.  
  212. # 模拟鼠标左键按下和抬起事件
  213. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  214. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  215.  
  216. # 等待一段时间
  217. Start-Sleep -Milliseconds 200
  218.  
  219. # 发送 Ctrl+V 组合键
  220. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  221. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  222. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  223. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  224.  
  225. # 等待一段时间
  226. Start-Sleep -Milliseconds 200
  227.  
  228. # 模拟按下回车键
  229. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  230. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  231. # 跳出循环
  232. break
  233. } else {
  234. # 设置坐标并移动鼠标
  235. $X = [math]::Round(1888 / $scaling)
  236. $Y = [math]::Round(1008 / $scaling)
  237. [User32]::SetCursorPos($X, $Y)
  238.  
  239. # 模拟鼠标左键按下和抬起事件
  240. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  241. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  242.  
  243. # 发送 Ctrl+A 组合键
  244. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  245. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  246. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  247. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  248.  
  249. # 发送 Ctrl+C 组合键
  250. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  251. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  252. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  253. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  254.  
  255. # 等待一段时间
  256. Start-Sleep -Milliseconds 200
  257. }
  258. } while ($true)
  259.  
  260. ################################################################
  261.  
  262. # 抖音豆包
  263. Start-Process "https://www.doubao.com/chat/"
  264.  
  265. # 等待一段时间
  266. Start-Sleep -Milliseconds 1000
  267.  
  268. $targetString = "选择技能"
  269.  
  270. do {
  271. # 获取剪贴板内容
  272. $clipboardContent = Get-Clipboard
  273.  
  274. # 检查剪贴板内容是否包含目标字符串
  275. if ($clipboardContent -like "*$targetString*") {
  276. Set-Clipboard -Value $clipboard
  277. # 设置坐标并移动鼠标
  278. $X = [math]::Round(1000 / $scaling)
  279. $Y = [math]::Round(960 / $scaling)
  280. [User32]::SetCursorPos($X, $Y)
  281.  
  282. # 等待一段时间
  283. Start-Sleep -Milliseconds 200
  284.  
  285. # 模拟鼠标左键按下和抬起事件
  286. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  287. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  288.  
  289. # 等待一段时间
  290. Start-Sleep -Milliseconds 200
  291.  
  292. # 发送 Ctrl+V 组合键
  293. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  294. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  295. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  296. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  297.  
  298. # 等待一段时间
  299. Start-Sleep -Milliseconds 200
  300.  
  301. # 模拟按下回车键
  302. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  303. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  304. # 跳出循环
  305. break
  306. } else {
  307.  
  308. # 设置坐标并移动鼠标
  309. $X = [math]::Round(1888 / $scaling)
  310. $Y = [math]::Round(1008 / $scaling)
  311. [User32]::SetCursorPos($X, $Y)
  312.  
  313. # 模拟鼠标左键按下和抬起事件
  314. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  315. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  316.  
  317. # 发送 Ctrl+A 组合键
  318. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  319. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  320. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  321. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  322.  
  323. # 发送 Ctrl+C 组合键
  324. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  325. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  326. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  327. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  328.  
  329. # 等待一段时间
  330. Start-Sleep -Milliseconds 200
  331. }
  332. } while ($true)
  333.  
  334.  
  335. ################################################################
  336.  
  337. # 月之暗面-KIMICHAT
  338. Start-Process "https://kimi.moonshot.cn/"
  339.  
  340. # 等待一段时间
  341. Start-Sleep -Milliseconds 2000
  342.  
  343. $targetString = "登录体验更多功能"
  344.  
  345. do {
  346. # 获取剪贴板内容
  347. $clipboardContent = Get-Clipboard
  348.  
  349. # 检查剪贴板内容是否包含目标字符串
  350. if ($clipboardContent -like "*$targetString*") {
  351. Set-Clipboard -Value $clipboard
  352. # 设置坐标并移动鼠标
  353. $X = [math]::Round(1000 / $scaling)
  354. $Y = [math]::Round(520 / $scaling)
  355. [User32]::SetCursorPos($X, $Y)
  356.  
  357. # 等待一段时间
  358. Start-Sleep -Milliseconds 200
  359.  
  360. # 模拟鼠标左键按下和抬起事件
  361. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  362. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  363.  
  364. # 等待一段时间
  365. Start-Sleep -Milliseconds 200
  366.  
  367. # 发送 Ctrl+V 组合键
  368. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  369. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  370. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  371. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  372.  
  373. # 等待一段时间
  374. Start-Sleep -Milliseconds 1000
  375.  
  376. # 模拟按下回车键
  377. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  378. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  379. # 跳出循环
  380. break
  381. } else {
  382.  
  383. # 设置坐标并移动鼠标
  384. $X = [math]::Round(1888 / $scaling)
  385. $Y = [math]::Round(1008 / $scaling)
  386. [User32]::SetCursorPos($X, $Y)
  387.  
  388. # 模拟鼠标左键按下和抬起事件
  389. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  390. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  391.  
  392. # 发送 Ctrl+A 组合键
  393. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  394. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  395. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  396. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  397.  
  398. # 发送 Ctrl+C 组合键
  399. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  400. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  401. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  402. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  403.  
  404. # 等待一段时间
  405. Start-Sleep -Milliseconds 200
  406. }
  407. } while ($true)
  408.  
  409. ################################################################
  410.  
  411. # 讯飞星火
  412. Start-Process "https://xinghuo.xfyun.cn/desk"
  413.  
  414. # 等待一段时间
  415. Start-Sleep -Milliseconds 1000
  416.  
  417. $targetString = "内容由讯飞星火大模型生成"
  418.  
  419. do {
  420. # 获取剪贴板内容
  421. $clipboardContent = Get-Clipboard
  422.  
  423. # 检查剪贴板内容是否包含目标字符串
  424. if ($clipboardContent -like "*$targetString*") {
  425. Set-Clipboard -Value $clipboard
  426. # 设置坐标并移动鼠标
  427. $X = [math]::Round(1300 / $scaling)
  428. $Y = [math]::Round(940 / $scaling)
  429. [User32]::SetCursorPos($X, $Y)
  430.  
  431. # 等待一段时间
  432. Start-Sleep -Milliseconds 200
  433.  
  434. # 模拟鼠标左键按下和抬起事件
  435. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  436. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  437.  
  438. # 等待一段时间
  439. Start-Sleep -Milliseconds 200
  440.  
  441. # 发送 Ctrl+V 组合键
  442. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  443. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  444. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  445. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  446.  
  447. # 等待一段时间
  448. Start-Sleep -Milliseconds 200
  449.  
  450. # 模拟鼠标左键按下和抬起事件
  451. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  452. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  453.  
  454. # 跳出循环
  455. break
  456. } else {
  457.  
  458. # 设置坐标并移动鼠标
  459. $X = [math]::Round(1888 / $scaling)
  460. $Y = [math]::Round(1008 / $scaling)
  461. [User32]::SetCursorPos($X, $Y)
  462.  
  463. # 模拟鼠标左键按下和抬起事件
  464. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  465. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  466.  
  467. # 发送 Ctrl+A 组合键
  468. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  469. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  470. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  471. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  472.  
  473. # 发送 Ctrl+C 组合键
  474. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  475. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  476. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  477. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  478.  
  479. # 等待一段时间
  480. Start-Sleep -Milliseconds 200
  481. }
  482. } while ($true)
  483.  
  484. ################################################################
  485.  
  486. # 百小应
  487. Start-Process "https://ying.baichuan-ai.com/chat"
  488.  
  489. # 等待一段时间
  490. Start-Sleep -Milliseconds 1000
  491.  
  492. $targetString = "所有内容均由AI大模型输出"
  493.  
  494. do {
  495. # 获取剪贴板内容
  496. $clipboardContent = Get-Clipboard
  497.  
  498. # 检查剪贴板内容是否包含目标字符串
  499. if ($clipboardContent -like "*$targetString*") {
  500. Set-Clipboard -Value $clipboard
  501. # 设置坐标并移动鼠标
  502. $X = [math]::Round(1000 / $scaling)
  503. $Y = [math]::Round(870 / $scaling)
  504. [User32]::SetCursorPos($X, $Y)
  505.  
  506. # 等待一段时间
  507. Start-Sleep -Milliseconds 500
  508.  
  509. # 模拟鼠标左键按下和抬起事件
  510. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  511. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  512.  
  513. # 等待一段时间
  514. Start-Sleep -Milliseconds 500
  515.  
  516. # 发送 Ctrl+V 组合键
  517. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  518. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  519. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  520. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  521.  
  522. # 等待一段时间
  523. Start-Sleep -Milliseconds 500
  524.  
  525. # 模拟按下回车键
  526. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  527. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  528. # 跳出循环
  529. break
  530. } else {
  531.  
  532. # 设置坐标并移动鼠标
  533. $X = [math]::Round(1888 / $scaling)
  534. $Y = [math]::Round(1008 / $scaling)
  535. [User32]::SetCursorPos($X, $Y)
  536.  
  537. # 模拟鼠标左键按下和抬起事件
  538. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  539. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  540.  
  541. # 发送 Ctrl+A 组合键
  542. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  543. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  544. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  545. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  546.  
  547. # 发送 Ctrl+C 组合键
  548. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  549. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  550. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  551. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  552.  
  553. # 等待一段时间
  554. Start-Sleep -Milliseconds 200
  555. }
  556. } while ($true)
  557.  
  558.  
  559. ################################################################
  560.  
  561. # 百度文心一言
  562. $clipboardContent = Get-Clipboard
  563. Start-Process "https://yiyan.baidu.com/?q=$clipboardContent"
  564.  
  565. ################################################################
  566.  
  567. # 腾讯混元
  568. Start-Process "https://yuanbao.tencent.com/chat/"
  569.  
  570. # 等待一段时间
  571. Start-Sleep -Milliseconds 1000
  572.  
  573. $targetString = "腾讯元宝隐私政策"
  574.  
  575. do {
  576. # 获取剪贴板内容
  577. $clipboardContent = Get-Clipboard
  578.  
  579. # 检查剪贴板内容是否包含目标字符串
  580. if ($clipboardContent -like "*$targetString*") {
  581. Set-Clipboard -Value $clipboard
  582. # 设置坐标并移动鼠标
  583. $X = [math]::Round(1000 / $scaling)
  584. $Y = [math]::Round(960 / $scaling)
  585. [User32]::SetCursorPos($X, $Y)
  586.  
  587. # 等待一段时间
  588. Start-Sleep -Milliseconds 200
  589.  
  590. # 模拟鼠标左键按下和抬起事件
  591. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  592. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  593.  
  594. # 等待一段时间
  595. Start-Sleep -Milliseconds 200
  596.  
  597. # 发送 Ctrl+V 组合键
  598. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  599. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  600. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  601. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  602.  
  603. # 等待一段时间
  604. Start-Sleep -Milliseconds 200
  605.  
  606. # 模拟按下回车键
  607. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  608. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  609. # 跳出循环
  610. break
  611. } else {
  612. # 发送 Ctrl+A 组合键
  613. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  614. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  615. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  616. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  617.  
  618. # 发送 Ctrl+C 组合键
  619. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  620. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  621. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  622. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  623.  
  624. # 等待一段时间
  625. Start-Sleep -Milliseconds 200
  626. }
  627. } while ($true)
  628.  
  629. ################################################################
  630. # 清理资源
  631. [KeyboardHook]::UnsetHook()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement