AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GUI Button Error

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Robbo
Guest





PostPosted: Sat Jul 26, 2008 4:57 pm    Post subject: GUI Button Error Reply with quote

My problem is simple but I can't fix it! I enter the password (In this case the password is "thepassword" without quotation marks). I then click the button "Submit Password". The following GUI box comes up with two more buttons "RuneScape" and "DragonFable". I've programmed another GUI box to appear after someone clicks RuneScape but it doesn't work. I've included the script in this text so you can try it out and hopefully give me some tips.

Thank you very much to anyone that helps,
Robbo

------------------------------------------------------------------------------

Gui, Add, Text, w180, Please enter the password.
Gui, Add, Edit, password* vpass,
Gui, Add, Button, Default, Submit Password
Gui, Show,, Hack Programs
Return,
ButtonSubmitpassword:
{
Gui, Submit, NoHide
}
if pass = thepassword
{
Gui, 2:Add, Text, w200, Correct password.
Gui, 2:Add, Text,, Please select the program you want to hack.
Gui, 2:Add, Button, Default, RuneScape
Gui, 2:Add, Button, Default, DragonFable
Gui, 2:Show,, Hack Programs
Return,
ButtonRunescape:
Gui 3:Add, Text, w200, Please select the hack.
Gui 3:Add, Text,, It is advised you calibrate the compass before continuing.
Gui 3:Add, Button, Default, Compass Calibration
Gui 3:Add, Button, Default, Members Vial Macro
Gui 3:Show,, Hack Programs
}
else
{
MsgBox,, Hack Programs, Incorrect Password
}

-------------------------------------------------------------------------------
Back to top
SpiderGames



Joined: 09 Jun 2008
Posts: 464
Location: Canada

PostPosted: Sat Jul 26, 2008 5:17 pm    Post subject: Reply with quote

read the Email I sent u =P
_________________

Xfire: SpiderGames77
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Robbo
Guest





PostPosted: Sun Jul 27, 2008 6:06 am    Post subject: Cheers Reply with quote

Didn't know you used the forum, I might join then!

Cheers
Back to top
Robbo



Joined: 27 Jul 2008
Posts: 5
Location: England

PostPosted: Sun Jul 27, 2008 6:50 am    Post subject: I'm Registered Reply with quote

Just to let you know, I'm now registered. Smile
_________________
I'm still working on this part of my life...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
sinkfaze



Joined: 18 Mar 2008
Posts: 139

PostPosted: Sun Jul 27, 2008 2:31 pm    Post subject: Reply with quote

You code is a little messy but I'm pretty sure I can see where the problem is. Your RuneScape button is part of GUI 2 but you have it labeled as if it's part of GUI 1. You were also missing a GUI Submit statement for that button. Try this instead:

Code:
Gui, Add, Text, w180, Please enter the password.
Gui, Add, Edit, password* vpass,
Gui, Add, Button, Default, Submit Password
Gui, Show,, Hack Programs
Return

ButtonSubmitPassword:
{
 Gui, Submit, NoHide
}
if pass = thepassword
{
 Gui, 2:Add, Text, w200, Correct password.
 Gui, 2:Add, Text,, Please select the program you want to hack.
 Gui, 2:Add, Button, Default, RuneScape
 Gui, 2:Add, Button, Default, DragonFable
 Gui, 2:Show,, Hack Programs
 Return

 2ButtonRunescape:

 Gui, 2: Submit, NoHide

 Gui 3:Add, Text, w200, Please select the hack.
 Gui 3:Add, Text,, It is advised you calibrate the compass before continuing.
 Gui 3:Add, Button, Default, Compass Calibration
 Gui 3:Add, Button, Default, Members Vial Macro
 Gui 3:Show,, Hack Programs
}
else
{
 MsgBox,, Hack Programs, Incorrect Password
}


I don't find it a good idea to stack GUI's in "if" statements, usually better to just Gosub them to a separate place in your script. That way each part of your process has its own individual place where you can work on it. You also want to remember to use GUI Destroy to get rid of the previous GUI Here's an example of how I revised your script when I tested it:

Code:
Gui, Add, Text, w180, Please enter the password.
Gui, Add, Edit, password* vpass,
Gui, Add, Button, Default, Submit Password
Gui, Show,, Hack Programs
Return

ButtonSubmitPassword:

Gui, Submit, NoHide

if pass = thepassword
 {
 Gui, Destroy
 Gosub, GameSelect
 }
else
 {
 MsgBox,, Hack Programs, Incorrect Password
 return
 }

GameSelect:

Gui, 2:Add, Text, w200, Correct password.
Gui, 2:Add, Text,, Please select the program you want to hack.
Gui, 2:Add, Button, Default, RuneScape
Gui, 2:Add, Button, , DragonFable
Gui, 2:Show,, Hack Programs
Return


2ButtonRuneScape:

Gui, 2: Submit, NoHide
Gui, 2: Destroy


Gui 3:Add, Text, w200, Please select the hack.
Gui 3:Add, Text,, It is advised you calibrate the compass before continuing.
Gui 3:Add, Button, Default, Compass Calibration
Gui 3:Add, Button, Default, Members Vial Macro
Gui 3:Show,, Hack Programs
return


Both codes tested successfully for me.
Back to top
View user's profile Send private message
Robbo



Joined: 27 Jul 2008
Posts: 5
Location: England

PostPosted: Sun Jul 27, 2008 2:41 pm    Post subject: I'm only a novice... Reply with quote

Thanks for all of it, I've only been going at AHK for two weeks and any advice is good, I was wondering how to get rid of the boxes, ill give it a go, thanks!
_________________
I'm still working on this part of my life...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Robbo



Joined: 27 Jul 2008
Posts: 5
Location: England

PostPosted: Sun Jul 27, 2008 2:49 pm    Post subject: P.S. Reply with quote

Quote:
You were also missing a GUI Submit statement for that button.


I worked out I don't actually need another submit statement, it works any way! And thanks for the tip on getting rid of the GUI boxes, it's much better!
_________________
I'm still working on this part of my life...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group