Hi, heres the code I'm using..
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.0.0
Author: Forsaken
#ce ----------------------------------------------------------------------------
#include <GUIConstantsEx.au3>
GUICreate("Auto", 335, 100)
GUISetState(@SW_SHOW)
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
GUIDelete()
ExitLoop
EndSelect
WEnd
when i press "start" which will run the code inside the selection and then press the "X" button which is supposed to exit the loop and close the GUI..but it does not.
the "X" button only works when i didnt start the loop and just closed it right after opening it.
i'm guessing the "sleep" function paused the script so that when i press the X button the program did not read it. is there any solution to this?
also if possible, i would like a stop button so it'll only exit the loop and do nothing until "start" is pressed again and by doing that will start the script from the beginning.
thanks.