how about this maybe you can try.
#include <GUIConstants.au3>
$login = "k111"
$password = "d111"
$time = 1
GUICreate("My GUI Button"); will create a dialog box that when displayed is centered
Opt("GUICoordMode",2)
$Button_1 = GUICtrlCreateButton ("Start", 10, 30, 100)
$Button_2 = GUICtrlCreateButton ( "Stop", 0, -1)
GUISetState () ; will display an dialog box with 2 button
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_1
While 2
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Button_2
ExitLoop(1)
EndSelect
If PixelGetColor(146, 706) = 16776191 Then;
MouseMove (715, 414)
MouseClick("left")
MouseClick("left")
Send("{DEL 20}{BS 20}")
Send($login)
Sleep(100*$time)
Send("{TAB}{DEL 20}{BS 20}")
Send($password)
Sleep (100*$time)
Send("{ENTER 1}")
Sleep(5000*$time)
EndIf
If PixelGetColor(98, 90) = 16762624 Then
MouseMove(98, 90)
MouseClick("left")
Send("{ENTER 1}")
Send("{LCTRL}")
Sleep(100)
Send("{LCTRL}")
Sleep(100)
Send("{g}")
EndIf
Wend
EndSelect
Wend