Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 13:50

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

Advertisement



Hilfe if-schleife funktioniert nicht

Discussion on Hilfe if-schleife funktioniert nicht within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2009
Posts: 75
Received Thanks: 11
Hilfe if-schleife funktioniert nicht

schauts euch selber an:


HotKeySet("{F7}" , "Login")

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\marc\documents\form1.kxf
$Form1_1 = GUICreate("Form1", 625, 445, 192, 124)
$Benutzername = GUICtrlCreateInput("Benutzername", 24, 16, 249, 21)
$Passwort = GUICtrlCreateInput("Passwort", 24, 56, 249, 21)
$Server = GUICtrlCreateInput("Server", 24, 96, 65, 21)
$Channel = GUICtrlCreateInput("Channel", 24, 136, 65, 21)
$Charakter = GUICtrlCreateInput("Charakter", 24, 176, 65, 21)
$OK = GUICtrlCreateButton("OK", 136, 248, 353, 153, $WS_GROUP)
GUISetState(@SW_SHOW)
Dim $Form1_1_AccelTable[1][2] = [["{F7}", $OK]]
GUISetAccelerators($Form1_1_AccelTable)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
Func Login ()
While 1
If $Server = 1 Then
MouseMove(23, 345)
EndIf
WEnd

EndFunc
While 1
sleep (1)
WEnd
Attached Files
File Type: zip login.zip (631 Bytes, 1 views)
blubablubafasel is offline  
Old 07/11/2009, 15:11   #2
 
elite*gold: 20
Join Date: Mar 2007
Posts: 840
Received Thanks: 452
Es gibt keine If-Schleifen.

Bzw. du musst erstmal das Input auslesen , bevor du damit weiterarbeiten kannst.
Stichwort GUICtrlRead.
bUTL9R is offline  
Old 07/11/2009, 15:15   #3
 
elite*gold: 2
Join Date: Oct 2006
Posts: 218
Received Thanks: 138
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

Nach der Initialisierung befindet sich dein Programm permanent in dieser Schleife.
Wenn du jetzt noch hinzufügst:

Case $OK
Login()

müsste das klappen.
Das sieht dann so aus:

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $OK
Login()
EndSwitch
WEnd

Die letzte Schleife

While 1
sleep (1)
WEnd

ist übrigens unnütz, da du dich die ganze Zeit in der ersten While Schleife befindest.
Mankana is offline  
Old 07/11/2009, 15:20   #4
 
elite*gold: 20
Join Date: Mar 2007
Posts: 840
Received Thanks: 452
Mankan :
mit der Zeile "HotKeySet("{F7}" , "Login")"
wird auch erst die Loginserver Abfrage gestartet. Sein Problem war, dass er nicht das Input ausgelesen hat , bevor er abgefragt hat was darin stand.
bUTL9R is offline  
Old 07/11/2009, 15:29   #5
 
elite*gold: 0
Join Date: Jan 2009
Posts: 75
Received Thanks: 11
so hab mal n bisschen rumprobiert und geht noch immer nich:


HotKeySet("{F7}" , "Login")

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\marc\documents\form1.kxf
$Form1_1 = GUICreate("Form1", 625, 445, 192, 124)
$Benutzername = GUICtrlCreateInput("Benutzername", 24, 16, 249, 21)
$Passwort = GUICtrlCreateInput("Passwort", 24, 56, 249, 21)
$Server = GUICtrlCreateInput("Server", 24, 96, 65, 21)
$Channel = GUICtrlCreateInput("Channel", 24, 136, 65, 21)
$Charakter = GUICtrlCreateInput("Charakter", 24, 176, 65, 21)
$OK = GUICtrlCreateButton("OK", 136, 248, 353, 153, $WS_GROUP)
GUISetState(@SW_SHOW)
Dim $Form1_1_AccelTable[1][2] = [["{F7}", $OK]]
GUISetAccelerators($Form1_1_AccelTable)
#EndRegion ### END Koda GUI section ###
GUICtrlRead($Server)
Func Login ()

If $Server = 1 Then
Do
MouseMove(23, 345)
EndIf

EndFunc
While 1
sleep (1)
WEnd



While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
blubablubafasel is offline  
Old 07/11/2009, 15:47   #6
 
elite*gold: 2
Join Date: Oct 2006
Posts: 218
Received Thanks: 138
Ich habe die HotKeySet Funktion übersehen..

Deine If Abfrage fragt den Inhalt der Variable $Server ab, welcher die
Control ID ist. Du brauchst GUICtrlRead($Server) um den Text der in der
Inputbox steht auszulesen. Das hast du zwar schon weiter oben zu stehen
aber da bringt es dir nichts.

Das "Do" bei der If Anfrage muss weg

While 1
sleep (1)
WEnd

Diese While Schleife musst du noch entfernen dann passt alles solange du
in der Server Inputbox eine 1 zu stehen hast
Mankana is offline  
Old 07/11/2009, 16:09   #7
 
elite*gold: 0
Join Date: Jan 2009
Posts: 75
Received Thanks: 11
hmmm das geht iwie nicht.... kannste mal pls das funktionierende skript reinstellen?
blubablubafasel is offline  
Old 07/11/2009, 16:14   #8
 
elite*gold: 2
Join Date: Oct 2006
Posts: 218
Received Thanks: 138

Vorraussetzung das sich der Zeiger bewegt ist natürlich das du in der Server Inputbox
eine 1 zu stehen hast.
Mankana is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Hilfe Charles funktioniert nicht
05/05/2012 - Facebook - 1 Replies
Problem stellt sich folgendermaßen dar...ich kann mit charles (nach video) alles machen...neues item eingeben...das in storage packen....alle fehler umschreiben....out of sync kommt auch auf der farm...also entferne ich die breakpoints, schließe charles und refreshe die seite :-) und dann sagt mir mein firefox das die proxyeinstellungen nicht stimmen...hab auch das charles add on installiert. nun hab ich festgestellt das wenn ich die proxyeinstellungen in firefox angucke...bevor charles...
Hilfe Client funktioniert nicht
10/17/2010 - Aion Private Server - 4 Replies
Hey leute brauche ganz dringend hilfe ich habe mir Aion gedownloadet und wollte auf Just Aion spielen dann ging noch alles aber bei der Charackter erstellung kommt immer: ´´Aion Client funktioniert nicht mehr´´ Pls helft mir :,(
MC.EXE Funktioniert nicht mehr HILFE ;D
07/14/2010 - Metin2 Private Server - 11 Replies
Sers ich habe dass Problem dass bei meinem Server nach fast jedem Portalsprung oder relog die meldung kommt : Mc.exe funtioniert nicht mehr .. programm schliessen oder online das problem lösen oder so was ;D weiss jmd wie man das behebt??? danke
HILFE ULTRABOT FUNKTIONIERT NICHT!!!
07/11/2010 - Last Chaos - 5 Replies
kann mir wer helfen der ultrabot von tytal funktionier nicht...hab vieles ausprobiert kann mir jemand helfen??



All times are GMT +1. The time now is 13:50.


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.