xAlimorAx Posted November 22, 2009 Share Posted November 22, 2009 Ok so i have this so far expandcollapse popup#include <GUIConstantsEx.au3> ;Opt('MustDeclareVars', 1) Opt("GUICoordMode", 2) HotKeySet("^!x", "MyExit") ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file) $answer = MsgBox(4, "Verification For DCS Anti Idle", "Please enter the password!") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $answer = 7 Then MsgBox(4096, "Dragon", "OK. Bye!") Exit EndIf ; Loop around until the user gives a valid "autoit" answer $bLoop = 1 While $bLoop = 1 $text = InputBox("Verification For DCS Anti Idle", "Plase enter the password!") If @error = 1 Then MsgBox(4096, "Error", "You pressed 'Cancel' - try again!") Else ; They clicked OK, but did they type the right thing? If $text <> "Dragon" Then MsgBox(4096, "Error", "You typed in the wrong password - try again!") Else If Not WinExists("[CLASS:Second Life]") Then MsgBox(0, "", "Please make sure you have Second Life open before starting the program!") Else Example() EndIf EndIf EndIf WEnd Func Example() Local $Button_1, $Button_2, $msg GUICreate("DCS2 Anti-Idle", "250", "75") $Button_1 = GUICtrlCreateButton("Start Anti-Idle", 10, 30, 100) $Button_2 = GUICtrlCreateButton("End Anti-Idle", 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 Exit Case $msg = $Button_1 $bLoop = 5 ControlFocus("[CLASS:Second Life]", "", "") GUICtrlSetState($Button_1, $GUI_DISABLE) Sleep(2000) MouseClick("left", 647, 213, 1) Sleep(3000) MouseClick("left", 660, 213, 1) Sleep(3000) GUICtrlSetState($Button_1, $GUI_ENABLE) Case $msg = $Button_2 Exit EndSelect WEnd EndFunc ;==>Example Func MyExit() Exit EndFunc ;==>MyExit Where the mouseclick's are i want them to repeat forever until Case $msg = $Button_2 2 problems 1) It will not loop 2) When Case $msg = $Button_2 is used it will not exit Any help would be great! Link to comment Share on other sites More sharing options...
xAlimorAx Posted November 22, 2009 Author Share Posted November 22, 2009 Think i got it fixed using a alternate process for the Mouse Clicks... Added a new button to kill the second process and made the new process with notray! All i need now is to learn how to keep this window on top of all other windows... Anyone? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now