spkiller Posted June 20, 2009 Posted June 20, 2009 in my script i try to end the loop with a endloop when you press the button stop but when you press it the script continues and never stops here is the code expandcollapse popup$Form1 = GUICreate("App Automator", 751, 447) $Tab = GUICtrlCreateTab(8, 8, 737, 425) ;~ ------------------------------------------------------------------------------------ $tab1 = GUICtrlCreateTabItem("Bot 1") $browser1 = _IECreateEmbedded() $GUIActiveX1 = GUICtrlCreateObj($browser1, 300, 150, 430, 250) $URL1 = GUICtrlCreateInput("", 32, 104, 481, 21) $UrlLabel1 = GUICtrlCreateLabel("Url", 32, 80, 17, 17) $PointsLabel1 = GUICtrlCreateLabel("Points Needed per action?", 16, 136, 130, 17) $pointsin1 = GUICtrlCreateInput("", 32, 160, 89, 21) $TimeLabel1 = GUICtrlCreateLabel("Time needed to regain point in miliseconds?", 160, 136, 142, 17) $timein1 = GUICtrlCreateInput("", 176, 160, 105, 21) $start1 = GUICtrlCreateButton("Start", 104, 288, 97, 33, $WS_GROUP) $stop1 = GUICtrlCreateButton("stop", 104, 325, 97, 33, $WS_GROUP) $points1 = GUICtrlRead($pointsin1) $times1 = GUICtrlCreateInput("", 32, 220, 89, 21) $Timesx1 = GUICtrlCreateLabel("Times to do it? -1 = inf", 32, 200, 142, 17) GUISetState(@SW_SHOW) While 1 $time1 = GUICtrlRead($times1) $math1 = GUICtrlRead($pointsin1) * GUICtrlRead($time1) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $stop1 ExitLoop Case $start1 If GUICtrlRead($URL1) <> "" Then If GUICtrlRead($pointsin1) <> "" Then If GUICtrlRead($timein1) <> "" Then _IENavigate($browser1, GUICtrlRead($URL1), 1) Sleep($math1) $time1 = $time1 - 1 Do _IENavigate($browser1, GUICtrlRead($URL1), 1) Sleep($math1) $time1 = $time1 - 1 If $time1 = 0 Then ExitLoop Until $time1 = 0 Else MsgBox(0, "Your missing stuff", "please put the time it takes to regain a point") EndIf Else MsgBox(0, "Your missing stuff", "Please put the amount of points") EndIf Else MsgBox(0, "Your missing stuff", "please put the url of the action you wish to do") EndIf EndSwitch WEnd
Yashied Posted June 21, 2009 Posted June 21, 2009 Why have you not posted the ready to run script (I mean #Include <...>)? Actually, in your code, I do not like much ... No, I do not like the entire. Everything was done "very strange". Here are just a few changes relating to the topic.expandcollapse popupWhile 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit ; Case $stop1 ; ExitLoop Case $start1 $time1 = GUICtrlRead($times1) $math1 = GUICtrlRead($pointsin1) * $time1 If GUICtrlRead($URL1) <> "" Then If GUICtrlRead($pointsin1) <> "" Then If GUICtrlRead($timein1) <> "" Then ; _IENavigate($browser1, GUICtrlRead($URL1), 1) ; Sleep($math1) ; $time1 = $time1 - 1 $Url = GUICtrlRead($URL1) $Timer = TimerInit() $Update = True Do Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $stop1 ExitLoop EndSwitch If $Update Then _IENavigate($browser1, $Url, 1) $time1 = $time1 - 1 $Update = False EndIf If (TimerDiff($Timer) > $math1) Then $Timer = TimerInit() $Update = True EndIf Until $time1 = 0 Else MsgBox(0, "Your missing stuff", "please put the time it takes to regain a point") EndIf Else MsgBox(0, "Your missing stuff", "Please put the amount of points") EndIf Else MsgBox(0, "Your missing stuff", "please put the url of the action you wish to do") EndIf EndSwitch WEndIndeed, read the Help file, there is an excellent example for all functions. You do not need to invent the wheel. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
spkiller Posted June 21, 2009 Author Posted June 21, 2009 (edited) Why have you not posted the ready to run script (I mean #Include <...>)? Actually, in your code, I do not like much ... No, I do not like the entire. Everything was done "very strange". Here are just a few changes relating to the topic. expandcollapse popupWhile 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit ; Case $stop1 ; ExitLoop Case $start1 $time1 = GUICtrlRead($times1) $math1 = GUICtrlRead($pointsin1) * $time1 If GUICtrlRead($URL1) <> "" Then If GUICtrlRead($pointsin1) <> "" Then If GUICtrlRead($timein1) <> "" Then ; _IENavigate($browser1, GUICtrlRead($URL1), 1) ; Sleep($math1) ; $time1 = $time1 - 1 $Url = GUICtrlRead($URL1) $Timer = TimerInit() $Update = True Do Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $stop1 ExitLoop EndSwitch If $Update Then _IENavigate($browser1, $Url, 1) $time1 = $time1 - 1 $Update = False EndIf If (TimerDiff($Timer) > $math1) Then $Timer = TimerInit() $Update = True EndIf Until $time1 = 0 Else MsgBox(0, "Your missing stuff", "please put the time it takes to regain a point") EndIf Else MsgBox(0, "Your missing stuff", "Please put the amount of points") EndIf Else MsgBox(0, "Your missing stuff", "please put the url of the action you wish to do") EndIf EndSwitch WEnd Indeed, read the Help file, there is an excellent example for all functions. You do not need to invent the wheel. thnx lol i started to code a few days ago im used to another type of language if anyone plz help me i need a mentor XD Edited June 21, 2009 by spkiller
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