Valuater Posted September 3, 2005 Posted September 3, 2005 You cannot have two function operating at the same time, thus I changed the option to "Onevent" mode expandcollapse popup#include <GuiConstants.au3> Dim $stop = 0, $go = 0, $time = 20;sleep time ;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 ;-------------------------------------------------------------------------------------------------------------------------------------------------------------- GUI GuiCreate("mIRC Scrim Auto Searcher", 365, 316,(@DesktopWidth-392)/2, (@DesktopHeight-316)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $Picture = GuiCtrlCreatePic("C:\Documents and Settings\Jaimie\Bureau\mircscrim.jpg", 20, 10, 325, 65) $input1 = GuiCtrlCreateInput(".: 5 vs 5 | East | Yours | Cal-I | MAP | PM ME :.", 130, 85, 215, 22) GUICtrlSetState( -1, $GUI_FOCUS) $label1 = GuiCtrlCreateLabel("Hi. This is my first program. I made this mIRC Auto-Scrim Searcher to make it easier to find scrims. Just paste whatever line you'd have posted on mIRC to find a scrim and then press Start. It will also log you in the good mIRC server and make sure you don't bypass the flood protection.", 20, 150, 340, 80) $startbutton = GuiCtrlCreateButton("Start Finding!", 130, 115, 96, 23) GUICtrlSetState( -1, $GUI_DEFBUTTON) $stopbutton = GuiCtrlCreateButton("Stop Finding!", 249, 115, 96, 23) $progress = GUICtrlCreateProgress( 20, 116, 96, 20) GUISetState() ;-------------------------------------------------------------------------------------------------------------------------------------------------------------- GUI END ;Set on event-- does not use GUIGetMessage() Opt("GUIOnEventMode", 1) ; Change to OnEvent mode GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlSetOnEvent($startbutton, "startit") GUICtrlSetOnEvent($stopbutton, "stopit") ;-------------------------------------------------------------------------------------------------------------------------- end set on event While 1 If $go = 1 Then While 2 $inputread = GUICtrlRead($input1) $surebox = MsgBox(4, "Are you sure?", "Is this really the text you want to enter? " & $inputread ) If $surebox = 6 Then msgbox(0, "Accepted.", "mIRC should start searching for a scrim within 30 seconds or so. This window will close itself automatically.", 3) ElseIf $surebox = 7 Then MsgBox(0, "Canceled.", "The search was canceled. Please change your input and press Start Finding again. This window will close itself automatically.", 3) ExitLoop EndIf GUICtrlSetData($progress, 10) MsgBox(0, "Detecting...", "Now searching the path to your mIRC executable.", 2) GUICtrlSetData($progress, 20) Sleep($time) If $stop = 1 then ExitLoop Sleep(1000) GUICtrlSetData($progress, 30) Sleep($time) If $stop = 1 then ExitLoop runWait(@comspec & ' /c dir /b /s ' & @HomeDrive & '\mirc.exe > "' & @HomeDrive & '\result.txt"', @HomeDrive, @SW_HIDE) GUICtrlSetData($progress, 60) Sleep($time) If $stop = 1 then ExitLoop $resultopen = FileOpen(@HomeDrive & "\result.txt", 0 ) GUICtrlSetData($progress, 70) Sleep($time) If $stop = 1 then ExitLoop $resultread = FileReadLine($resultopen) GUICtrlSetData($progress, 80) Sleep($time) If $stop = 1 then ExitLoop FileClose($resultopen) DirCreate (@HomeDrive & "\mIRCScrimFinder\") GUICtrlSetData($progress, 90) Sleep($time) If $stop = 1 then ExitLoop IniWrite(@homeDrive & "\mIRCScrimFinder\config.ini", "Path", "$mircpath", $resultread) GUICtrlSetData($progress, 100) Sleep($time) If $stop = 1 then ExitLoop MsgBox(0, "Detected.", "mIRC Scrim Finder detected the path to your mIRC executable." & @CRLF & "The starting is now only a question of seconds.", 2) ExitLoop WEnd $go = 0 EndIf If $stop = 1 Then MsgBox(0, "Cancelled", "Search was cancelled...", 2) GUICtrlSetData($progress, 0) $stop = 0 EndIf Sleep(100) WEnd Func stopit() $stop = 1 EndFunc Func startit() $go = 1 Endfunc Func CLOSEClicked() MsgBox(0, "Close Program", "You clicked CLOSE!" & @CRLF & " Now Exiting...", 3) Exit EndFunc it works... but still does not utilize the input for any part of the search ( i dont know your direction ) good luck 8)
Gaboury Posted September 3, 2005 Author Posted September 3, 2005 Thanks..I'll try to do the rest by myself I'll ask you if I have no more clues Thanks for all bro!
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