wittenberg Posted April 28, 2009 Share Posted April 28, 2009 hellohow i can code it that i want when the button is unpressed program should make a mousemove, click etc......pixelsearch dont workhave someone a solution? Link to comment Share on other sites More sharing options...
KaFu Posted April 28, 2009 Share Posted April 28, 2009 Use AU3Info tool to obtain control info. Check controls state with ControlCommand(), command = "IsEnabled", "" OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
wittenberg Posted April 28, 2009 Author Share Posted April 28, 2009 (edited) Use AU3Info tool to obtain control info.Check controls state with ControlCommand(), command = "IsEnabled", ""ty im using it i will try it with ControlCommand() Edited April 28, 2009 by wittenberg Link to comment Share on other sites More sharing options...
wittenberg Posted April 28, 2009 Author Share Posted April 28, 2009 (edited) ok i try this here but it cant see if is checked CODEWinActivate("Checker v1.0.3") WinWaitActive("Checker v1.0.3") ControlFocus("Checker v1.0.3", "", "TButton3") If(ControlCommand( "Checker v1.0.3", "", "[CLASS:TButton; INSTANCE:3]", "IsChecked", "") == 1) Then MsgBox(0, "", "one is checked") ElseIf(ControlCommand( "Checker v1.0.3", "", "[CLASS:TButton; INSTANCE:3]", "IsChecked", "") == 0) Then MsgBox(0, "", "one is NOT checked") Else MsgBox(0,"",ControlCommand( "Checker v1.0.3", "", "TButton3", "IsChecked", "")) EndIf have it with isenable Edited April 28, 2009 by wittenberg Link to comment Share on other sites More sharing options...
wittenberg Posted April 28, 2009 Author Share Posted April 28, 2009 (edited) how i could write it should wait for isenable = 1 for example software is running and isenable is = 0 then i activate my au3 file but it dont work then if the button switch to isenable = 1 CODE $start = ControlCommand( "Checker v1.0.3", "", "[CLASS:TButton; INSTANCE:3]", "IsEnabled", "") $red = PixelSearch( 727, 57, 780, 65, 0xff0000 ) $black = PixelSearch( 727, 57, 780, 65, 0xffff00 ) $rred = PixelSearch(897, 106, 897, 106, 0x000000 ) while 1 if $start = true AND $red = True Then MsgBox(0, "", "rot") ElseIf $start = true AND $black = true Then MsgBox(0, "", "schwarz") EndIf Wend Edited April 28, 2009 by wittenberg Link to comment Share on other sites More sharing options...
wittenberg Posted April 29, 2009 Author Share Posted April 29, 2009 can someone help me? Link to comment Share on other sites More sharing options...
KaFu Posted April 29, 2009 Share Posted April 29, 2009 While 1 $start = ControlCommand("Checker v1.0.3", "", "[CLASS:TButton; INSTANCE:3]", "IsEnabled", "") $red = PixelSearch(727, 57, 780, 65, 0xff0000) $black = PixelSearch(727, 57, 780, 65, 0xffff00) ; < 0xffff00 = yellow $rred = PixelSearch(897, 106, 897, 106, 0x000000) ; < 0x000000 = black If $start = True And $red = True Then MsgBox(0, "", "rot") ElseIf $start = True And $black = True Then MsgBox(0, "", "schwarz") EndIf WEnd OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
wittenberg Posted April 29, 2009 Author Share Posted April 29, 2009 While 1 $start = ControlCommand("Checker v1.0.3", "", "[CLASS:TButton; INSTANCE:3]", "IsEnabled", "") $red = PixelSearch(727, 57, 780, 65, 0xff0000) $black = PixelSearch(727, 57, 780, 65, 0xffff00) ; < 0xffff00 = yellow $rred = PixelSearch(897, 106, 897, 106, 0x000000) ; < 0x000000 = black If $start = True And $red = True Then MsgBox(0, "", "rot") ElseIf $start = True And $black = True Then MsgBox(0, "", "schwarz") EndIf WEndthanks dude it works can i make an if in a if? like in c++ Link to comment Share on other sites More sharing options...
KaFu Posted April 29, 2009 Share Posted April 29, 2009 Yep, not problem to nest statements. $a = True $b = True $c = True while 1 $a = not $a $b = not $a $c = not $b if $a Then ConsoleWrite("a" & @crlf) if $c then ConsoleWrite("c" & @crlf) endif endif if $b Then ConsoleWrite("b" & @crlf) if $c then ConsoleWrite("c" & @crlf) endif endif wend OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
wittenberg Posted April 30, 2009 Author Share Posted April 30, 2009 (edited) i tried out but dont works it only checks red and dont work if is black expandcollapse popup$red = PixelSearch( 727, 57, 780, 65, 0xff0000 ) $black = PixelSearch( 727, 57, 780, 65, 0xffff00 ) $rred = PixelSearch(897, 106, 897, 106, 0x000000 ) while 1 WinMove("Checker v1.0.3", "", 850, 50) $start = ControlCommand( "Checker v1.0.3", "", "[CLASS:TButton; INSTANCE:3]", "IsEnabled", "") if $start = true AND $red = True Then MouseClick("left",350,400,1) sleep(1000) MouseClick("left",190,430,1) sleep(20000) if $start = true AND $red = True Then MouseClick("left",350,400,2) sleep(1000) MouseClick("left",190,430,1) sleep(1000) ElseIf $start = true AND $black = True Then MouseClick("left",887,104,1) EndIf Sleep(1000) MouseClick("left",887,104,1) ElseIf $start = true AND $black= true Then MouseClick("left",410,440,1) Sleep(1000) MouseClick("left",190,430,1) sleep(20000) If $start = true AND $black = true Then MouseClick("left",410,440,2) Sleep(1000) MouseClick("left",190,430,1) sleep(1000) ElseIf $start = true AND $red = true MouseClick("left",887,104,1) EndIf MouseClick("left",887,104,1) EndIf Wend Edited April 30, 2009 by wittenberg Link to comment Share on other sites More sharing options...
KaFu Posted April 30, 2009 Share Posted April 30, 2009 (edited) While 1 $black = PixelSearch(727, 57, 780, 65, 0xffff00) ; < 0xffff00 = yellow $rred = PixelSearch(897, 106, 897, 106, 0x000000) ; < 0x000000 = black Your color codes are wrong, use COP to determine the right values and additionally I guess the PixelSearch() should be within the loop, or else the search will only be performed one time! Edited April 30, 2009 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
wittenberg Posted April 30, 2009 Author Share Posted April 30, 2009 Your color codes are wrong, use COP to determine the right values and additionally I guess the PixelSearch() should be within the loop, or else the search will only be performed one time!no thats ok it should be and rred dont needok i try pixelsearch within the loop 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