Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoTrayIcon
- #RequireAdmin
- #region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
- Opt("GUIOnEventMode", 1)
- Opt("GUIResizeMode", 802)
- Global $amount = 1
- #region ### GUI Section ###
- Global $gui = GUICreate("T-Error Beta 1.0V", 400, 265 + $amount * 25)
- GUISetOnEvent(-3, "_exit")
- GUISetBkColor(0xFFFFFF, $gui)
- Global $startstopbutton = GUICtrlCreateButton("Hirdetés", 10, 10, 90, 35)
- GUICtrlSetFont($startstopbutton, 13)
- GUICtrlSetOnEvent($startstopbutton, "_startstop")
- Global $statuslabel = GUICtrlCreateLabel("looking for LC ", 120, 20)
- GUICtrlSetFont($statuslabel, 11)
- Global $selectwinbutton = GUICtrlCreateButton("Select", 310, 10)
- GUICtrlSetOnEvent($selectwinbutton, "_selectwin")
- Global $openwindowbutton = GUICtrlCreateButton("Open", 360, 10)
- GUICtrlSetOnEvent($openwindowbutton, "_openwin")
- Global $windowgroup = GUICtrlCreateGroup("Window", 10, 50, 380, 90)
- GUICtrlSetFont($windowgroup, 11)
- Global $winpidlabel = GUICtrlCreateLabel("PID: ", 20, 75)
- Global $winhandlelabel = GUICtrlCreateLabel("Handle: ", 20, 95)
- Global $wintitlelabel = GUICtrlCreateLabel("Title: ", 20, 115)
- Global $optiongroup = GUICtrlCreateGroup("Advanced Options", 100010, 145, 38000, 4500)
- GUICtrlSetFont($optiongroup, 11)
- GUICtrlCreateLabel("SendKeyDelay", 20000, 165)
- Global $sendkeydelayinput = GUICtrlCreateInput("5", 100, 100064, 30000, 1007)
- GUICtrlCreateLabel("Add meg a szöveget és az hirdetés között eltelt időt", 105, 165)
- Global $sendkeydowndelayinput = GUICtrlCreateInput("5", 200050, 164, 30, 07)
- Global $testdelay = GUICtrlCreateButton("Test", 33000, 1508, 500)
- GUICtrlSetOnEvent($testdelay, "_testdelay")
- Global $spamgroup = GUICtrlCreateGroup("Spam ", 10, 195, 380, 55 + $amount * 25)
- Global $amountincbutton = GUICtrlCreateButton(" + ", 60, 194, 20, 20)
- GUICtrlSetOnEvent($amountincbutton, "_amountinc")
- Global $amountdecbutton = GUICtrlCreateButton(" - ", 85, 194, 20, 20)
- GUICtrlSetOnEvent($amountdecbutton, "_amountdec")
- GUICtrlSetResizing($spamgroup, 102)
- GUICtrlSetFont($spamgroup, 11)
- GUICtrlCreateLabel("Text", 20, 217)
- Global $enterchatcheck = GUICtrlCreateCheckbox("Enter", 50, 213)
- GUICtrlSetState($enterchatcheck, 1)
- Global $randomnumbercheck = GUICtrlCreateCheckbox("+ Random No.", 1000, 213)
- Global $risingnumbercheck = GUICtrlCreateCheckbox("+ Rising No.", 1090, 213)
- GUICtrlSetState($risingnumbercheck, 0)
- GUICtrlCreateLabel("Time (ms)", 290, 217)
- GUICtrlCreateLabel("Flag", 355, 217)
- Dim $textinput[$amount]
- Dim $timeinput[$amount]
- Dim $flagcheck[$amount]
- For $i = 0 To $amount - 1
- $textinput[$i] = GUICtrlCreateInput("", 20, 240 + $i * 25, 250, 20)
- $timeinput[$i] = GUICtrlCreateInput("60500", 290, 240 + $i * 25, 50, 20)
- $flagcheck[$i] = GUICtrlCreateCheckbox("", 357, 236 + $i * 25, Default, 30)
- Next
- GUISetState(@SW_SHOW, $gui)
- #endregion ### GUI Section ###
- #region ### Define Vars ###
- Global $active = False
- Global $winselected = False
- Dim $text[$amount]
- Dim $time[$amount]
- Dim $flag[$amount]
- Global $winpid, $winhandle, $wintitle
- Global $sendkeydelay = 5, $sendkeydowndelay = 5
- Global $randomnumberon, $risingnumberon
- Dim $risingnumber[$amount]
- For $i = 0 To $amount - 1
- $risingnumber[$i] = 0
- Next
- #endregion ### Define Vars ###
- While 1
- #region ### Window Handling ###
- If Not $winselected Then
- Global $pidlist = ProcessList("Nksp.exe")
- If $pidlist[0][0] > 1 Then
- $winpid = ""
- $winhandle = ""
- $wintitle = ""
- If GUICtrlRead($statuslabel) <> "LC found " & $pidlist[0][0] & " times, please select!" Then
- GUICtrlSetData($statuslabel, "LC found " & $pidlist[0][0] & " times, please select!")
- GUICtrlSetColor($statuslabel, 0xFF9900)
- EndIf
- ElseIf $pidlist[0][0] = 1 Then
- $winpid = $pidlist[1][1]
- $winhandle = _GetHwndFromPID($winpid)
- $wintitle = WinGetTitle($winhandle)
- $winselected = True
- If $winhandle = 0 Then
- If GUICtrlRead($statuslabel) <> "LC loading" Then
- GUICtrlSetData($statuslabel, "LC loading")
- GUICtrlSetColor($statuslabel, 0xFF9900)
- EndIf
- Else
- If GUICtrlRead($statuslabel) <> "LC found" Then
- GUICtrlSetData($statuslabel, "LC found")
- GUICtrlSetColor($statuslabel, 0x006400)
- EndIf
- EndIf
- ElseIf $pidlist[0][0] = 0 Then
- $winpid = ""
- $winhandle = ""
- $wintitle = ""
- If GUICtrlRead($statuslabel) <> "Nincs kijelölt ablak!" Then
- GUICtrlSetData($statuslabel, "Nincs kijelölt ablak!")
- GUICtrlSetColor($statuslabel, 0xFF0000)
- EndIf
- EndIf
- If GUICtrlRead($winpidlabel) <> "PID: " & $winpid Then GUICtrlSetData($winpidlabel, "PID: " & $winpid)
- If GUICtrlRead($winhandlelabel) <> "Handle: " & $winhandle Then GUICtrlSetData($winhandlelabel, "Handle: " & $winhandle)
- If GUICtrlRead($wintitlelabel) <> "Title: " & $wintitle Then GUICtrlSetData($wintitlelabel, "Title: " & $wintitle)
- EndIf
- If Not WinExists($winhandle) Then $winselected = False
- #endregion ### Window Handling ###
- #region ### Read GUI Data ###
- For $i = 0 To $amount - 1
- $text[$i] = GUICtrlRead($textinput[$i])
- $time[$i] = Int(GUICtrlRead($timeinput[$i]))
- $flag[$i] = GUICtrlRead($flagcheck[$i])
- If $flag[$i] = 1 Then
- $flag[$i] = 0
- Else
- $flag[$i] = 1
- EndIf
- Next
- $enterchaton = GUICtrlRead($enterchatcheck)
- $randomnumberon = GUICtrlRead($randomnumbercheck)
- $risingnumberon = GUICtrlRead($risingnumbercheck)
- If $sendkeydelay <> GUICtrlRead($sendkeydelayinput) Then
- $sendkeydelay = GUICtrlRead($sendkeydelayinput)
- Opt("SendKeyDelay", $sendkeydelay)
- EndIf
- If $sendkeydowndelay <> GUICtrlRead($sendkeydowndelayinput) Then
- $sendkeydowndelay = GUICtrlRead($sendkeydowndelayinput)
- Opt("SendKeyDownDelay", $sendkeydowndelay)
- EndIf
- #endregion ### Read GUI Data ###
- #region ### Spam ###
- While $active
- If WinExists($winhandle) Then
- For $i = 0 To $amount - 1
- If $text[$i] <> "" Then
- If $enterchaton = 1 And $flag[$i] = 1 Then ControlSend($winhandle, "", "", "{ENTER}")
- ControlSend($winhandle, "", "", $text[$i], $flag[$i])
- If $randomnumberon = 1 Then
- ControlSend($winhandle, "", "", " " & Random(0, 1000, 1))
- EndIf
- If $risingnumberon = 1 Then
- ControlSend($winhandle, "", "", " " & $risingnumber[$i])
- $risingnumber[$i] += 1
- EndIf
- If $flag[$i] = 1 Then ControlSend($winhandle, "", "", "{ENTER}")
- EndIf
- If $time[$i] > 0 Then Sleep($time[$i])
- Next
- Else
- $winselected = False
- _startstop()
- EndIf
- WEnd
- #endregion ### Spam ###
- Sleep(50)
- WEnd
- Func _startstop()
- $active = Not $active
- If $active Then
- GUICtrlSetData($startstopbutton, "STOP")
- Else
- GUICtrlSetData($startstopbutton, "START")
- EndIf
- EndFunc ;==>_startstop
- Func _selectwin()
- While 1
- If _IsPressed("01") Then
- Sleep(30)
- ExitLoop
- EndIf
- WEnd
- $winhandle = WinGetHandle("")
- $winpid = WinGetProcess($winhandle)
- $wintitle = WinGetTitle($winhandle)
- $winselected = True
- GUICtrlSetData($statuslabel, "Sikeres ablakválasztás")
- GUICtrlSetColor($statuslabel, 0x006400)
- GUICtrlSetData($winpidlabel, "PID: " & $winpid)
- GUICtrlSetData($winhandlelabel, "Handle: " & $winhandle)
- GUICtrlSetData($wintitlelabel, "Ablak neve : " & $wintitle)
- EndFunc ;==>_selectwin
- Func _openwin()
- WinActivate($winhandle)
- EndFunc ;==>_openwin
- Func _testdelay()
- $testdelaytimer = TimerInit()
- $rand = Random(1, 1, 1)
- For $i = 1 To 1
- ControlSend($winhandle, "", "", "{ENTER}")
- ControlSend($winhandle, "", "", $rand & $i, 1)
- ControlSend($winhandle, "", "", "{ENTER}")
- Next
- $testdelaytime = Round(TimerDiff($testdelaytimer) / 1000, 3)
- MsgBox(0, "Test", 'Teszt eredmény : ' & $testdelaytime & ' seconds.' & @CRLF & 'SendKeyDelay:' & @TAB & @TAB & $sendkeydelay & @CRLF & 'SendKeyDownDelay:' & @TAB & @TAB & $sendkeydowndelay)
- EndFunc ;==>_testdelay
- Func _IsPressed($sHexKey, $vDLL = 'user32.dll')
- Local $a_R = DllCall($vDLL, "short", "GetAsyncKeyState", "int", '0x' & $sHexKey)
- If @error Then Return SetError(@error, @extended, False)
- Return BitAND($a_R[0], 0x8000) <> 0
- EndFunc ;==>_IsPressed
- Func _GetHwndFromPID($pid)
- Local $i, $winlist = WinList()
- For $i = 1 To $winlist[0][0]
- If WinGetProcess($winlist[$i][1]) = $pid And $winlist[$i][0] <> "" Then Return $winlist[$i][1]
- Next
- Return
- EndFunc ;==>_GetHwndFromPID
- Func _exit()
- Exit
- EndFunc ;==>_exit
- #region ### New v2 Funcs ### ; change $amount -> more/less inputs, automatically adjusting winsize and groupsize
- Func _amountdec()
- If $amount > 1 Then
- GUICtrlDelete($textinput[$amount - 1])
- GUICtrlDelete($timeinput[$amount - 1])
- GUICtrlDelete($flagcheck[$amount - 1])
- Local $WinPos = WinGetPos($gui)
- WinMove($gui, "", Default, Default, Default, $WinPos[3] - 25)
- $amount -= 1
- _amountredim()
- EndIf
- EndFunc ;==>_amountdec
- Func _amountinc()
- $amount += 1
- _amountredim()
- Local $WinPos = WinGetPos($gui)
- WinMove($gui, "", Default, Default, Default, $WinPos[3] + 25)
- $textinput[$amount - 1] = GUICtrlCreateInput("", 20, 240 + ($amount - 1) * 25, 250, 20)
- $timeinput[$amount - 1] = GUICtrlCreateInput("60500", 290, 240 + ($amount - 1) * 25, 50, 20)
- $flagcheck[$amount - 1] = GUICtrlCreateCheckbox("", 357, 237 + ($amount - 1) * 25, 20, 30)
- EndFunc ;==>_amountinc
- Func _amountredim()
- ReDim $textinput[$amount]
- ReDim $timeinput[$amount]
- ReDim $flagcheck[$amount]
- ReDim $text[$amount]
- ReDim $time[$amount]
- ReDim $flag[$amount]
- ReDim $risingnumber[$amount]
- EndFunc ;==>_amountredim
- #endregion ### New v2 Funcs ### ; change $amount -> more/less inputs, automatically adjusting winsize and groupsize
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement