Jump to content
Sign in to follow this  
Raskus

Buttons

Recommended Posts

Raskus

I'm currently working on a GUI to automate software and I've run into an issue with buttons. I started coding in autoit last night so sorry if this is kind of silly, can someone take a look at my code and tell me what I'm doing wrong? I've looked around for tutorials and it took me about an hour and a half just to get this far. My entire GUI is all finished, all that's left is to get the buttons to work and I'm set.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $Sending, $Pause,$Button1,$Button2
$Pause = false
$Form1_1 = GUICreate("WIZbot", 499, 380, 182, 120)
$Pic1 = GUICtrlCreatePic(" ", 0, 0, 497, 377)
$Main = GUICtrlCreateLabel("WIZbot", 80, 48, 136, 36)
GUICtrlSetFont(-1, 32, 400, 0, "Terminal")
GUICtrlSetColor(-1, 0x3399FF)
GUICtrlSetBkColor(-1, 0xFFFFFF)
$Button1 = GUICtrlCreateButton("Requirements", 88, 104, 145, 49)
$Button2 = GUICtrlCreateButton("Instructions", 88, 184, 145, 57)
$Label1 = GUICtrlCreateLabel("Credits:", 96, 280, 36, 17)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label2 = GUICtrlCreateLabel("Raskoosh", 96, 304, 52, 17)
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
$Label3 = GUICtrlCreateLabel("Danbrisco", 96, 328, 57, 21)
GUICtrlSetColor(-1, 0xFF00FF)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $Msg = GUIGetMsg()
    If $Msg=-3 Then Exit
    If $Msg=$Button1 Then Button1()
    If $Msg=$Button2 Then Button2()
WEnd


;Button1
Func Button1()
GUICreate("WIZbot Instructions", 300, 242, 330, 185)
GUISetBkColor(0x000000)
;First Label
GUICtrlCreateLabel("Instructions", 88, 0, 124, 21)
GUICtrlSetFont(-1, 12, 400, 0, "OCR A Extended")
GUICtrlSetColor(-1, 0xFF00FF)
;Second Label
GUICtrlCreateLabel("", 40, 24, 165, 17)
GUICtrlSetColor(-1, 0xFF00FF)
;Third Label
GUICtrlCreateLabel("", 40, 48, 193, 17)
GUICtrlSetColor(-1, 0xFF00FF)
;Fourth Label
GUICtrlCreateLabel("", 40, 72, 195, 17)
GUICtrlSetColor(-1, 0xFF00FF)
;Fifth Label
GUICtrlCreateLabel("", 40, 96, 117, 17)
GUICtrlSetColor(-1, 0xFF00FF)
;Sixth Label
GUICtrlCreateLabel("", 40, 152, 127, 17)
GUICtrlSetColor(-1, 0xFF00FF)
;Seventh Label
GUICtrlCreateLabel("", 40, 168, 243, 17)
GUICtrlSetColor(-1, 0xFF00FF)
;Eight Label
GUICtrlCreateLabel("", 40, 184, 123, 17)
GUICtrlSetColor(-1, 0xFF00FF)
;Ninth Label
GUICtrlCreateLabel("", 104, 120, 84, 21)
GUICtrlSetFont(-1, 12, 400, 0, "OCR A Extended")
GUICtrlSetColor(-1, 0xFF00FF)
;Close Button
GUICtrlCreateButton("Close", 80, 208, 105, 25)
GUICtrlSetFont(-1, 12, 400, 0, "OCR A Extended")
GUICtrlSetColor(-1, 0xFF00FF)
GUICtrlSetBkColor(-1, 0x00FFFF)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
EndFunc
While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
Edited by Raskus

Share this post


Link to post
Share on other sites
Raskus

Instead of being rude why don't you state which rule was broken like a competent adult?

I need help with a Button. This is the GUI section isn't it?

Share this post


Link to post
Share on other sites
monoscout999

@AdmiralAlkex BOT is not a dirty word

@Raskus What is this script for?

Share this post


Link to post
Share on other sites
Raskus

It's for an interactive GUI I'm working on. Basically I have the cosmetic part finished. I have the Main GUI window with two buttons each which I would like to open their respective boxes that have labels on them. They also have buttons to close them but I can't figure out how to get buttons to work at all. I've looked around the forums, on youtube, even on sketchy hacking sites and haven't been able to get it to work.

Share this post


Link to post
Share on other sites
monoscout999

Take your time to read this and study a little, play with the examples to learn more.

http://www.autoitscript.com/wiki/Managing_Multiple_GUIs

Share this post


Link to post
Share on other sites
Valik

Instead of being rude why don't you state which rule was broken like a competent adult?

You are in no position to adjudicate whether or not someone is being rude. Especially when you are rude to the user by insinuating he is not a competent adult. New users are not given the benefit of the doubt any longer. History has shown that almost every time somebody uses the word "bot" on this forum they are attempting to automate a game.

So far I see no reason to close this thread nor do I see any rule being violated - yet.

Share this post


Link to post
Share on other sites
Raskus

Not getting into a flame war. My problem was solved, thank you again monoscout. No thanks to the people bumping with no intention of providing help in a HELP FORUM.

Share this post


Link to post
Share on other sites
monoscout999

Not getting into a flame war. My problem was solved, thank you again monoscout. No thanks to the people bumping with no intention of providing help in a HELP FORUM.

maybe you need to know better the forum before judge it that way...

Share this post


Link to post
Share on other sites
Valik

Not getting into a flame war. My problem was solved, thank you again monoscout. No thanks to the people bumping with no intention of providing help in a HELP FORUM.

I don't particularly like this remark. I like it so little, in fact, that you can think about why you said it for the next week. You're being highly critical of a user we feel well enough about to promote to a role of distinction. You may or may not be referring to me as well since you explicitly state "people" which means "more than one person". Given that only 3 people responded to this thread and one of them very clearly helped you with your problem I must by default be included in the group that didn't help you. But I can't possible be in that group, either, since I sort of helped make the language and have therefore fulfilled my "help" quota for life.

At any rate. I strongly suggest you lose your attitude if and when you decide to return to this forum. You're currently on forced 7 day sabbatical. Use it wisely.

Edit: Forgot to mention, if you think about PMing me to argue... don't. You will lose and will be blocked permanently.

Edited by Valik

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.