Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 14:30

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

Advertisement



Start Button Problem

Discussion on Start Button Problem within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
MaracuYa!'s Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 643
Received Thanks: 112
Start Button Problem

Hey Leute!

Ich bin ziemlich neu im Umgang mit AutoIT und wollte mich heute mal dransetzen ein kleines Programm zu schreiben.

Mit diesem Programm soll man mit einem Klick auf den Start Button auf die e*pvp Startseite kommen, nur habe ich keine Ahnung wie genau das funktionieren soll.

Ich habe es so gemacht :

Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 576, 230, 276, 369)
$Button1 = GUICtrlCreateButton("Start", 184, 152, 193, 49, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

	EndSwitch
WEnd
If GUICtrlRead($Start) = $GUI_CHECKED Then
	ShellExecute("http://www.elitepvpers.com/forum/s4-league/")
EndIf
Exit
Doch ich kriege immer den Fehler:

Code:
C:\Users\Patrick\Desktop\AutoIt v3 Script (neu).au3(18,22) : WARNING: $Start: possibly used before declaration.
If GUICtrlRead($Start)
~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Patrick\Desktop\AutoIt v3 Script (neu).au3(18,22) : ERROR: $Start: undeclared global variable.
If GUICtrlRead($Start)
~~~~~~~~~~~~~~~~~~~~~^
C:\Users\Patrick\Desktop\AutoIt v3 Script (neu).au3 - 1 error(s), 1 warning(s)
Wäre nett wenn mir einen sagen könnte wie man es macht, dass wenn man auf den Button drückt sich e*pvp öffnet.

€: Wenn ich den Fehler ignorieren möchte und "Continue" drücke öffnet sich die GUI doch wenn ich auf den Button klicke passiert nichts.

MFG~
MaracuYa! is offline  
Old 06/11/2011, 19:58   #2
 
Toasty-man's Avatar
 
elite*gold: 0
Join Date: Jul 2010
Posts: 307
Received Thanks: 290
So Sieht Dien script aus :
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"576230276369)
$Button1 GUICtrlCreateButton("Start"18415219349$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

    EndSwitch
WEnd
If GUICtrlRead($Start) = $GUI_CHECKED Then
    ShellExecute
("http://www.elitepvpers.com/forum/s4-league/")
EndIf
Exit 
und so würde meins aussehen ;D
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"576230276369)
$Button1 GUICtrlCreateButton("Start"18415219349$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
                Case 
$Button1
                        ShellExecute
("http://www.elitepvpers.com/forum/s4-league/")
                        Exit
    EndSwitch
WEnd 
Kurzn Und Knapp Mit dem Case $Button1 fügst du dem button eine funktion hinzu also diese funktioon soll er dann erledigen wenn man darauf klickt
Toasty-man is offline  
Thanks
1 User
Old 06/11/2011, 20:05   #3
 
MaracuYa!'s Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 643
Received Thanks: 112
Okay, vielen Dank.

Wie gesagt, bin noch neu und kenn mich noch nicht so recht aus.
Für's nächste mal weiss ich dann Bescheid!
MaracuYa! is offline  
Old 06/11/2011, 20:09   #4
 
Toasty-man's Avatar
 
elite*gold: 0
Join Date: Jul 2010
Posts: 307
Received Thanks: 290
Ist auch nich schlimm wenn du dich noch nicht so auskennt jeder ist mal anfänger
Toasty-man is offline  
Old 06/13/2011, 12:50   #5



 
xShizoidx's Avatar
 
elite*gold: 0
The Black Market: 283/0/0
Join Date: Feb 2011
Posts: 1,351
Received Thanks: 410
Autoit

So erstmal dein Script :

Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 576, 230, 276, 369)
$Button1 = GUICtrlCreateButton("Start", 184, 152, 193, 49, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

    EndSwitch
WEnd
If GUICtrlRead($Start) = $GUI_CHECKED Then
    ShellExecute("http://www.elitepvpers.com/forum/s4-league/")
EndIf
Exit
Dann noch ein paar Anmerkungen von mir, damit du es besser verstehst.

1. Wenn du einem Button ein Befehl zuweisen willst, dann musst du kein If verwenden. Dies kannst du verwenden, wenn du Comboboxen oder Checkboxen oder anderes verwendest, aber in deinem Fall ist es unnötig.

2.
#Region ### START Koda GUI section ### Form=
#EndRegion ### END Koda GUI section ###
Könntest du immer löschen, da es nicht gebraucht wird.

3. Buttons mit Case $Variablennnamen ( z.B. Button1 ) dem Befehl zuweisen und danach könntest du direkt den Befehl zuweisen , also den Befehl direkt unter Case $Variablenname schreiben oder ihn eine Funktion zuweisen z.B.

Code:
Case $Button1
	Funktion1() ; Zuweisung auf Funktion1
	
; ...........
	
Func Funktion1()
	; Hier alle Befehle hinein 
EndFunc
4. So müsste dein Script aussehen, wenn es richtig sein soll :

Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 576, 230, 276, 369)
$Button1 = GUICtrlCreateButton("Start", 184, 152, 193, 49, $WS_GROUP)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            ShellExecute("http://www.elitepvpers.com/forum/s4-league/")
    EndSwitch
WEnd
Exit
oder mit Funktion zuweisen so :
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 576, 230, 276, 369)
$Button1 = GUICtrlCreateButton("Start", 184, 152, 193, 49, $WS_GROUP)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Start() ; Name frei wählbar
    EndSwitch
WEnd
Exit

Func Start()
ShellExecute("http://www.elitepvpers.com/forum/s4-league/")
EndFunc

Wenn du noch irgendwelche Fragen hast, kannst du mir auch gerne eine Nachricht senden und ich helfe dir dann.

Mit freundlichen Grüßen,

Netterwurm8
xShizoidx is offline  
Reply


Similar Threads Similar Threads
Windows 7 - problem with START button
02/01/2011 - SRO Private Server - 2 Replies
Hi, I'm having a problem with all psro servers. I have all properly installed like SWSRO and MYSRO(FYserver) . Firstly when i launch , let's say , SWSRO launcher, appears both SWSRO 1 and SWSRO 2 servers to choose, appears all notices about updates and so on, but i can't get START button to appear? anyone knows the problem ? I am using Windows 7. And the same problem with mysro.
[PROBLEM]Game Start Button bleibt GRAU !
01/29/2011 - WarRock - 7 Replies
Titel sagt alles , kann mir wer helfen ;o ?
Darkorbit Start Button Problem(Neue Sperrmethode?)
09/12/2010 - DarkOrbit - 9 Replies
Gibt es eine neue Accountsperrmethode? Ich habe bei meinem 2 acc das problem dass sich beim start knopf (also der fürs spielfenster) nichts bewegt. Es öffnet sich keine Fenster bei meinem Hauptacc geht es aber. Könnte das eine neue Sperrmethode sein?
Help Start Button
04/14/2009 - Silkroad Online - 3 Replies
Everytime i start up SRO the start button doesnt appear and i checkd joymax website for a fix and they said it was a firewall but i dont have a firewall and my client version is v1.180 and i saw somewhere that the client version was 1.184 so im guessin the my so called firewall is blocking it from updating and i need some help
start button
04/14/2008 - Silkroad Online - 4 Replies
hi all from the latest 10 hours, wen i open the game. every time the start button dont appeard. end sometimes is says, the server is upgradein or somting like this. i dont know waht to do, plizz somone help mi (wen this hapend before wen i was log in to silkroad site its fix this problem) but now nothing help, even reinstall of the game not fix it. i hev a primium, end i loss this time im sory if my english is not good.



All times are GMT +1. The time now is 14:30.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.