Snow_Flake

SendClick tool 2

Oct 3rd, 2014
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  
  3. Click and Send Test Tool V0.5.0 Beta Stage
  4. Made By Snow Flake ©  
  5.  
  6. http://www.autohotkey.com/board/user/21149-snow-flake/
  7.  
  8. http://www.autohotkey.com/board/topic/95653-clicksend-tester/
  9.  
  10.  
  11. */
  12.  
  13. if not A_IsAdmin
  14. {
  15.     Run *RunAs "%A_ScriptFullPath%"
  16.     ExitApp
  17. }
  18.  
  19. #SingleInstance, force
  20. SetWorkingDir, %A_ScriptDir%
  21. #Persistent
  22. #NoEnv
  23. #MaxThreadsPerHotkey 1
  24. DetectHiddenWindows,On
  25. SetTitleMatchMode 2
  26.  
  27. Start:
  28. MsgBox,,Game Window Select,Press Ok then. `n Place the mouse cursor over the window you want to Select. Then press the middle mouse button to get the Title.
  29. IfMsgBox OK
  30. keywait, MButton, D
  31. keywait, MButton
  32. mousegetpos, winX, winY, winid
  33. wingettitle, wintext, ahk_id %winid%
  34.  
  35. MsgBox, 4,Game Window,Is this the right Game window? `n `n %wintext%
  36. IfMsgBox No
  37. goto, Start
  38. IfMsgBox Yes
  39.  
  40. Gui, Add, Text,, Sleep Time (ms);  2000 is recommended:
  41. Gui, Add, Edit, vWaitTime, 2000
  42. Gui, Add, Text,, Keys (Key inside {}) or Text to send
  43. Gui, Add, Edit, x2 y70 w250 h20 vKex, {W} Testing!
  44. Gui, Add, Edit, x22 y100 w30 h20 vXX, 100
  45. Gui, Add, Edit, x22 y130 w30 h20 vYY, 100
  46. Gui, Add, Text, x2 y100 w20 h20 , X:
  47. Gui, Add, Text, x2 y130 w20 h20 , Y:
  48. Gui, Add, Text, x2 y0 w220 h20 , Sleep Time (ms)`;  2000 is recommended
  49. Gui, Add, Text, x2 y50 w220 h20 , Keys (Key inside {}) or Text to send
  50. Gui, Add, Button, x72 y170 w90 h20 gsave, Save
  51. Gui, Add, GroupBox, x272 y0 w330 h180 , About
  52. Gui, Add, Text, x282 y20 w190 h20 , Welcome to my Send and Click Tool
  53. Gui, Add, Text, x282 y50 w310 h30 , This Will test Different Click and Send Commands to see which commands that works best in different games.
  54. Gui, Add, Text, x282 y90 w310 h30 , It's highly recommended that you use this tool on a window mode of the Game or program.
  55. Title1 = Welcome to my Send and Click Tool
  56. Title2 = Made by: Snow Flake
  57. SetTimer, AnimateTitle, 100
  58. Gui, +HWndGUI_ID
  59. Gui, Show, w612 h199,
  60. return
  61.  
  62. AnimateTitle:
  63. TextX := ""
  64. Loop,Parse,Title1,
  65. {
  66. TextX = % TextX . A_LoopField
  67. WinSetTitle, ahk_id %GUI_ID%, , %TextX%
  68. sleep, 100
  69. }
  70. sleep, 700
  71.  
  72. TextX := ""
  73. Loop,Parse,Title2,
  74. {
  75. TextX = % TextX . A_LoopField
  76. WinSetTitle, ahk_id %GUI_ID%, , %TextX%
  77. sleep, 100
  78. }
  79. sleep, 700
  80. return
  81.  
  82. save:
  83. Gui, Submit
  84. MsgBox  Window Text: %wintext%`n Sleep Time: %WaitTime%
  85.  
  86. msgbox,,Click and Send Test Tool V0.2.0, Running This Will Test different Click and Send types to confirm which works. `n Press F1 in game to Click test F3 Send Test `n`n Ctrl + Escape will Reload the script!
  87.  
  88. F1:: ; Press F3 to run Click test.
  89. {
  90.  KeyWait, F1, D
  91.  SoundBeep
  92. Goto, ClickTest
  93. }
  94. return
  95.  
  96. F3:: ; Press F1 to run Send test.
  97. {
  98. KeyWait, F3, D
  99. SoundBeep
  100. Goto, SendTest
  101. }
  102. return
  103.  
  104. ClickTest: ; ========================================================================================
  105. {
  106. sleep, %WaitTime%
  107. ToolTip, Running Click Test,0,0
  108. WinActivate,%wintext%
  109.  
  110. ToolTip, Testing Click,0,0
  111. Click, %XX%, 100
  112. sleep, %WaitTime%
  113.  
  114. ToolTip, Testing MouseClick,0,0
  115. MouseClick, Left, %XX%, %YY%
  116. sleep, %WaitTime%
  117.  
  118. ToolTip, Testing MouseClickDrag,0,0
  119. MouseClickDrag, left, 0, %XX%, %YY%, 200, 50
  120. sleep, %WaitTime%
  121.  
  122. ToolTip, Testing ControlClick,0,0
  123. ControlClick, x%XX% y%YY%, %wintext%, Left
  124. sleep, %WaitTime%
  125.  
  126. ToolTip, Testing Send Click,0,0
  127. Send, {Click %XX%, %YY%}
  128. sleep, %WaitTime%
  129.  
  130. ToolTip, Testing SendRaw Click,0,0
  131. sleep, %WaitTime%
  132. SendRaw, {LButton}
  133.  
  134. ToolTip, Testing SendPlay Click,0,0
  135. sleep, %WaitTime%
  136. SendPlay, {LButton}
  137.  
  138. ToolTip, Testing SendEvent Click,0,0
  139. sleep, %WaitTime%
  140. SendEvent, {LButton}
  141.  
  142. ToolTip, Testing SendInput Click,0,0
  143. sleep, %WaitTime%
  144. SendInput, {LButton}
  145.  
  146. ToolTip, Testing ControlSend Click,0,0
  147. sleep, %WaitTime%
  148. ControlSend,,{Click %XX%, %YY%},%wintext%
  149.  
  150. ToolTip, Testing ControlSendRaw Click,0,0
  151. sleep, %WaitTime%
  152. ControlSendRaw,,{Click %XX%, %YY%},%wintext%
  153.  
  154. ToolTip, Testing PostMessage Click,0,0
  155. sleep, %WaitTime%
  156. PostMessage, 0x201, 0x00000000, 0x01f0010f, ,%wintext% ; Down
  157. sleep, 500
  158. PostMessage, 0x202, 0x00000000, 0x01f0010f, ,%wintext% ; UP
  159.  
  160. ToolTip, Testing SendMessage Click,0,0
  161. sleep, %WaitTime%
  162. SendMessage, 0x201, 0x00000000, 0x01f0010f, , %wintext% ; Down
  163. sleep, 500
  164. SendMessage, 0x202, 0x00000000, 0x01f0010f, , %wintext% ; UP
  165.  
  166. ToolTip, Testing ControlFocus Click,0,0
  167. sleep, %WaitTime%
  168. ControlFocus, x%XX% y%YY%, %wintext%
  169.  
  170. ToolTip, Testing Dll Call Mouse_event,0,0
  171. sleep, %WaitTime%
  172. DllCall("mouse_event", uint, 2, int, x, int, y, uint, 0, int, 0)  ; Down
  173. sleep, 500
  174. DllCall("mouse_event", uint, 4, int, x, int, y, uint, 0, int, 0)  ; UP
  175.  
  176. ToolTip, Click Test Done,0,0
  177. sleep, %WaitTime%
  178. ToolTip,
  179. }
  180. return
  181.  
  182. SendTest: ; ========================================================================================
  183. {
  184. sleep, %WaitTime%
  185. ToolTip, Running Send Test,0,0
  186. WinActivate,%wintext%
  187.  
  188. ToolTip, Testing %Kex% With Send,0,0
  189. Send, %Kex%
  190. sleep, %WaitTime%
  191.  
  192. ToolTip, Testing %Kex% With SendRaw,0,0
  193. sleep, %WaitTime%
  194. SendRaw, %Kex%
  195.  
  196. ToolTip, Testing %Kex% With SendInput,0,0
  197. sleep, %WaitTime%
  198. SendInput, %Kex%
  199.  
  200. ToolTip, Testing %Kex% With SendPlay,0,0
  201. sleep, %WaitTime%
  202. SendPlay, %Kex%
  203.  
  204. ToolTip, Testing %Kex% With SendEvent,0,0
  205. sleep, %WaitTime%
  206. SendEvent, %Kex%
  207.  
  208. ToolTip, Testing %Kex% With ControlSend,0,0
  209. sleep, %WaitTime%
  210. ControlSend,,%Kex%, %wintext%
  211.  
  212. ToolTip, Testing %Kex% With ControlSendRaw,0,0
  213. sleep, %WaitTime%
  214. ControlSendRaw,,%Kex%, %wintext%
  215.  
  216. ToolTip, Testing Dll call keybd_event (will send 9),0,0
  217. sleep, %WaitTime%
  218. dllcall("keybd_event", int, 57, int, 0x049, int, 0, int, 0)
  219. sleep, 500
  220. dllcall("keybd_event", int, 57, int, 0x049, int, 2, int, 0)
  221.  
  222.  ToolTip, Testing %Kex% With Wscript,0,0
  223. sleep, %WaitTime%
  224. ComObjCreate("wscript.shell").SendKeys("%Kex%")
  225.  
  226. ToolTip, Send Test Done
  227. sleep, %WaitTime%
  228. ToolTip,
  229. }
  230.  
  231. return
  232.  
  233. ^esc::Reload
Advertisement
Add Comment
Please, Sign In to add comment