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