• 按键公众号 :
按键精灵电脑版
立即下载

软件版本:2014.06
软件大小:22.9M
更新时间:2021-12-03

按键精灵安卓版
立即下载

软件版本:3.7.2
软件大小:46.2M
更新时间:2023-05-10

按键精灵iOS版
立即下载

软件版本:1.8.0
软件大小:29.2M
更新时间:2023-03-21

按键手机助手
立即下载

软件版本:3.8.0
软件大小:262M
更新时间:2023-05-30

快捷导航

登录 后使用快捷导航
没有帐号? 注册

发新话题 回复该主题

[老狼] [旧帖]代码分享----PC按键----多开发展史[第十章] [复制链接]

1#

  • 鼠标指向\按键自带多开

1.脚本属性>☐ 禁止重复运行(勾去掉)
2.保存退出(必须在非调试界面才有效)>鼠标指向需要运行的窗口>按热键F10启动
  1. TracePrint "goto~"
  2. Hwnd = Plugin.Window.MousePoint()
  3. Do
  4. Call Plugin.Bkgnd.KeyPress(Hwnd, 65)
  5. Delay 1000
  6. Loop
复制代码

  • 鼠标指向\等待按键后启动新线程
  1. Do
  2. key = WaitKey()
  3. If key = 65 Then '按A键启动新线程
  4. BeginThread 按键()
  5. End If
  6. Loop
  7. Sub 按键()
  8. Hwnd = Plugin.Window.MousePoint()
  9. Do
  10. Call Plugin.Bkgnd.KeyPress(Hwnd, 49)
  11. Delay 200
  12. loop
  13. End Sub
复制代码

  • 遍历后多开
  1. DimEnv s
  2. HwndEx = Plugin.Window.Search("记事本")
  3. Hwnd = Split(HwndEx, "|")
  4. For i=0 to UBound(Hwnd)-1
  5. s= Hwnd(i)
  6. BeginThread 脚本()
  7. Delay 100
  8. Next
  9. Sub 脚本()
  10. Hwnd = Plugin.Window.FindEx(s, 0, 0, 0)
  11. TracePrint Hwnd
  12. Do
  13. Call Plugin.Bkgnd.KeyPress(Hwnd, 65)
  14. Delay 1000
  15. Loop
  16. End Sub
复制代码

  • 低级遍历后多开单停
  1. Dimenv 环境变量句柄
  2. ID句柄字符串 = ""
  3. set dm = createobject("dm.dmsoft")
  4. do
  5. Call Plugin.Msg.Tips("按Insert键绑定,按Delete键解绑")
  6. Key = WaitKey()
  7. If Key = 45 Then
  8. 环境变量句柄 = dm.GetMousePointWindow()
  9. 位置 = Instr(ID句柄字符串, 环境变量句柄)
  10. If 位置 = 0 Then
  11. 线程ID = BeginThread(多线程)
  12. 句柄 = CStr(环境变量句柄)
  13. ID = CStr(线程ID)
  14. ID句柄字符串 = 句柄 + "|" + ID + "|" + ID句柄字符串
  15. Call Plugin.Msg.Tips("已绑定,一个窗口")
  16. Else
  17. Call Plugin.Msg.Tips("窗口已经绑定过了,请不要重复绑定")
  18. Delay 2500
  19. End If
  20. ElseIf Key = 46 Then
  21. 鼠标指向的句柄 = dm.GetMousePointWindow()
  22. 位置 = Instr(ID句柄字符串, 鼠标指向的句柄)
  23. If 位置 > 0 Then
  24. 数组 = Split(ID句柄字符串, 鼠标指向的句柄)
  25. ID = 数组(1)
  26. 数组2 = Split(ID, "|")
  27. ID2 = 数组2(1)
  28. StopThread ID2
  29. TracePrint ID句柄字符串
  30. 删除数组 = Split(ID句柄字符串, 鼠标指向的句柄)
  31. 左边 = 删除数组(0)
  32. ID3= ID2+"|"
  33. 删除数组2 = Split(ID句柄字符串, ID3)
  34. 右边 = 删除数组2(1)
  35. ID句柄字符串 = 左边 + 右边
  36. Call Plugin.Msg.Tips("已解绑,一个窗口")
  37. Else
  38. Call Plugin.Msg.Tips("窗口都没绑定过,你解绑什么嗯,想下标越界么")
  39. Delay 2500
  40. End If
  41. End If
  42. Delay 1500
  43. Call Plugin.Msg.Tips("")
  44. Loop
  45. Sub 多线程
  46. set dm = createobject("dm.dmsoft")
  47. 绑定
  48. Do
  49. dm. KeyPress 65
  50. Delay 1000
  51. Loop
  52. End Sub
  53. Sub 绑定()
  54. hwnd = 环境变量句柄
  55. dm_ret = dm.BindWindow( hwnd, "gdi2", "windows", "windows",0)
  56. If dm_ret=0 Then
  57. MessageBox "错误;请把鼠标移到游戏窗口内,再启动脚本"
  58. End If
  59. End Sub
  60. Sub OnScriptExit()
  61. dm.UnBindWindow
  62. End Sub
复制代码

  • 中级遍历后多开单停
  1. Dim 启动快捷键, 暂停快捷键, 继续快捷键, 停止快捷键, i, Hwnds(99), 线程ID(99)
  2. DimEnv Hwnd
  3. HwndEx = Plugin.Window.Search("记事本")
  4. Hwnd1 = Split(HwndEx, "|")
  5. For i = 0 To UBound(Hwnd1)-1
  6. TracePrint Hwnd1(i)
  7. Hwnds(i) = Plugin.Window.FindEx(Hwnd1(i), 0, 0, 0)
  8. Hwnd=Hwnds(i)
  9. 线程ID(i) = BeginThread(测试线程)
  10. Delay 500
  11. Next
  12. Do
  13. 等待按键 = GetLastKey()
  14. Select Case 等待按键
  15. Case 65
  16. Hwnd = Plugin.Window.MousePoint()
  17. For w = 0 To i
  18. If Hwnds(w) = Hwnd Then
  19. StopThread 线程ID(w)
  20. End If
  21. Next
  22. End Select
  23. Loop
  24. Sub 测试线程
  25. s = Hwnd
  26. TracePrint Hwnd
  27. Delay 100
  28. Do
  29. Call Plugin.Window.SendString(s, "测试")
  30. Delay 1000
  31. Call Plugin.Window.SendKeyPress(s, 13)
  32. Delay 1000
  33. Loop
  34. End Sub
复制代码

  • 高级遍历后多开单停
  1. Dim 启动快捷键, 暂停快捷键, 继续快捷键, 停止快捷键,i,Hwnds(99),Hwnd,线程ID(99)
  2. i = 0
  3. Do
  4. 等待按键 = GetLastKey()
  5. Select Case 等待按键
  6. Case 65
  7. Hwnds(i) = Plugin.Window.MousePoint()
  8. 线程ID(i) = BeginThread(测试线程)
  9. i=i+1
  10. Case 66
  11. Hwnd = Plugin.Window.MousePoint()
  12. For w = 0 To i
  13. If Hwnds(w) = Hwnd Then
  14. PauseThread 线程ID(w)
  15. End If
  16. Next
  17. Case 67
  18. Hwnd = Plugin.Window.MousePoint()
  19. For w = 0 To i
  20. If Hwnds(w) = Hwnd Then
  21. ContinueThread 线程ID(w)
  22. End If
  23. Next
  24. Case 68
  25. Hwnd = Plugin.Window.MousePoint()
  26. For w = 0 To i
  27. If Hwnds(w) = Hwnd Then
  28. StopThread 线程ID(w)
  29. End If
  30. Next
  31. End Select
  32. Loop
  33. Sub 测试线程
  34. Hwnd = Plugin.Window.MousePoint()
  35. Delay 100
  36. Do
  37. Call Plugin.Window.SendString(Hwnd, "测试")
  38. Delay 1000
  39. Call Plugin.Window.SendKeyPress(Hwnd, 13)
  40. Delay 1000
  41. Loop
  42. End Sub
复制代码

  • QUI界面表格多开

  1. DimEnv 临时句柄
  2. Sub 脚本()
  3. Hwnd = Plugin.Window.FindEx(临时句柄, 0, 0, 0)
  4. TracePrint Hwnd
  5. Do
  6. Call Plugin.Bkgnd.KeyPress(Hwnd, 65)
  7. Delay 1000
  8. Loop
  9. End Sub
  10. Event Form1.Button1.Click
  11. HwndEx = Plugin.Window.Search("记事本")
  12. Hwnd = Split(HwndEx, "|")
  13. Form1.Grid1.RowCount=UBound(Hwnd)+1
  14. For i = 0 To UBound(Hwnd) - 1
  15. TracePrint Hwnd(i)
  16. Form1.Grid1.SetItemText (i+1),0,Hwnd(i)
  17. Next
  18. End Event
  19. Event Form1.Button2.Click
  20. BeginThread 监测
  21. End Event
  22. Sub 监测()
  23. Do
  24. For i = 0 To Form1.Grid1.RowCount-2
  25. 多选框值 = Form1.Grid1.GetCheckBoxValue((i + 1), 2)
  26. ID值 = Form1.Grid1.GetItemText((i + 1), 1)
  27. If 多选框值 = 1 and ID值="" Then
  28. TracePrint (i + 1) & "行勾选了,准备启动"
  29. 临时句柄=Form1.Grid1.GetItemText((i + 1), 0)
  30. 线程ID = BeginThread(脚本)
  31. Form1.Grid1.SetItemText (i + 1), 1,线程ID
  32. Delay 1000
  33. End If
  34. If 多选框值 = 0 and ID值<>"" Then
  35. TracePrint (i + 1) & "行取消勾选,准备停止"
  36. StopThread Form1.Grid1.GetItemText((i + 1), 1)
  37. Form1.Grid1.SetItemText (i + 1), 1,""
  38. Delay 1000
  39. End If
  40. Delay 100
  41. Next
  42. Loop
  43. End Sub
复制代码

最后编辑瑞祥幽冥狼 最后编辑于 2022-02-28 22:05:35
收 徒 索 引 ← ← ← ← ← ← ← ← ← ← 点 击

个 人 Q Q 1 : 1 2 2 3 1 1 6 6 1 8[将满]
个 人 Q Q 2 : 6 1 7 0 9 5 5 4 3[可加]
2#

学习,感谢按键精灵

3#

进来看看感谢分享

4#

进来看看感谢分享

发新话题 回复该主题