cainn82 Posted April 25, 2008 Posted April 25, 2008 I am trying to get a value assigned to button 2 basicly when they hit button 2 I want ti to load my addor window and its not working please show me what i am doing wrong so i can learn thank you. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.10.0 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 599, 194, 102) GUISetBkColor(0x808000) $Label1 = GUICtrlCreateLabel("Bot welcome greeting", 8, 64, 106, 17) $Insert = GUICtrlCreateInput("Insert bot greeting here", 128, 64, 497, 21) $Label2 = GUICtrlCreateLabel("Bot Goodbye Greeting", 8, 96, 109, 17) $Input1 = GUICtrlCreateInput("Insert your bot goodbye Greeting", 128, 96, 497, 21) $Save = GUICtrlCreateButton("Save", 320, 544, 75, 25, 0) $Group1 = GUICtrlCreateGroup("Account Settings", 0, 288, 305, 145) $Label3 = GUICtrlCreateLabel("Username", 24, 344, 52, 17) $Input2 = GUICtrlCreateInput("Insert username", 96, 344, 145, 21) $password = GUICtrlCreateLabel("password", 24, 368, 49, 17) GUICtrlCreateInput("Insert Password", 96, 368, 145, 21) $Account = GUICtrlCreateLabel("Account", 16, 312, 44, 17) $Label4 = GUICtrlCreateLabel("Password will show up as stars", 96, 400, 149, 17) $Radio9 = GUICtrlCreateRadio("Auto login", 152, 312, 137, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label5 = GUICtrlCreateLabel("Serial number", 328, 504, 68, 17) $Input4 = GUICtrlCreateInput("", 416, 504, 201, 21) $Group2 = GUICtrlCreateGroup("Buy Sell options", 312, 392, 305, 105) $Radio1 = GUICtrlCreateRadio("Sell", 328, 416, 113, 17) $Radio2 = GUICtrlCreateRadio("Buy", 328, 432, 113, 17) $Radio3 = GUICtrlCreateRadio("Buy and Sell", 328, 448, 113, 17) $Radio4 = GUICtrlCreateRadio("Singles", 480, 424, 113, 17) $Radio5 = GUICtrlCreateRadio("Bulk", 480, 440, 113, 17) $Label6 = GUICtrlCreateLabel("Selling mode", 488, 408, 64, 17) $Radio6 = GUICtrlCreateRadio("Add message to classifieds", 320, 472, 153, 17) $Radio7 = GUICtrlCreateRadio("Spam Ticker", 480, 472, 113, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("Update Pircelist", 536, 544, 91, 25, 0) $Group3 = GUICtrlCreateGroup("Bulk Settings", 0, 432, 305, 129) $Label7 = GUICtrlCreateLabel("Bot Takes ", 8, 480, 56, 17) $Input5 = GUICtrlCreateInput("", 72, 480, 25, 21) $Label8 = GUICtrlCreateLabel("Cards and gives", 104, 480, 80, 17) $Input6 = GUICtrlCreateInput("", 200, 480, 33, 21) $Label9 = GUICtrlCreateLabel("Tickets", 248, 480, 39, 17) $Label10 = GUICtrlCreateLabel("Bot Takes", 8, 520, 53, 17) $Input7 = GUICtrlCreateInput("", 72, 520, 25, 21) $Label11 = GUICtrlCreateLabel("Tickets and gives", 104, 520, 88, 17) GUICtrlCreateInput("", 200, 520, 33, 21) $Label16 = GUICtrlCreateLabel("Cards", 248, 520, 31, 17) $Label18 = GUICtrlCreateLabel("This Setting only works if bulk is clicked", 32, 448, 215, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Label12 = GUICtrlCreateLabel("Credit greeting", 8, 128, 72, 17) $Input3 = GUICtrlCreateInput("Hello @visitor you have __ credits saved from last trade.", 128, 128, 497, 21) $Label13 = GUICtrlCreateLabel("Classifed message", 8, 160, 91, 17) $Input8 = GUICtrlCreateInput("Insert the message you want to put in calssifeds", 128, 160, 497, 21) $Label14 = GUICtrlCreateLabel("Ticker room message", 8, 192, 105, 17) $Input9 = GUICtrlCreateInput("Insert ticker room message here", 128, 192, 497, 21) $Label15 = GUICtrlCreateLabel("PM message", 8, 224, 65, 17) $Input10 = GUICtrlCreateInput("Insert PM message here ", 128, 224, 497, 21) $Group4 = GUICtrlCreateGroup("Banned List", 312, 288, 305, 105) $Button2 = GUICtrlCreateButton("Add or Rmove Names From List", 456, 360, 155, 25, 0) $Radio8 = GUICtrlCreateRadio("Enable list", 328, 328, 113, 17) $Label17 = GUICtrlCreateLabel("People who have scammed bot", 328, 304, 153, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button3 = GUICtrlCreateButton("Get Serial", 408, 544, 115, 25, 0) $MenuItem1 = GUICtrlCreateMenu("&File", -1 , 1) $MenuItem3 = GUICtrlCreateMenuItem("Save", $MenuItem1) $MenuItem4 = GUICtrlCreateMenuItem("Load", $MenuItem1) $MenuItem5 = GUICtrlCreateMenuItem("Exit", $MenuItem1) $MenuItem2 = GUICtrlCreateMenu("&about") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MenuItem1 Case $MenuItem2 Case $Insert Case $Input1 Case $Save Case $Input2 Case $Input4 Case $Input5 Case $Input6 Case $Label9 Case $Input7 Case $Input3 Case $Input8 Case $Input9 Case $Input10 EndSwitch WEnd While 1 $nMsg = GUIGetMsg() $buttonstate=GuiCtrlRead($button2) if $nMsg = $GUI_Event_Close then GUICtrlRead("$addor") exit endif WEnd #Region ### START Koda GUI section ### Form=C:\Documents and Settings\steve\My Documents\My Pictures\Form2.kxf $addor = GUICreate("Add or Remove banned list", 413, 298, 303, 219) GUISetBkColor(0x808000) GUICtrlCreateEdit("", 16, 64, 233, 209) $save = GUICtrlCreateButton("save", 272, 248, 75, 25, 0) $Label1 = GUICtrlCreateLabel("Add the persons name to the list and the bot will not trade with them", 16, 32, 322, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
DexterMorgan Posted April 26, 2008 Posted April 26, 2008 (edited) Well you can get rid of this part While 1 $nMsg = GUIGetMsg() $buttonstate=GuiCtrlRead($button2) if $nMsg = $GUI_Event_Close then GUICtrlRead("$addor") exit endif WEnd And Change this While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $MenuItem1 Case $MenuItem2 Case $Insert Case $Input1 Case $Save Case $Input2 Case $Input4 Case $Input5 Case $Input6 Case $Label9 Case $Input7 Case $Input3 Case $Input8 Case $Input9 Case $Input10 EndSwitch WEnd To this [code]While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button2 exitloop Case $MenuItem2 Case $Insert Case $Input1 Case $Save Case $Input2 Case $Input4 Case $Input5 Case $Input6 Case $Label9 Case $Input7 Case $Input3 Case $Input8 Case $Input9 Case $Input10 EndSwitch WEnd That should work.. didnt try it Edited April 26, 2008 by kkKrazy code
cainn82 Posted April 26, 2008 Author Posted April 26, 2008 ok i got the box to pop up like i want but how do you get it to pop up on top of the parent window?
cainn82 Posted April 26, 2008 Author Posted April 26, 2008 here is what i have why is this not working Case $Button2, $addor $data = StringStripWS(GUICtrlRead($addor), 3) WinSetOnTop("$addor-", "", 1) <---------------------this should put the window on top of the parent window right? Case $MenuItem2 Case $Insert Case $Input1 Case $Save Case $Input2 Case $Input4 Case $Input5 Case $Input6 Case $Label9 Case $Input7 Case $Input3 Case $Input8 Case $Input9 Case $Input10 EndSwitch WEnd
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