PHP Code:
#include <GuiListView.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Spammer", 244, 216, 192, 124)
$ListView1 = GUICtrlCreateListView("", 8, 8, 145, 201)
_GUICtrlListView_AddColumn($ListView1, "Text", 90)
_GUICtrlListView_AddColumn($ListView1, "Timer")
$Button1 = GUICtrlCreateButton("Add", 160, 16, 75, 25)
$Button2 = GUICtrlCreateButton("Delete", 160, 56, 75, 25)
$Label1 = GUICtrlCreateLabel("Text", 32, 24, 36, 17)
GUICtrlSetState(-1, $GUI_HIDE)
$Input1 = GUICtrlCreateInput("", 64, 24, 121, 21)
GUICtrlSetState(-1, $GUI_HIDE)
$Label2 = GUICtrlCreateLabel("Timer", 32, 64, 36, 17)
GUICtrlSetState(-1, $GUI_HIDE)
$Input2 = GUICtrlCreateInput("", 64, 64, 121, 21)
GUICtrlSetState(-1, $GUI_HIDE)
$Button3 = GUICtrlCreateButton("OK", 24, 104, 75, 25)
GUICtrlSetState(-1, $GUI_HIDE)
$Button4 = GUICtrlCreateButton("Cancel", 124, 104, 75, 25)
GUICtrlSetState(-1, $GUI_HIDE)
$checkbox = GUICtrlCreateCheckbox("Start", 160, 185)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
Dim $zaeList = 0, $text[1], $timerinput[1], $timer[1]
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Button1
_change()
Case $Button2
For $i = 0 To $zaeList
If _GUICtrlListView_GetItemFocused($ListView1, $i) = True Then
_GUICtrlListView_DeleteItem(GUICtrlGetHandle($ListView1), $i)
$zaeList -= 1
_ArrayDelete($text, $i)
_ArrayDelete($timerinput, $i)
_ArrayDelete($timer, $i)
EndIf
Next
Case $Button3
If StringRegExp(GUICtrlRead($Input2), "\d") And GUICtrlRead($Input1) <> "" Then
_GUICtrlListView_AddItem($ListView1, GUICtrlRead($Input1))
$text[$zaeList] = _GUICtrlListView_GetItemText($ListView1, $zaeList)
_GUICtrlListView_AddSubItem($ListView1, $zaeList, GUICtrlRead($Input2), 1)
$timerinput[$zaeList] = _GUICtrlListView_GetItemText($ListView1, $zaeList, 1)
$zaeList += 1
ReDim $text[$zaeList + 1]
ReDim $timerinput[$zaeList + 1]
ReDim $timer[$zaeList + 1]
Else
MsgBox("Error", "Fehler", "Fehlerhafte Eingabe!")
EndIf
_change()
GUICtrlSetState($ListView1, $GUI_SHOW)
Case $Button4
_change()
GUICtrlSetState($ListView1, $GUI_SHOW)
EndSwitch
If BitAND(GUICtrlRead($checkbox),1) Then
For $I=0 To $zaeList
If TimerDiff($timer[$I]) >= $timerinput[$I]*1000 And Not WinActive($Form1) Then
Send($text[$I])
$timer[$I]=TimerInit()
EndIf
Next
EndIf
WEnd
Func _change()
Dim $objekte[9] = [$Button1, $Button2, $Button3, $Button4, $Input1, $Input2, $Label1, $Label2, $checkbox]
For $i = 0 To 8
If GUICtrlGetState($objekte[$i]) = 80 Then
GUICtrlSetState($objekte[$i], $GUI_HIDE)
GUICtrlSetState($ListView1, $GUI_HIDE)
Else
GUICtrlSetState($objekte[$i], $GUI_SHOW)
EndIf
Next
EndFunc