Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 01:08

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

Advertisement



[AutoIt] Problem mit While-Schleife

Discussion on [AutoIt] Problem mit While-Schleife within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2009
Posts: 17
Received Thanks: 0
[AutoIt] Problem mit While-Schleife

Hallo. Ich bin noch Anfänger, also bitte keine dummen Sprüche.

Also. Ich möchte dass wenn ich Button1 drücke die Leertaste immer gedrückt wird und es immer nach 8Sek die Taste F3 drückt. Das mit der Leertaste klapp gut. Aber die F3 Taste wir nicht gedrückt. Was habe ich falsch gemacht?? Wenn ihr noch andere Fehler bemerkt, könnt ihr es mir auch noch sagen.

PHP Code:
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Farmbot by bls"364100193125)
$Button1 GUICtrlCreateButton("Start"848105330)
$Button2 GUICtrlCreateButton("Pause"12848105330)
$Button3 GUICtrlCreateButton("Beenden"24848105330)
$Label1 GUICtrlCreateLabel("Umhänge:"16165317)
GUICtrlCreateInput(""72168921)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
            
        Case 
$Button1
            sleep
(5000)
            
winwaitactive("Future-World2 - Germany´s No.1")
            While 
1
                
While 1
                    send
("{SPACE}")
                
WEnd
                send
("{F3}")
                
sleep(8000)
            
WEnd
            
        
Case $Button2 
            
While 1
                sleep
(500)
                
TrayTip("Farmbot by bls""Pause"00,)
            
WEnd
        
        
Case $Button3
            
Exit
            
    EndSwitch
WEnd 
blumiboy is offline  
Old 03/18/2011, 22:19   #2
 
elite*gold: 0
Join Date: Apr 2010
Posts: 2,832
Received Thanks: 4,152
Weil du (wieso auch immer) die SPACE Taste in eine eigene While Scheife gesetzt hast.

Probier mal

Code:
            While 1
                    send("{SPACE}")
                send("{F3}")
                sleep(8000)
            WEnd
Elektrochemie is offline  
Old 03/18/2011, 22:20   #3
 
elite*gold: 0
Join Date: Dec 2008
Posts: 12,369
Received Thanks: 2,168
Quote:
Originally Posted by Elektrochemie View Post
Weil du (wieso auch immer) die SPACE Taste in eine eigene While Scheife gesetzt hast.

Probier mal

Code:
            While 1
                    send("{SPACE}")
                send("{F3}")
                sleep(8000)
            WEnd
Wird so nicht funktionieren.
Er will ja immer Space gedrückt haben so wie ich das mitbekommen habe und nur alle 8 Sekunden F3.

Deine Version drückt Space, F3, wartet 8 Sek und fängt wieder bei Space an.
TheOwnWay is offline  
Old 03/18/2011, 22:23   #4
 
elite*gold: 0
Join Date: Apr 2010
Posts: 2,832
Received Thanks: 4,152
Ja dann ist Sleep aber die falsche Art. Damit wird das nicht klappen. Ausser du kannst in AutoIT Threads erstellen.
Elektrochemie is offline  
Old 03/20/2011, 19:55   #5
 
derpo's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 344
Received Thanks: 151
Schau dir doch mal die Timerfunktionen an :
PHP Code:
$Timer TimerInit()
While 
1
If TimerDiff($Timer) >= 8000 Then
;Tu dies und das
$Timer 
TimerInit
EndIf
Sleep(10)
WEnd 
derpo is offline  
Old 03/21/2011, 15:55   #6
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
AdlibRegister und AdlibUnRegister wäre auch noch eine Möglichkeit:
PHP Code:
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Farmbot by bls"364100)
$Button1 GUICtrlCreateButton("Start"848105330)
$Button2 GUICtrlCreateButton("Pause"12848105330)
$Button3 GUICtrlCreateButton("Beenden"24848105330)
$Label1 GUICtrlCreateLabel("Umhänge:"16165317)
GUICtrlCreateInput(""72168921)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While Sleep(10)
    
$nMsg GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
            WinActivate
("Future-World2 - Germany´s No.1")
            
AdlibRegister("_Space"50)
            
AdlibRegister("_F3"8000)
         Case 
$Button2
            AdlibUnRegister
("_Space")
            
AdlibUnRegister("_F3")
        Case 
$Button3
            
Exit
    EndSwitch
WEnd

Func _Space
()
    
Send("{SPACE}")
EndFunc

Func _F3
()
    
Send("{F3}")
EndFunc 
KDeluxe is offline  
Reply

Tags
autoit


Similar Threads Similar Threads
Hilfe bei der autoit while schleife
03/05/2010 - Metin2 - 7 Replies
Hallo, also ich habe ein problem und weiß nicht wie ich das lösen kann :( ich will einen Multihack machen für metin2 aber wenn ich eine value freezen muss dann mache ich eine while schleife und dann kann man keinen anderen Button mehr aktivieren :( z.B. (ein anderes von mit erstelltes programm) Code:
autoit do schleife problem
11/21/2009 - AutoIt - 16 Replies
wolte ma ein autoit spammer machen #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $pause
Autoit - If Schleife - Problem
05/27/2009 - AutoIt - 3 Replies
Huhu, hab nen kleines Problem mit ner If-Schleife: $pixel_mob = PixelGetColor (549, 68) $farbe_mob = Hex($pixel_mob, 6) if $farbe_mob = 'CE0000' Then ToolTip('Attacking...',0,0)
Autoit - Problem mit If-Schleife
05/27/2009 - General Coding - 1 Replies
Huhu, erstmal ne kleine Frage...hab gerade zu diesem Thema nen Beitrag geschrieben, flupps, 5 Minuten später war er gelöscht - keine PN, nix.. Naja...mal schaun ^^ Problem ist folgendes: Hab diese if schleife in meiner while schleife:



All times are GMT +1. The time now is 01:09.


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.