Advertisement
axutongxue

一键聚合提问ChatGPT(powershell版)

Jul 23rd, 2024 (edited)
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.91 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. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  166. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  167.  
  168. # 发送 Ctrl+A 组合键
  169. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  170. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  171. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  172. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  173.  
  174. # 发送 Ctrl+C 组合键
  175. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  176. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  177. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  178. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  179.  
  180. # 等待一段时间
  181. Start-Sleep -Milliseconds 200
  182. }
  183. } while ($true)
  184.  
  185. ################################################################
  186.  
  187. # 智谱清言
  188. Start-Process "https://chatglm.cn/main/alltoolsdetail"
  189.  
  190. # 等待一段时间
  191. Start-Sleep -Milliseconds 1000
  192.  
  193. $targetString = "京公网安备"
  194.  
  195. do {
  196. # 获取剪贴板内容
  197. $clipboardContent = Get-Clipboard
  198.  
  199. # 检查剪贴板内容是否包含目标字符串
  200. if ($clipboardContent -like "*$targetString*") {
  201. Set-Clipboard -Value $clipboard
  202. # 设置坐标并移动鼠标
  203. $X = [math]::Round(1000 / $scaling)
  204. $Y = [math]::Round(930 / $scaling)
  205. [User32]::SetCursorPos($X, $Y)
  206.  
  207. # 等待一段时间
  208. Start-Sleep -Milliseconds 200
  209.  
  210. # 模拟鼠标左键按下和抬起事件
  211. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  212. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  213.  
  214. # 等待一段时间
  215. Start-Sleep -Milliseconds 200
  216.  
  217. # 发送 Ctrl+V 组合键
  218. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  219. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  220. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  221. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  222.  
  223. # 等待一段时间
  224. Start-Sleep -Milliseconds 200
  225.  
  226. # 模拟按下回车键
  227. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  228. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  229. # 跳出循环
  230. break
  231. } else {
  232.  
  233. # 设置空白处坐标,并移动鼠标点击,以获取网页焦点,用于后续全选获取网页内容判断网页是非已加载完成
  234. $X = [math]::Round(1888 / $scaling)
  235. $Y = [math]::Round(1008 / $scaling)
  236. [User32]::SetCursorPos($X, $Y)
  237. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  238. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  239.  
  240. # 发送 Ctrl+A 组合键
  241. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  242. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  243. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  244. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  245.  
  246. # 发送 Ctrl+C 组合键
  247. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  248. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  249. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  250. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  251.  
  252. # 等待一段时间
  253. Start-Sleep -Milliseconds 200
  254. }
  255. } while ($true)
  256.  
  257. ################################################################
  258.  
  259. # 抖音豆包
  260. Start-Process "https://www.doubao.com/chat/"
  261.  
  262. # 等待一段时间
  263. Start-Sleep -Milliseconds 1000
  264.  
  265. $targetString = "退出登录"
  266.  
  267. do {
  268. # 获取剪贴板内容
  269. $clipboardContent = Get-Clipboard
  270.  
  271. # 检查剪贴板内容是否包含目标字符串
  272. if ($clipboardContent -like "*$targetString*") {
  273. Set-Clipboard -Value $clipboard
  274. # 设置坐标并移动鼠标
  275. $X = [math]::Round(1000 / $scaling)
  276. $Y = [math]::Round(960 / $scaling)
  277. [User32]::SetCursorPos($X, $Y)
  278.  
  279. # 等待一段时间
  280. Start-Sleep -Milliseconds 200
  281.  
  282. # 模拟鼠标左键按下和抬起事件
  283. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  284. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  285.  
  286. # 等待一段时间
  287. Start-Sleep -Milliseconds 200
  288.  
  289. # 发送 Ctrl+V 组合键
  290. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  291. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  292. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  293. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  294.  
  295. # 等待一段时间
  296. Start-Sleep -Milliseconds 200
  297.  
  298. # 模拟按下回车键
  299. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  300. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  301. # 跳出循环
  302. break
  303. } else {
  304.  
  305. # 设置头像处并移动鼠标点击,以获取网页焦点,用于后续全选获取网页内容判断网页是非已加载完成
  306. $X = [math]::Round(1867 / $scaling)
  307. $Y = [math]::Round(172 / $scaling)
  308. [User32]::SetCursorPos($X, $Y)
  309. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  310. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  311.  
  312. # 发送 Ctrl+A 组合键
  313. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  314. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  315. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  316. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  317.  
  318. # 发送 Ctrl+C 组合键
  319. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  320. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  321. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  322. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  323.  
  324. # 等待一段时间
  325. Start-Sleep -Milliseconds 200
  326. }
  327. } while ($true)
  328.  
  329.  
  330. ################################################################
  331.  
  332. # 月之暗面-KIMICHAT
  333. Start-Process "https://kimi.moonshot.cn/"
  334.  
  335. # 等待一段时间
  336. Start-Sleep -Milliseconds 2000
  337.  
  338. $targetString = "开启新会话"
  339.  
  340. do {
  341. # 获取剪贴板内容
  342. $clipboardContent = Get-Clipboard
  343.  
  344. # 检查剪贴板内容是否包含目标字符串
  345. if ($clipboardContent -like "*$targetString*") {
  346. Set-Clipboard -Value $clipboard
  347. # 设置坐标并移动鼠标
  348. $X = [math]::Round(1000 / $scaling)
  349. $Y = [math]::Round(520 / $scaling)
  350. [User32]::SetCursorPos($X, $Y)
  351.  
  352. # 等待一段时间
  353. Start-Sleep -Milliseconds 200
  354.  
  355. # 模拟鼠标左键按下和抬起事件
  356. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  357. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  358.  
  359. # 等待一段时间
  360. Start-Sleep -Milliseconds 200
  361.  
  362. # 发送 Ctrl+V 组合键
  363. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  364. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  365. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  366. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  367.  
  368. # 等待一段时间
  369. Start-Sleep -Milliseconds 1000
  370.  
  371. # 模拟按下回车键
  372. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  373. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  374. # 跳出循环
  375. break
  376. } else {
  377.  
  378. # 设置空白处坐标,并移动鼠标点击,以获取网页焦点,用于后续全选获取网页内容判断网页是非已加载完成
  379. $X = [math]::Round(1888 / $scaling)
  380. $Y = [math]::Round(1008 / $scaling)
  381. [User32]::SetCursorPos($X, $Y)
  382. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  383. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  384.  
  385. # 发送 Ctrl+A 组合键
  386. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  387. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  388. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  389. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  390.  
  391. # 发送 Ctrl+C 组合键
  392. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  393. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  394. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  395. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  396.  
  397. # 等待一段时间
  398. Start-Sleep -Milliseconds 200
  399. }
  400. } while ($true)
  401.  
  402. ################################################################
  403.  
  404. # 讯飞星火
  405. Start-Process "https://xinghuo.xfyun.cn/desk"
  406.  
  407. # 等待一段时间
  408. Start-Sleep -Milliseconds 1000
  409.  
  410. $targetString = "内容由讯飞星火大模型生成"
  411.  
  412. do {
  413. # 获取剪贴板内容
  414. $clipboardContent = Get-Clipboard
  415.  
  416. # 检查剪贴板内容是否包含目标字符串
  417. if ($clipboardContent -like "*$targetString*") {
  418. Set-Clipboard -Value $clipboard
  419.  
  420. # 设置坐标并移动鼠标
  421. $X = [math]::Round(540 / $scaling)
  422. $Y = [math]::Round(400 / $scaling)
  423. [User32]::SetCursorPos($X, $Y)
  424.  
  425. # 等待一段时间
  426. Start-Sleep -Milliseconds 200
  427.  
  428. # 模拟鼠标左键按下和抬起事件
  429. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  430. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  431.  
  432. # 等待一段时间
  433. Start-Sleep -Milliseconds 200
  434.  
  435. # 发送 Ctrl+V 组合键
  436. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  437. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  438. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  439. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  440.  
  441. # 等待一段时间
  442. Start-Sleep -Milliseconds 500
  443.  
  444. # 设置坐标并移动鼠标
  445. $X = [math]::Round(1528 / $scaling)
  446. $Y = [math]::Round(468 / $scaling)
  447. [User32]::SetCursorPos($X, $Y)
  448.  
  449. # 等待一段时间
  450. Start-Sleep -Milliseconds 200
  451.  
  452. # 模拟鼠标左键按下和抬起事件
  453. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  454. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  455.  
  456. # 跳出循环
  457. break
  458. } else {
  459.  
  460. # 设置空白处坐标,并移动鼠标点击,以获取网页焦点,用于后续全选获取网页内容判断网页是非已加载完成
  461. $X = [math]::Round(1888 / $scaling)
  462. $Y = [math]::Round(1008 / $scaling)
  463. [User32]::SetCursorPos($X, $Y)
  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. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  537. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  538.  
  539. # 发送 Ctrl+A 组合键
  540. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  541. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  542. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  543. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  544.  
  545. # 发送 Ctrl+C 组合键
  546. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  547. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  548. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  549. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  550.  
  551. # 等待一段时间
  552. Start-Sleep -Milliseconds 200
  553. }
  554. } while ($true)
  555.  
  556.  
  557. ################################################################
  558.  
  559. # 百度文心一言
  560. $clipboardContent = Get-Clipboard
  561.  
  562. Start-Process "https://yiyan.baidu.com/?q=$clipboardContent"
  563.  
  564. Start-Sleep -Milliseconds 200
  565.  
  566. ################################################################
  567.  
  568. # 腾讯元宝
  569. Start-Process "https://yuanbao.tencent.com/chat/naQivTmsDa"
  570.  
  571. # 等待一段时间
  572. Start-Sleep -Milliseconds 1000
  573.  
  574. $targetString = "腾讯元宝隐私政策"
  575.  
  576. do {
  577. # 获取剪贴板内容
  578. $clipboardContent = Get-Clipboard
  579.  
  580. # 检查剪贴板内容是否包含目标字符串
  581. if ($clipboardContent -like "*$targetString*") {
  582. Set-Clipboard -Value $clipboard
  583. # 设置坐标并移动鼠标
  584. $X = [math]::Round(1000 / $scaling)
  585. $Y = [math]::Round(960 / $scaling)
  586. [User32]::SetCursorPos($X, $Y)
  587.  
  588. # 等待一段时间
  589. Start-Sleep -Milliseconds 200
  590.  
  591. # 模拟鼠标左键按下和抬起事件
  592. [User32]::mouse_event($MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  593. [User32]::mouse_event($MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
  594.  
  595. # 等待一段时间
  596. Start-Sleep -Milliseconds 200
  597.  
  598. # 发送 Ctrl+V 组合键
  599. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  600. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  601. [User32]::keybd_event($VK_V, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  602. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  603.  
  604. # 等待一段时间
  605. Start-Sleep -Milliseconds 200
  606.  
  607. # 模拟按下回车键
  608. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  609. [User32]::keybd_event($VK_ENTER, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  610. # 跳出循环
  611. break
  612. } else {
  613. # 发送 Ctrl+A 组合键
  614. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  615. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  616. [User32]::keybd_event($VK_A, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  617. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  618.  
  619. # 发送 Ctrl+C 组合键
  620. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  621. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYDOWN, [UIntPtr]::Zero)
  622. [User32]::keybd_event($VK_C, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  623. [User32]::keybd_event($VK_CTRL, 0, $KEYEVENTF_KEYUP, [UIntPtr]::Zero)
  624.  
  625. # 等待一段时间
  626. Start-Sleep -Milliseconds 200
  627. }
  628. } while ($true)
  629.  
  630. ################################################################
  631. # 清理资源
  632. [KeyboardHook]::UnsetHook()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement