BB4e Posted June 20, 2009 Posted June 20, 2009 hello people i want a window with buttons and when i click one button xy happens and if i klick one more time it happens again. but just with a click.
Yashied Posted June 20, 2009 Posted June 20, 2009 hello peoplei want a window with buttons and when i click one button xy happensand if i klick one more time it happens again. but just with a click.Let's look at your code. OK? My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
BB4e Posted June 20, 2009 Author Posted June 20, 2009 (edited) ok ma code is this far but when i klicked one button and want to click it one more time it does nothing. first klick works #include <GuiConstantsEx.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <GuiEdit.au3> GUICreate("loginbot", 150, 100) $1=guictrlcreatebutton("CH1", 0, 0, 30) $2=guictrlcreatebutton("CH2", 30, 0, 30) $3=guictrlcreatebutton("CH3", 60, 0, 30) $4=guictrlcreatebutton("CH4", 90, 0, 30) $5=guictrlcreatebutton("CH5", 120, 0, 30) GUICtrlCreateLabel("ID:", 10, 34) GUICtrlCreateLabel("PW:", 10, 64) $id=GuiCtrlCreateInput("", 40, 30, 100) $pw=GuiCtrlCreateInput("", 40, 60, 100, 25, $ES_PASSWORD) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $1 $ID=GUICtrlRead($id, 1) $PW=GUICtrlRead($pw, 1) Dim $pixel = PixelGetColor(266,292) MouseMove(700,590) MouseClick("left") MouseClick("left") Sleep(500) MouseMove(930,570) MouseClick("left") MouseMove(960,880) MouseClick("left") Send($ID) Send("{TAB}") Send($PW) Send("{enter}") Do sleep(500) $pixel = PixelGetColor(266,292) Until hex($pixel) = 00400504 MouseMove(230,640) MouseClick("left") Case $msg[0] = $2 $ID=GUICtrlRead($id, 1) $PW=GUICtrlRead($pw, 1) Dim $pixel = PixelGetColor(266,292) MouseMove(700,590) MouseClick("left") MouseClick("left") Sleep(500) MouseMove(930,588) MouseClick("left") MouseMove(960,880) MouseClick("left") Send($ID) Send("{TAB}") Send($PW) Send("{enter}") Do sleep(500) $pixel = PixelGetColor(266,292) Until hex($pixel) = 00400504 MouseMove(230,640) MouseClick("left") Case $msg[0] = $3 $ID=GUICtrlRead($id, 1) $PW=GUICtrlRead($pw, 1) Dim $pixel = PixelGetColor(266,292) MouseMove(700,590) MouseClick("left") MouseClick("left") Sleep(500) MouseMove(930,605) MouseClick("left") MouseMove(960,880) MouseClick("left") Send($ID) Send("{TAB}") Send($PW) Send("{enter}") Do sleep(500) $pixel = PixelGetColor(266,292) Until hex($pixel) = 00400504 MouseMove(230,640) MouseClick("left") Case $msg[0] = $4 $ID=GUICtrlRead($id, 1) $PW=GUICtrlRead($pw, 1) Dim $pixel = PixelGetColor(266,292) MouseMove(700,590) MouseClick("left") MouseClick("left") Sleep(500) MouseMove(930,621) MouseClick("left") MouseMove(960,880) MouseClick("left") Send($ID) Send("{TAB}") Send($PW) Send("{enter}") Do sleep(500) $pixel = PixelGetColor(266,292) Until hex($pixel) = 00400504 MouseMove(230,640) MouseClick("left") Case $msg[0] = $5 $ID=GUICtrlRead($id, 1) $PW=GUICtrlRead($pw, 1) Dim $pixel = PixelGetColor(266,292) MouseMove(700,590) MouseClick("left") MouseClick("left") Sleep(500) MouseMove(930,638) MouseClick("left") MouseMove(960,880) MouseClick("left") Send($ID) Send("{TAB}") Send($PW) Send("{enter}") Do sleep(500) $pixel = PixelGetColor(266,292) Until hex($pixel) = 00400504 MouseMove(230,640) MouseClick("left") Case $msg[0] = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Edited June 20, 2009 by BB4e
Yashied Posted June 20, 2009 Posted June 20, 2009 Do Sleep(500) $pixel = PixelGetColor(266, 292) Until Hex($pixel) = 00400504Look closely at this loop. External loop will not work until you finish this loop, ie until Hex($pixel) is not equal to "00400504". My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
BB4e Posted June 20, 2009 Author Posted June 20, 2009 this loop works fine. it deos not klick before the pixel has not this color but ich ihave done this procudure 1 time it works not a second time
Yashied Posted June 20, 2009 Posted June 20, 2009 expandcollapse popup#include <GuiConstantsEx.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <GuiEdit.au3> GUICreate("loginbot", 150, 100) $1 = GUICtrlCreateButton("CH1", 0, 0, 30) $2 = GUICtrlCreateButton("CH2", 30, 0, 30) $3 = GUICtrlCreateButton("CH3", 60, 0, 30) $4 = GUICtrlCreateButton("CH4", 90, 0, 30) $5 = GUICtrlCreateButton("CH5", 120, 0, 30) GUICtrlCreateLabel("ID:", 10, 34) GUICtrlCreateLabel("PW:", 10, 64) $id = GUICtrlCreateInput("", 40, 30, 100) $pw = GUICtrlCreateInput("", 40, 60, 100, 25, $ES_PASSWORD) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $1 ConsoleWrite('1' & @CR) Case $msg[0] = $2 ConsoleWrite('2' & @CR) Case $msg[0] = $3 ConsoleWrite('3' & @CR) Case $msg[0] = $4 ConsoleWrite('4' & @CR) Case $msg[0] = $5 ConsoleWrite('5' & @CR) Case $msg[0] = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Everything works. ??? My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
martin Posted June 20, 2009 Posted June 20, 2009 no it does nothing but thx Yashied wants to know what you get if you run the script he posted and you click a button. Do you get a message printed? If you are not using SciTE then maybe you wouldn't see the console output lines so change those lines like this instead of ConsoleWrite('1' & @CR) write MsgBox(262144,"Stage",1) Then, if you get a message box for each button, simply add the MsgBox lines after your loops like this Do Sleep(500) $pixel = PixelGetColor(266, 292) Until Hex($pixel) = 00400504 MsgBox(262144,"Stage",1);or 2 or 3 etc so you can be sure your script gets past them because Yashied suspects that you script is could be stuck in those loops. I think he is correct but it just needs you to add some debugging code as described above to test it. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
BB4e Posted June 22, 2009 Author Posted June 22, 2009 im totally sure it gets through the loops, because when i click first time it works. but if i wannt to click on more time it does not again.
martin Posted June 22, 2009 Posted June 22, 2009 (edited) im totally sure it gets through the loops, because when i click first time it works.but if i wannt to click on more time it does not again.I do understand. You have made a post asking for help, but natuarally when someone suggests something that might find out what's wrong you don't want to do it because ... er..because um. Why did you post again? EDIT.Or look at it this way."Why doesn't this match light? I know it's ok because it worked the first time." Edited June 22, 2009 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
BB4e Posted June 22, 2009 Author Posted June 22, 2009 (edited) ive got 2 problems beside my script. 1. i don't understand english very good and do not allwys know what youre saying. 2. im not very good in scite but im trying to make a script and dont know what i should do when you tell me sth. now for understanding what you meamt i should do. you think it does not get through this loop Do Sleep(500) $pixel = PixelGetColor(266, 292) Until Hex($pixel) = 00400504 Edited June 22, 2009 by BB4e
BB4e Posted June 22, 2009 Author Posted June 22, 2009 ok i understood what you meant. it does get stuck in the loop. i tested im sorry if i made you angry.
martin Posted June 22, 2009 Posted June 22, 2009 ok i understood what you meant.it does get stuck in the loop. i testedim sorry if i made you angry.No, I wasn't angry, I just couldn't work out your logic.Have you solved the problem now? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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