Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 06:16

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



ExitLoop bricht schleife ab

Discussion on ExitLoop bricht schleife ab within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
Premiumlike's Avatar
 
elite*gold: 7
Join Date: Jul 2013
Posts: 440
Received Thanks: 166
ExitLoop bricht schleife ab

Hi jungs ich hab da ein Problem soweit Funktioniert mein Tool hier mal der Code

PHP Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compression=4
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Farm Bot"452104192124)
$Button1 GUICtrlCreateButton("Start"20812741)
$Button2 GUICtrlCreateButton("Stop"160812741)
$Button3 GUICtrlCreateButton("Beenden"300812741)
$Label1 GUICtrlCreateLabel("Farm Bot by Siverbot"806430428)
GUICtrlSetFont(-1144000"MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            
while 1
                Send
("{LWIN}")
                
sleep(2000)
                If 
$Button2 Then ExitLoop
                
If $Button3 Then ExitLoop
            WEnd
        
Case $Button2
            
While 2
                sleep
(100)
                If 
$Button1 Then ExitLoop
                
If $Button3 Then ExitLoop
            WEnd
        
Case $Button3
            
Exit 0
    
EndSwitch
WEnd 
Was soll es Tuen ?
Wenn ich Start drücke soll er alle 2 Sekunden die Windows Taste Drücken.
Wenn ich Stop Drücke soll er aufhören die Windows Taste zu Tätigen.
Wenn ich auf Beenden Klicke soll sich das Programm schließen.
soweit so gut an sich Funktioniert es auch nur Funktionieren die Schleifen nicht heißt er drückt nur einmal die Windows Taste und bricht dann ab.
Jemand eine Idee ?
Premiumlike is offline  
Old 04/01/2016, 23:26   #2
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Use a flag instead
elmarcia is offline  
Old 04/01/2016, 23:55   #3
 
elite*gold: 0
Join Date: Mar 2016
Posts: 104
Received Thanks: 34
@elmarcia bec i tested ur script and it gived me a error i overwritet it a bit ;P
PS. u need to click 2 times on stop ...

M3mphizzt is offline  
Old 04/02/2016, 02:00   #4
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Yeah haven't tested i forgot i named it started, and since the sleep time is 2 secs then pressing stop should fail because it's sleeping not registering messages
elmarcia is offline  
Old 04/02/2016, 18:52   #5

 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,494
Received Thanks: 1,769
PHP Code:
If $Button2 Then ExitLoop 
Button2 liefert kein boolschen Wert zurück sondern eine ControlID. Du musst, wie in der äußeren Schleife mit GUIGetMsg() = $Button2 abfragen. Da du aber einen Sleep in der Schleife hast, weiß ich nicht wie genau wie AutoIt das behandelt. Alternativen dazu wären HotKeys oder
Moneypulation is offline  
Reply


Similar Threads Similar Threads
schleife in einer schleife laufen lassen
01/17/2016 - AutoIt - 2 Replies
wollte mal fragen wie ich eine 2. schleife in einer while schleifen laufen lassen kann ohne das die 1. unterbrochen wird #include <ImageSearch.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <FastFind.au3> HotKeySet ("{ESC}", "_Exit") HotKeySet ("{f3}", "pause") Dim $myPics
ExitLoop in If-Abfrage
10/22/2014 - AutoIt - 9 Replies
Edit real problem: While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $CheckboxOnOff $On = True Case $GUI_EVENT_CLOSE Exit Case $AA = 0
Fehler suche (Anfangsprogramm) If schleife in einer If-Schleife
10/16/2013 - .NET Languages - 8 Replies
Wie mache ich eine If-Schleife in einer if-schleife? Danke^^ using System; using System.Collections.Generic; using System.Linq; using System.Text;
Exitloop Problem mit mehreren Schleifen
10/21/2009 - AutoIt - 5 Replies
Abend ! und zwar sieht mein Problem wie folgt aus: While 1=1 (das script) If...Then -hier ist das problem: ich möchte das das programm die while schleife sozusagen pausiert -dann das was gemacht werden soll



All times are GMT +1. The time now is 06:16.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.