Webcreation Posted September 30, 2014 Share Posted September 30, 2014 So i made a GUI, and i said case $button1 ,exit. But instead of exiting the GUI it doesnt respond at all.. Please help! thanks in advance! #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("THIS IS THE INSTRUCTION SCREEN", 748, 539, 299, 102) $Pic1 = GUICtrlCreatePic("C:\Users\Sabbih\Desktop\website\Setupscreen2.jpg", -17, 0, 764, 556) $Button1 = GUICtrlCreateButton("Start VanityBot!", 271, 432, 193, 41) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Exit EndSwitch WEnd Also, i have a picture inserted into this GUI. So if i give this script in .exe form to another person by download. Will he see the same image or not? THANKS! Link to comment Share on other sites More sharing options...
Webcreation Posted September 30, 2014 Author Share Posted September 30, 2014 Sorry for the dubble post! How can i make it so that, when the button is pressed it will continu to the main part of the script? Much love & appriciation! Link to comment Share on other sites More sharing options...
Gianni Posted September 30, 2014 Share Posted September 30, 2014 insert GUICtrlSetState(-1, $GUI_DISABLE) right after $Pic1 = GUICtrlCreatePic("C:UsersSabbihDesktopwebsiteSetupscreen2.jpg", -17, 0, 764, 556) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
JohnOne Posted September 30, 2014 Share Posted September 30, 2014 Sorry for the dubble post! How can i make it so that, when the button is pressed it will continu to the main part of the script? What is the "main part of the script"? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Webcreation Posted September 30, 2014 Author Share Posted September 30, 2014 expandcollapse popupwhile 1 Call("petswap") Call("round1") Call("round1") Call("round1") ;last middle enter rounds after this Call("round1") Call("round1") Call("clearInv") Call("round1") Call("round1") Call("petswap2") Call("round1") Call("round1") Call("round1") ;last middle enter rounds after this Call("clearInv") ;3rd petswap Call("round1") Call("round1") Call("petswap3") Call("round1") Call("round1") Call("round1") Call("round1") ;last middle enter rounds after this Call("clearInv") WEnd Something like this, and hey john thanks for last time! And Chimp, this is to make the GUI exit when pressing the button right? Link to comment Share on other sites More sharing options...
JohnOne Posted September 30, 2014 Share Posted September 30, 2014 expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("THIS IS THE INSTRUCTION SCREEN", 748, 539, 299, 102) $Pic1 = GUICtrlCreatePic("C:\Users\Sabbih\Desktop\website\Setupscreen2.jpg", -17, 0, 764, 556) $Button1 = GUICtrlCreateButton("Start VanityBot!", 271, 432, 193, 41) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _Func() EndSwitch WEnd Func _Func() While 1 Call("petswap") Call("round1") Call("round1") Call("round1") ;last middle enter rounds after this Call("round1") Call("round1") Call("clearInv") Call("round1") Call("round1") Call("petswap2") Call("round1") Call("round1") Call("round1") ;last middle enter rounds after this Call("clearInv") ;3rd petswap Call("round1") Call("round1") Call("petswap3") Call("round1") Call("round1") Call("round1") Call("round1") ;last middle enter rounds after this Call("clearInv") WEnd EndFunc ;==>_Func AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Webcreation Posted September 30, 2014 Author Share Posted September 30, 2014 (edited) So after putting this to test it, i noticed that the button doesnt even get pushed in. Its just an image it seems, and is not responding when i click on it. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("THIS IS THE INSTRUCTION SCREEN", 748, 539, 299, 102) $Pic1 = GUICtrlCreatePic("C:\Users\Sabbih\Desktop\website\Setupscreen2.jpg", -17, 0, 764, 556) $Button1 = GUICtrlCreateButton("Start VanityBot!", 271, 432, 193, 41) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 _test () EndSwitch WEnd Func _test () MsgBox( 0,"hi", "test") EndFunc Edited September 30, 2014 by Webcreation Link to comment Share on other sites More sharing options...
JohnOne Posted September 30, 2014 Share Posted September 30, 2014 Works just fine. I have absolutely no idea why a button would not work. Well, one. There is tons more code in your script you are not showing where the code is stuck. If the above code on it's own does not show the message box, your computer has big problems. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Webcreation Posted September 30, 2014 Author Share Posted September 30, 2014 I am making the GUI seperate from the main script so that i would know it works 100%... Im guessing my PC has big problems then. I will try more before coming back. Thanks for the help. Link to comment Share on other sites More sharing options...
Solution JohnOne Posted September 30, 2014 Solution Share Posted September 30, 2014 Start with a reboot if that MsgBox does not show. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Webcreation Posted September 30, 2014 Author Share Posted September 30, 2014 Did, but still didnt work. I think something else went wrong in that particular script. Because i tried this code in a new .au3 and it worked first try! Thank you John this is solved. So if i let the button do an Exit, it will exit script.. but i just want it to exit the GUI and continu script. Do you know what i should put Link to comment Share on other sites More sharing options...
JohnOne Posted September 30, 2014 Share Posted September 30, 2014 If you just want to break out of the while loop, ExitLoop. But that will not destroy your gui, for that you will need GuiDelete AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Gianni Posted October 1, 2014 Share Posted October 1, 2014 ...Something like this, and hey john thanks for last time! And Chimp, this is to make the GUI exit when pressing the button right? yes, right So after putting this to test it, i noticed that the button doesnt even get pushed in. Its just an image it seems, and is not responding when i click on it. read the help for the GUICtrlCreatePic command where you can found this phrase: "If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control and create it after the others controls: GuiCtrlSetState(-1,$GUI_DISABLE)." Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now