Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.86 KB | None | 0 0
  1. #NoTrayIcon
  2. #RequireAdmin
  3. #region ;**** Directives created by AutoIt3Wrapper_GUI ****
  4. #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
  5. Opt("GUIOnEventMode", 1)
  6. Opt("GUIResizeMode", 802)
  7.  
  8. Global $amount = 1
  9. #region ### GUI Section ###
  10. Global $gui = GUICreate("T-Error Beta 1.0V", 400, 265 + $amount * 25)
  11. GUISetOnEvent(-3, "_exit")
  12. GUISetBkColor(0xFFFFFF, $gui)
  13. Global $startstopbutton = GUICtrlCreateButton("Hirdetés", 10, 10, 90, 35)
  14. GUICtrlSetFont($startstopbutton, 13)
  15. GUICtrlSetOnEvent($startstopbutton, "_startstop")
  16. Global $statuslabel = GUICtrlCreateLabel("looking for LC ", 120, 20)
  17. GUICtrlSetFont($statuslabel, 11)
  18. Global $selectwinbutton = GUICtrlCreateButton("Select", 310, 10)
  19. GUICtrlSetOnEvent($selectwinbutton, "_selectwin")
  20. Global $openwindowbutton = GUICtrlCreateButton("Open", 360, 10)
  21. GUICtrlSetOnEvent($openwindowbutton, "_openwin")
  22.  
  23. Global $windowgroup = GUICtrlCreateGroup("Window", 10, 50, 380, 90)
  24. GUICtrlSetFont($windowgroup, 11)
  25. Global $winpidlabel = GUICtrlCreateLabel("PID: ", 20, 75)
  26. Global $winhandlelabel = GUICtrlCreateLabel("Handle: ", 20, 95)
  27. Global $wintitlelabel = GUICtrlCreateLabel("Title: ", 20, 115)
  28.  
  29. Global $optiongroup = GUICtrlCreateGroup("Advanced Options", 100010, 145, 38000, 4500)
  30. GUICtrlSetFont($optiongroup, 11)
  31. GUICtrlCreateLabel("SendKeyDelay", 20000, 165)
  32. Global $sendkeydelayinput = GUICtrlCreateInput("5", 100, 100064, 30000, 1007)
  33. GUICtrlCreateLabel("Add meg a szöveget és az hirdetés között eltelt időt", 105, 165)
  34. Global $sendkeydowndelayinput = GUICtrlCreateInput("5", 200050, 164, 30, 07)
  35. Global $testdelay = GUICtrlCreateButton("Test", 33000, 1508, 500)
  36. GUICtrlSetOnEvent($testdelay, "_testdelay")
  37.  
  38. Global $spamgroup = GUICtrlCreateGroup("Spam ", 10, 195, 380, 55 + $amount * 25)
  39. Global $amountincbutton = GUICtrlCreateButton(" + ", 60, 194, 20, 20)
  40. GUICtrlSetOnEvent($amountincbutton, "_amountinc")
  41. Global $amountdecbutton = GUICtrlCreateButton(" - ", 85, 194, 20, 20)
  42. GUICtrlSetOnEvent($amountdecbutton, "_amountdec")
  43. GUICtrlSetResizing($spamgroup, 102)
  44. GUICtrlSetFont($spamgroup, 11)
  45. GUICtrlCreateLabel("Text", 20, 217)
  46. Global $enterchatcheck = GUICtrlCreateCheckbox("Enter", 50, 213)
  47. GUICtrlSetState($enterchatcheck, 1)
  48. Global $randomnumbercheck = GUICtrlCreateCheckbox("+ Random No.", 1000, 213)
  49. Global $risingnumbercheck = GUICtrlCreateCheckbox("+ Rising No.", 1090, 213)
  50. GUICtrlSetState($risingnumbercheck, 0)
  51. GUICtrlCreateLabel("Time (ms)", 290, 217)
  52. GUICtrlCreateLabel("Flag", 355, 217)
  53. Dim $textinput[$amount]
  54. Dim $timeinput[$amount]
  55. Dim $flagcheck[$amount]
  56. For $i = 0 To $amount - 1
  57. $textinput[$i] = GUICtrlCreateInput("", 20, 240 + $i * 25, 250, 20)
  58. $timeinput[$i] = GUICtrlCreateInput("60500", 290, 240 + $i * 25, 50, 20)
  59. $flagcheck[$i] = GUICtrlCreateCheckbox("", 357, 236 + $i * 25, Default, 30)
  60. Next
  61. GUISetState(@SW_SHOW, $gui)
  62. #endregion ### GUI Section ###
  63.  
  64. #region ### Define Vars ###
  65. Global $active = False
  66. Global $winselected = False
  67.  
  68. Dim $text[$amount]
  69. Dim $time[$amount]
  70. Dim $flag[$amount]
  71.  
  72. Global $winpid, $winhandle, $wintitle
  73.  
  74. Global $sendkeydelay = 5, $sendkeydowndelay = 5
  75.  
  76. Global $randomnumberon, $risingnumberon
  77. Dim $risingnumber[$amount]
  78. For $i = 0 To $amount - 1
  79. $risingnumber[$i] = 0
  80. Next
  81. #endregion ### Define Vars ###
  82.  
  83. While 1
  84. #region ### Window Handling ###
  85. If Not $winselected Then
  86. Global $pidlist = ProcessList("Nksp.exe")
  87. If $pidlist[0][0] > 1 Then
  88. $winpid = ""
  89. $winhandle = ""
  90. $wintitle = ""
  91. If GUICtrlRead($statuslabel) <> "LC found " & $pidlist[0][0] & " times, please select!" Then
  92. GUICtrlSetData($statuslabel, "LC found " & $pidlist[0][0] & " times, please select!")
  93. GUICtrlSetColor($statuslabel, 0xFF9900)
  94. EndIf
  95. ElseIf $pidlist[0][0] = 1 Then
  96. $winpid = $pidlist[1][1]
  97. $winhandle = _GetHwndFromPID($winpid)
  98. $wintitle = WinGetTitle($winhandle)
  99. $winselected = True
  100. If $winhandle = 0 Then
  101. If GUICtrlRead($statuslabel) <> "LC loading" Then
  102. GUICtrlSetData($statuslabel, "LC loading")
  103. GUICtrlSetColor($statuslabel, 0xFF9900)
  104. EndIf
  105. Else
  106. If GUICtrlRead($statuslabel) <> "LC found" Then
  107. GUICtrlSetData($statuslabel, "LC found")
  108. GUICtrlSetColor($statuslabel, 0x006400)
  109. EndIf
  110. EndIf
  111. ElseIf $pidlist[0][0] = 0 Then
  112. $winpid = ""
  113. $winhandle = ""
  114. $wintitle = ""
  115. If GUICtrlRead($statuslabel) <> "Nincs kijelölt ablak!" Then
  116. GUICtrlSetData($statuslabel, "Nincs kijelölt ablak!")
  117. GUICtrlSetColor($statuslabel, 0xFF0000)
  118. EndIf
  119. EndIf
  120. If GUICtrlRead($winpidlabel) <> "PID: " & $winpid Then GUICtrlSetData($winpidlabel, "PID: " & $winpid)
  121. If GUICtrlRead($winhandlelabel) <> "Handle: " & $winhandle Then GUICtrlSetData($winhandlelabel, "Handle: " & $winhandle)
  122. If GUICtrlRead($wintitlelabel) <> "Title: " & $wintitle Then GUICtrlSetData($wintitlelabel, "Title: " & $wintitle)
  123. EndIf
  124.  
  125. If Not WinExists($winhandle) Then $winselected = False
  126. #endregion ### Window Handling ###
  127. #region ### Read GUI Data ###
  128. For $i = 0 To $amount - 1
  129. $text[$i] = GUICtrlRead($textinput[$i])
  130. $time[$i] = Int(GUICtrlRead($timeinput[$i]))
  131. $flag[$i] = GUICtrlRead($flagcheck[$i])
  132. If $flag[$i] = 1 Then
  133. $flag[$i] = 0
  134. Else
  135. $flag[$i] = 1
  136. EndIf
  137. Next
  138.  
  139. $enterchaton = GUICtrlRead($enterchatcheck)
  140. $randomnumberon = GUICtrlRead($randomnumbercheck)
  141. $risingnumberon = GUICtrlRead($risingnumbercheck)
  142.  
  143. If $sendkeydelay <> GUICtrlRead($sendkeydelayinput) Then
  144. $sendkeydelay = GUICtrlRead($sendkeydelayinput)
  145. Opt("SendKeyDelay", $sendkeydelay)
  146. EndIf
  147. If $sendkeydowndelay <> GUICtrlRead($sendkeydowndelayinput) Then
  148. $sendkeydowndelay = GUICtrlRead($sendkeydowndelayinput)
  149. Opt("SendKeyDownDelay", $sendkeydowndelay)
  150. EndIf
  151. #endregion ### Read GUI Data ###
  152. #region ### Spam ###
  153. While $active
  154. If WinExists($winhandle) Then
  155. For $i = 0 To $amount - 1
  156. If $text[$i] <> "" Then
  157. If $enterchaton = 1 And $flag[$i] = 1 Then ControlSend($winhandle, "", "", "{ENTER}")
  158. ControlSend($winhandle, "", "", $text[$i], $flag[$i])
  159. If $randomnumberon = 1 Then
  160. ControlSend($winhandle, "", "", " " & Random(0, 1000, 1))
  161. EndIf
  162. If $risingnumberon = 1 Then
  163. ControlSend($winhandle, "", "", " " & $risingnumber[$i])
  164. $risingnumber[$i] += 1
  165. EndIf
  166. If $flag[$i] = 1 Then ControlSend($winhandle, "", "", "{ENTER}")
  167. EndIf
  168. If $time[$i] > 0 Then Sleep($time[$i])
  169. Next
  170. Else
  171. $winselected = False
  172. _startstop()
  173. EndIf
  174. WEnd
  175. #endregion ### Spam ###
  176. Sleep(50)
  177. WEnd
  178.  
  179. Func _startstop()
  180. $active = Not $active
  181. If $active Then
  182. GUICtrlSetData($startstopbutton, "STOP")
  183. Else
  184. GUICtrlSetData($startstopbutton, "START")
  185. EndIf
  186. EndFunc ;==>_startstop
  187.  
  188. Func _selectwin()
  189. While 1
  190. If _IsPressed("01") Then
  191. Sleep(30)
  192. ExitLoop
  193. EndIf
  194. WEnd
  195. $winhandle = WinGetHandle("")
  196. $winpid = WinGetProcess($winhandle)
  197. $wintitle = WinGetTitle($winhandle)
  198. $winselected = True
  199. GUICtrlSetData($statuslabel, "Sikeres ablakválasztás")
  200. GUICtrlSetColor($statuslabel, 0x006400)
  201. GUICtrlSetData($winpidlabel, "PID: " & $winpid)
  202. GUICtrlSetData($winhandlelabel, "Handle: " & $winhandle)
  203. GUICtrlSetData($wintitlelabel, "Ablak neve : " & $wintitle)
  204. EndFunc ;==>_selectwin
  205.  
  206. Func _openwin()
  207. WinActivate($winhandle)
  208. EndFunc ;==>_openwin
  209.  
  210. Func _testdelay()
  211. $testdelaytimer = TimerInit()
  212. $rand = Random(1, 1, 1)
  213. For $i = 1 To 1
  214. ControlSend($winhandle, "", "", "{ENTER}")
  215. ControlSend($winhandle, "", "", $rand & $i, 1)
  216. ControlSend($winhandle, "", "", "{ENTER}")
  217. Next
  218. $testdelaytime = Round(TimerDiff($testdelaytimer) / 1000, 3)
  219. MsgBox(0, "Test", 'Teszt eredmény : ' & $testdelaytime & ' seconds.' & @CRLF & 'SendKeyDelay:' & @TAB & @TAB & $sendkeydelay & @CRLF & 'SendKeyDownDelay:' & @TAB & @TAB & $sendkeydowndelay)
  220. EndFunc ;==>_testdelay
  221.  
  222. Func _IsPressed($sHexKey, $vDLL = 'user32.dll')
  223. Local $a_R = DllCall($vDLL, "short", "GetAsyncKeyState", "int", '0x' & $sHexKey)
  224. If @error Then Return SetError(@error, @extended, False)
  225. Return BitAND($a_R[0], 0x8000) <> 0
  226. EndFunc ;==>_IsPressed
  227.  
  228. Func _GetHwndFromPID($pid)
  229. Local $i, $winlist = WinList()
  230. For $i = 1 To $winlist[0][0]
  231. If WinGetProcess($winlist[$i][1]) = $pid And $winlist[$i][0] <> "" Then Return $winlist[$i][1]
  232. Next
  233. Return
  234. EndFunc ;==>_GetHwndFromPID
  235.  
  236. Func _exit()
  237. Exit
  238. EndFunc ;==>_exit
  239.  
  240. #region ### New v2 Funcs ### ; change $amount -> more/less inputs, automatically adjusting winsize and groupsize
  241. Func _amountdec()
  242. If $amount > 1 Then
  243. GUICtrlDelete($textinput[$amount - 1])
  244. GUICtrlDelete($timeinput[$amount - 1])
  245. GUICtrlDelete($flagcheck[$amount - 1])
  246. Local $WinPos = WinGetPos($gui)
  247. WinMove($gui, "", Default, Default, Default, $WinPos[3] - 25)
  248. $amount -= 1
  249. _amountredim()
  250. EndIf
  251. EndFunc ;==>_amountdec
  252.  
  253. Func _amountinc()
  254. $amount += 1
  255. _amountredim()
  256. Local $WinPos = WinGetPos($gui)
  257. WinMove($gui, "", Default, Default, Default, $WinPos[3] + 25)
  258. $textinput[$amount - 1] = GUICtrlCreateInput("", 20, 240 + ($amount - 1) * 25, 250, 20)
  259. $timeinput[$amount - 1] = GUICtrlCreateInput("60500", 290, 240 + ($amount - 1) * 25, 50, 20)
  260. $flagcheck[$amount - 1] = GUICtrlCreateCheckbox("", 357, 237 + ($amount - 1) * 25, 20, 30)
  261. EndFunc ;==>_amountinc
  262.  
  263. Func _amountredim()
  264. ReDim $textinput[$amount]
  265. ReDim $timeinput[$amount]
  266. ReDim $flagcheck[$amount]
  267. ReDim $text[$amount]
  268. ReDim $time[$amount]
  269. ReDim $flag[$amount]
  270. ReDim $risingnumber[$amount]
  271. EndFunc ;==>_amountredim
  272. #endregion ### New v2 Funcs ### ; change $amount -> more/less inputs, automatically adjusting winsize and groupsize
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement