[Need Help] Binding Functions Togheter

05/27/2015 20:42 Betarelease#1
Hello,

How can I bind these 2 codes togheter?
---------------------------------------------------------------------------------------
#include <GUIConstantsEx.au3>

GUICreate("GUICtrlSetData", 200,100)
GUISetState(@SW_SHOW)

$button = GUICtrlCreateButton("Start",60, 30, 80, 20)
$count = 0

While 1
Switch GUIGetMsg()
Case $button
If $count = 1 Then
GUICtrlSetData($button, "Start")
$count = 0
ElseIf $count = 0 Then
GUICtrlSetData($button, "Stop")
$count = 1
EndIf
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
---------------------------------------------------------------------------------------
GUICtrlCreateLabel("Key", 8, 10)
$key1 = GUICtrlCreateInput("", 35, 8, 120)
GUICtrlCreateLabel("Time", 8, 44)
$time1 = GUICtrlCreateInput("", 35, 40, 120)

$startbutton = GUICtrlCreateButton("Start", 190, 8, 60)

While 1
$msg = GUIGetMsg()

Select

Case $msg = $startbutton
$send1 = GUICtrlRead($key1)
$sleep1 = GUICtrlRead($time1)
While 1
Send($send1)
Sleep($sleep1)
WEnd

Case $msg = $GUI_EVENT_CLOSE

EndSelect

WEnd
---------------------------------------------------------------------------------------


I want to make a Spambot with start and stop button , but i dont know where i need to write in..(I'm a autoit beginner) AND THESE CODES ARE NOT MINE!
05/28/2015 15:18 °Incinerate#2
HTML Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $text
$Form1 = GUICreate("", 470, 80, 561, 353, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$text = GUICtrlCreateInput("bla bla bla", 80, 12, 376, 21)
$time = GUICtrlCreateInput("1000", 80, 42, 126, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
GUICtrlCreateLabel("Spamtext:", 15, 15, 61, 17, $SS_RIGHT)
GUICtrlCreateLabel("Time in ms:", 15, 45, 61, 17, $SS_RIGHT)
$start = GUICtrlCreateButton("Start", 220, 42, 75, 23)
$stop = GUICtrlCreateButton("Stop", 300, 42, 75, 23)
GUICtrlSetState(-1, $GUI_DISABLE)
$exit = GUICtrlCreateButton("Exit", 380, 42, 75, 23)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

		Case $exit
			Exit

		Case $start
			GUICtrlSetState($start, $GUI_DISABLE)
			GUICtrlSetState($text, $GUI_DISABLE)
			GUICtrlSetState($time, $GUI_DISABLE)
			GUICtrlSetState($stop, $GUI_ENABLE)
			AdlibRegister("_spam", GUICtrlRead($time))

		Case $stop
			GUICtrlSetState($stop, $GUI_DISABLE)
			GUICtrlSetState($start, $GUI_ENABLE)
			GUICtrlSetState($text, $GUI_ENABLE)
			GUICtrlSetState($time, $GUI_ENABLE)
			AdlibUnRegister("_spam")

	EndSwitch
WEnd

Func _spam()
	Send(GUICtrlRead($text))
	Send("{Enter}")
EndFunc