James Posted December 13, 2006 Share Posted December 13, 2006 I've searched but I cannot find it. I need to somehow stop a loop. Is there any code? Secure Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Helge Posted December 13, 2006 Share Posted December 13, 2006 ExitLoop.. Link to comment Share on other sites More sharing options...
James Posted December 13, 2006 Author Share Posted December 13, 2006 Oh right. Lol so simple. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
James Posted December 13, 2006 Author Share Posted December 13, 2006 That doesn't work My code is: Case $start For $i = 1 to 100 WinWaitActive("- Conversation") If WinExists("- Conversation") Then WinActivate("- Conversation") Send(IniRead("Text.ini", "MSN Text", "TXT"," Not Found") & "{enter}") WinClose("- Conversation") EndIf Next Case $stop ExitLoop I included the loop code aswell Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
herewasplato Posted December 13, 2006 Share Posted December 13, 2006 http://www.autoitscript.com/forum/index.ph...st&p=280893 [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Polyphem Posted December 13, 2006 Share Posted December 13, 2006 The help file says... ExitLoop [level] level = [optional] The number of loop levels to exit from. The default is 1 (meaning the current loop). ExitLoop will break out of a While, Do or For loop. Maybe that helps... This post will be edited again by Polyphem: Tomorrow, 11:55 AM Link to comment Share on other sites More sharing options...
James Posted December 13, 2006 Author Share Posted December 13, 2006 Nope that still doesnt work. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
James Posted December 13, 2006 Author Share Posted December 13, 2006 Herewasplato. I'm not sure on how to add that into my code. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Polyphem Posted December 13, 2006 Share Posted December 13, 2006 (edited) You've posted not enough of your code, to say exactly how to parse this in, maybe you repost the complete loops... Edited December 13, 2006 by Polyphem This post will be edited again by Polyphem: Tomorrow, 11:55 AM Link to comment Share on other sites More sharing options...
James Posted December 13, 2006 Author Share Posted December 13, 2006 That is my only loop. expandcollapse popup#include <GUIConstants.au3> Opt("WinTitleMatchMode", 2) HotKeySet("{F3}". "NextWhile") Global $trigger = 0 #Region ### START Koda GUI section ### Form=c:\documents and settings\james\my documents\codes\koda_1.6.0.2\forms\msn msg.kxf $window = GUICreate("MSN Auto-Reply", 339, 417, -1, -1) $start = GUICtrlCreateButton("Start MSN Message", 8, 152, 121, 57, 0) $stop = GUICtrlCreateButton("Stop MSN Message", 8, 224, 121, 57, 0) $setText = GUICtrlCreateButton("Set text to send", 8, 80, 121, 57, 0) $start1 = GUICtrlCreateLabel("Start the Message Replier", 144, 168, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $stop1 = GUICtrlCreateLabel("Stop the Message Replier", 144, 240, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $help = GUICtrlCreateButton("Help me!!!!", 8, 296, 321, 81, 0) $welcome = GUICtrlCreateEdit("", 9, 8, 322, 57, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)) GUICtrlSetData(-1, StringFormat("Welcome to the MSN Auto Replier by Secure_ICT. To start press \r\nSet Text and enter the text you wish to be entered when someone \r\ntalks to you.\r\n")) $disclaimer = GUICtrlCreateEdit("", 8, 384, 321, 25, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)) GUICtrlSetData(-1, StringFormat("This is a free script. Edit it to suit your needs.\r\n")) $setlabel = GUICtrlCreateLabel("Set the text you wish to be sent", 144, 96, 177, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $help SplashTextOn ( "Help me", "" & @CRLF & """Welcome to the MSN Auto Message Help."& @CRLF &"It's simple to make this run. All you need to do, is click the Set Text "& @CRLF &"button and "& @CRLF &"enter the text that you wish to be displayed when someone speaks to "& @CRLF &"you."& @CRLF &"You only have to set the text once as it saves the text as a .ini"& @CRLF &" "& @CRLF &"Then just press start and it will enter the message to any open MSN "& @CRLF &"conversation "& @CRLF &"window."& @CRLF &"Need more help? Just ask me on the topic."& @CRLF &""& @CRLF &"Secure_ICT") Sleep(10000) SplashOff() Case $setText Case $start For $i = 1 to 100 WinWaitActive("- Conversation") If WinExists("- Conversation") Then WinActivate("- Conversation") Send(IniRead("Text.ini", "MSN Text", "TXT"," Not Found") & "{enter}") WinClose("- Conversation") EndIf Next Case $stop Exit EndSwitch WEnd Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Kohr Posted December 13, 2006 Share Posted December 13, 2006 (edited) This "Next" statement does not have the "For" statement. I also don't believe you can do a loop inside of a "Switch" command (not 100% sure). EDIT: By inside the Switch I mean when it is NOT after a Case statement. Either way you need the FOR $i = 1 to 5 (example) after a "Case". Next Case $stop Exit Kohr Edited December 13, 2006 by Kohr AutoIt LinksAutoIt CrapsGrid_PixelSearchAdvancedPixelGrab Link to comment Share on other sites More sharing options...
James Posted December 13, 2006 Author Share Posted December 13, 2006 For some reason my Iniwrite wasn't included expandcollapse popup#include <GUIConstants.au3> Opt("WinTitleMatchMode", 2) $i = 0 #Region ### START Koda GUI section ### Form=c:\documents and settings\james\my documents\codes\koda_1.6.0.2\forms\msn msg.kxf $window = GUICreate("MSN Auto-Reply", 339, 417, -1, -1) $start = GUICtrlCreateButton("Start MSN Message", 8, 152, 121, 57, 0) $stop = GUICtrlCreateButton("Stop MSN Message", 8, 224, 121, 57, 0) $setText = GUICtrlCreateButton("Set text to send", 8, 80, 121, 57, 0) $start1 = GUICtrlCreateLabel("Start the Message Replier", 144, 168, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $stop1 = GUICtrlCreateLabel("Stop the Message Replier", 144, 240, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $help = GUICtrlCreateButton("Help me!!!!", 8, 296, 321, 81, 0) $welcome = GUICtrlCreateEdit("", 9, 8, 322, 57, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)) GUICtrlSetData(-1, StringFormat("Welcome to the MSN Auto Replier by Secure_ICT. To start press \r\nSet Text and enter the text you wish to be entered when someone \r\ntalks to you.\r\n")) $disclaimer = GUICtrlCreateEdit("", 8, 384, 321, 25, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)) GUICtrlSetData(-1, StringFormat("This is a free script. Edit it to suit your needs.\r\n")) $setlabel = GUICtrlCreateLabel("Set the text you wish to be sent", 144, 96, 177, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $help SplashTextOn ( "Help me", "" & @CRLF & """Welcome to the MSN Auto Message Help."& @CRLF &"It's simple to make this run. All you need to do, is click the Set Text "& @CRLF &"button and "& @CRLF &"enter the text that you wish to be displayed when someone speaks to "& @CRLF &"you."& @CRLF &"You only have to set the text once as it saves the text as a .ini"& @CRLF &" "& @CRLF &"Then just press start and it will enter the message to any open MSN "& @CRLF &"conversation "& @CRLF &"window."& @CRLF &"Need more help? Just ask me on the topic."& @CRLF &""& @CRLF &"Secure_ICT") Sleep(10000) SplashOff() Case $setText IniWrite("Text.ini", "MSN Text", "TXT", InputBox("What text should be entered?", "Type : ", "", "", 200, 50) ) Case $start Do WinWaitActive("- Conversation") If WinExists("- Conversation") Then WinActivate("- Conversation") Send(IniRead("Text.ini", "MSN Text", "TXT"," Not Found") & "{enter}") WinClose("- Conversation") EndIf $i += 1 Until $i >= 5 Case $stop ExitLoop EndSwitch WEnd What am I doing with that code? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Polyphem Posted December 13, 2006 Share Posted December 13, 2006 (edited) I restructured it a little bit, hope it still does what you wanted ... also you should add a status label somewhere, to tell the user if the script is waiting for a conversation or not... expandcollapse popup#include <GUIConstants.au3> Opt("WinTitleMatchMode", 2) ;HotKeySet("{F3}", "NextWhile") <==== gave me an error, what for? Global $trigger = 0 #Region ### START Koda GUI section ### Form=c:\documents and settings\james\my documents\codes\koda_1.6.0.2\forms\msn msg.kxf $window = GUICreate("MSN Auto-Reply", 339, 417, -1, -1) $start = GUICtrlCreateButton("Start MSN Message", 8, 152, 121, 57, 0) $stop = GUICtrlCreateButton("Stop MSN Message", 8, 224, 121, 57, 0) $setText = GUICtrlCreateButton("Set text to send", 8, 80, 121, 57, 0) $start1 = GUICtrlCreateLabel("Start the Message Replier", 144, 168, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $stop1 = GUICtrlCreateLabel("Stop the Message Replier", 144, 240, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) $help = GUICtrlCreateButton("Help me!!!!", 8, 296, 321, 81, 0) $welcome = GUICtrlCreateEdit("", 9, 8, 322, 57, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)) GUICtrlSetData(-1, StringFormat("Welcome to the MSN Auto Replier by Secure_ICT. To start press \r\nSet Text and enter the text you wish to be entered when someone \r\ntalks to you.\r\n")) $disclaimer = GUICtrlCreateEdit("", 8, 384, 321, 25, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)) GUICtrlSetData(-1, StringFormat("This is a free script. Edit it to suit your needs.\r\n")) $setlabel = GUICtrlCreateLabel("Set the text you wish to be sent", 144, 96, 177, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $help SplashTextOn ( "Help me", "" & @CRLF & """Welcome to the MSN Auto Message Help."& @CRLF &"It's simple to make this run. All you need to do, is click the Set Text "& @CRLF &"button and "& @CRLF &"enter the text that you wish to be displayed when someone speaks to "& @CRLF &"you."& @CRLF &"You only have to set the text once as it saves the text as a .ini"& @CRLF &" "& @CRLF &"Then just press start and it will enter the message to any open MSN "& @CRLF &"conversation "& @CRLF &"window."& @CRLF &"Need more help? Just ask me on the topic."& @CRLF &""& @CRLF &"Secure_ICT") Sleep(10000) SplashOff() Case $setText Case $start while 1 $nMsg = GUIGetMsg() ;WinWaitActive("- Conversation") <=== paused the script! If WinExists("- Conversation") Then WinActivate("- Conversation") Send(IniRead("Text.ini", "MSN Text", "TXT"," Not Found") & "{enter}") WinClose("- Conversation") EndIf if $nMsg = $stop Then ExitLoop EndIf WEnd EndSwitch WEnd Edited December 13, 2006 by Polyphem This post will be edited again by Polyphem: Tomorrow, 11:55 AM Link to comment Share on other sites More sharing options...
James Posted December 13, 2006 Author Share Posted December 13, 2006 That works perfect. Thanks Polyphem. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Polyphem Posted December 13, 2006 Share Posted December 13, 2006 Your welcome ... This post will be edited again by Polyphem: Tomorrow, 11:55 AM Link to comment Share on other sites More sharing options...
herewasplato Posted December 13, 2006 Share Posted December 13, 2006 Herewasplato. I'm not sure on how to add that into my code.sorry - had to step away - glad Polyphem was there for you... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
James Posted December 13, 2006 Author Share Posted December 13, 2006 (edited) OK. I've release my full program thanks to you all. If I missed you on the thanks to please tell me Edited December 13, 2006 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ 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