Vision Posted December 15, 2006 Share Posted December 15, 2006 hi guys, is it possible to say autoit, that they must wait so long as for exsample pos x 49 y 538 under the mousepointer the pixecolor is hex= 0x37C78C / Dec. 3655564 ??? an if this pixel color is unter the mouse pointer that he go to next $var ? if not he so long wait till the color is unter the mousepointer ? sorry for my bad english..... regards Link to comment Share on other sites More sharing options...
jaenster Posted December 15, 2006 Share Posted December 15, 2006 (edited) $var = pixelgetcolor(mousegetpos(0),mousegetpos(1))oÝ÷ Ù8^*.ëmç(â×Z+ajëh×6$var = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6)oÝ÷ Ù.®¶¡{(è~+@Ê,yæ®Þ)ß¡ì^زëÊ)h¢G¢yr~íëh¦''jg*.Á©íÁ¨N§jëh×6 $color = 0x000000 while 1 if $color = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6) then exitloop wend ;The script comes here if the color is under mouse. Edit 2 : Fixed auto tags Edited December 15, 2006 by jaenster -jaenster Link to comment Share on other sites More sharing options...
Vision Posted December 15, 2006 Author Share Posted December 15, 2006 (edited) hmm it donot work, i have some mouse action and than my litle script click on a button, than the scipt must waiting till under the mouse is a specail color.... than they do the next line in the script... i ll post it here.... CODE; <AUT2EXE VERSION: 3.2.0.1> HotKeySet("^!x", "Exitapp") HotKeySet("^!p", "Apppause") Sleep(5000) MouseClickDrag("left", 72, 553, 609, 771 ) ;Markierung 1 Sleep(1000) MouseClick("right", 609, 771 , 1 ) ;Rechtsklick Kontextmenü Sleep(1000) MouseClick( "left", 641, 787 , 1 ) ; "Kopieren" Sleep(1000) MouseClick( "left", 390, 856 , 1 ) ;Zum Txt Dokument als Zweiter Tab in der Windowsleiste wechseln Sleep(1000) MouseClick( "right", 390, 750 , 1 ) ;Rechtsklick Kontextmenü Sleep(1000) MouseClick( "left", 418, 828 , 1 ) ;"Einfügen" Sleep(1000) MouseClick( "left", 223, 856 , 1 ) ;Zum Broweser mit dem Email-Verzeichnis in der Windowsleiste als erste pos. wechseln Sleep(1000) MouseClick( "left", 1432, 804 , 45 ) ;30 x den Scrollbutton drucken um nach unten zu scrollen Sleep(1000) ;------------------------------------------------------------------------------------------------------------------------------------------------ MouseClickDrag("left", 72, 160, 612, 690 ) ; Markierung 2 Sleep(1000) MouseClick("right", 612, 690 , 1 ) ;Rechtsklick Kontextmenü Sleep(1000) MouseClick("left", 649, 704 , 1 ) ; "Kopieren" Sleep(1000) MouseClick("left", 390, 856 , 1 ) ;Zum Txt Dokument als Zweiter Tab in der Windowsleiste wechseln Sleep(1000) MouseClick("right", 390, 750 , 1 ) ;Rechtsklick Kontextmenü Sleep(1000) MouseClick("left", 418, 828 , 1 ) ;"Einfügen" Sleep(1000) MouseClick("left", 223, 856 , 1 ) ;Zum Broweser mit dem Email-Verzeichnis in der Windowsleiste als erste pos. wechseln Sleep(1000) MouseClick("left", 80, 719 , 1 ) ;Eine Seite vorblättern Sleep(2500) MouseClick("left", 50, 625 , 1 ) ;Maus zur pixel überprüfungs position bewegen ######### Here it goes to the position where it wait till the color is under the mouse ########## Sleep(1000) $color = 0x37C78C ; i changed the Color HEX while 1 if $color = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6) then exitloop wend ;Script nach pixelüberprüfung ;-------------------------------------------- SEITE 1 ------------------------------- LOOP AB NÄCHSTER ZEILE FÜR DIE FOLGENDEN SEITEN ---------------- $abc = 48 while 1 If $abc > 100 Then ExitLoop Sleep(1000) MouseClickDrag("left", 72, 575, 611, 793 ) ;Markierung 1 Sleep(1000) MouseClick("right", 611, 793 , 1 ) ;Rechtsklick Kontextmenü Sleep(1000) MouseClick("left", 645, 809 , 1 ) ; "Kopieren" Sleep(1000) MouseClick("left", 390, 856 , 1 ) ;Zum Txt Dokument als Zweiter Tab in der Windowsleiste wechseln Sleep(1000) Send ("{ENTER}") Send ("{SPACE}") ;1 ----- Send ("{SPACE}") ;2 \ Send ("{SPACE}") ;3 ---- Send ("{SPACE}") ;4 = Abstand in der TXT Send ("{SPACE}") ;5 / Send ("{SPACE}") ;6 ---- Send ("{SPACE}") ;7 / Send ("{SPACE}") ;8 ----- Sleep(1000) MouseClick("right", 390, 750 , 1 ) ;Rechtsklick Kontextmenü Sleep(1000) MouseClick("left", 418, 828 , 1 ) ;"Einfügen" Sleep(1000) MouseClick("left", 223, 856 , 1 ) ;Zum Broweser mit dem Email-Verzeichnis in der Windowsleiste als erste pos. wechseln Sleep(1000) MouseClick("left", 1432, 804 , 30 ) ;30 x den Scrollbutton drucken um nach unten zu scrollen Sleep(1000) ;------------------------------------------------------------------------------------------------------------------------------------------------ MouseClickDrag("left", 72, 139, 610, 680 ) ; Markierung 2 Sleep(1000) MouseClick("right", 610, 680 , 1 ) ;Rechtsklick Kontextmenü Sleep(1000) MouseClick("left", 653, 694 , 1 ) ; "Kopieren" Sleep(1000) MouseClick("left", 390, 856 , 1 ) ;Zum Txt Dokument als Zweiter Tab in der Windowsleiste wechseln Sleep(1000) Send ("{ENTER}") Send ("{SPACE}") ;1 ----- Send ("{SPACE}") ;2 \ Send ("{SPACE}") ;3 ---- Send ("{SPACE}") ;4 = Abstand in der TXT Send ("{SPACE}") ;5 / Send ("{SPACE}") ;6 ---- Send ("{SPACE}") ;7 / Send ("{SPACE}") ;8 ----- Sleep(500) MouseClick("right", 390, 750 , 1 ) ;Rechtsklick Kontextmenü Sleep(1000) MouseClick("left", 403, 828 , 1 ) ;"Einfügen" Sleep(1000) MouseClick("left", 223, 856 , 1 ) ;Zum Broweser mit dem Email-Verzeichnis in der Windowsleiste als erste pos. wechseln Sleep(1000) MouseClick("left", 90, 687 , 1 ) ;Eine Seite vorblättern Sleep(2500) MouseClick("left", 50, 625 , 1 ) ;Maus zur pixel überprüfungs position bewege ######### Here it goes to the position where it wait till the color is under the mouse ########## Sleep(1000) $color = 0x37C78C while 1 if $color = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6) then exitloop wend ;The script comes here if the color is under mouse. $abc = $abc + 1 wend Func Exitapp() Exit EndFunc Func Apppause() Sleep(20000) EndFunc there is a second way : so long like the script must waiting till the app is ready the mouse cursor is in status "WAITING" when the app is ready it changes to normal so its possible to say Wait till Mouse cursor changeing into normal an thann go next ...? Edited December 15, 2006 by Vision Link to comment Share on other sites More sharing options...
NeoFoX Posted December 15, 2006 Share Posted December 15, 2006 Try this... Replace:$color = 0x37C78C while 1 if $color = hex(pixelgetcolor(mousegetpos(0),mousegetpos(1)),6) then exitloop wendoÝ÷ Û«¢+Ù¼(ÀÌØí½±½Èô¡à¡Á¥á±Ñ½±½È¡µ½ÕÍÑÁ½Ì À¤±µ½ÕÍÑÁ½Ì Ĥ¤°Ø¤)չѥ°ÀÌØí½±½ÈôÁàÌÝÜá Neo [center][font="Arial"]--- The Neo and Only --- [/font][font="Arial"]--Projects---[/font]Image to Text converterText to ASCII converter[/center] Link to comment Share on other sites More sharing options...
Vision Posted December 15, 2006 Author Share Posted December 15, 2006 hmm nothing happens... is there not missing an comand what they must do after the color is right ? Link to comment Share on other sites More sharing options...
jaenster Posted December 15, 2006 Share Posted December 15, 2006 are you sure you ahve the good color :| al the 2 metoheds working. -jaenster Link to comment Share on other sites More sharing options...
Vision Posted December 15, 2006 Author Share Posted December 15, 2006 this is the button he must wait for: Link to comment Share on other sites More sharing options...
Vision Posted December 15, 2006 Author Share Posted December 15, 2006 At the last mouse move he goes to the positon where the button ist (when the app is ready) an if this button is loaded ( this green) than they go to next mouse move... but he do nothing the mouse stay over the button ... Link to comment Share on other sites More sharing options...
Vision Posted December 15, 2006 Author Share Posted December 15, 2006 (edited) hm it not works i dont know.... so what would be the code for: if MouseGetCursor (WAIT(15)) do nothing if MouseGetCursor change to (ARROW(2)) Movemouse (x,y) ? soory for double post but i can edit my replys O.o thanks much for this all Edited December 15, 2006 by Vision Link to comment Share on other sites More sharing options...
Vision Posted December 15, 2006 Author Share Posted December 15, 2006 CODEsleep(2000) $cursor = MouseGetCursor() $turn1 = 1 While 1 If $cursor = 1 Then $turn1 = $turn1 + 1 Else Sleep(2000) MouseClick("left", 50, 625 , 1 ) EndIf wend this what i am thinking but it not works, i think he not detect the cursor state corect... can any give me a tipp whats wrong Link to comment Share on other sites More sharing options...
mikehunt114 Posted December 15, 2006 Share Posted December 15, 2006 Is the cursor changing during the process? You started the topic by asking about color changes, yet the last post you made is checking the status of the cursor? Is your mouse over the coordinates you are checking? Please explain further, you are not clearly communicating what you are doing. As already hinted at in this topic, to check the position for color: ;beginning part of your script While 1 ;enable a never-ending loop to check for the coordinates for a "loaded" color $color = Hex(PixelGetColor($x, $y)) ;the co-ordinates of the "button" to check for the green color If $color = $desiredcolor Then ExitLoop ;If the color is matched, exit the loop and continue on with the script sleep(10) WEnd ;move on to the next task here IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
Vision Posted December 15, 2006 Author Share Posted December 15, 2006 so i try it... my script is an clicking aktion for a program so it beginns to click, and when my script open the next side it takes sommetime from 10 sec to 3 mins this i would to manage whith the pixelcolor so when the next site is loaded and on position 50, 602 ( the green button) is there it goes into the next mouse move aktions if not they wait till the button, or the color what ever is there but at the moment : the script dont wait it waits 2 secs and go to next mouse aktions but the side is not loeadet here the aktually script in .au3 file Link to comment Share on other sites More sharing options...
crzftx Posted December 15, 2006 Share Posted December 15, 2006 (edited) My turn to try! Original code: While 1 ;enable a never-ending loop to check for the coordinates for a "loaded" color $color = Hex(PixelGetColor(50, 602)) ;the co-ordinates of the "button" to check for the green color If $color = 0x37C78C Then ExitLoop ;If the color is matched, exit the loop and continue on with the script sleep(10) wend Edited December 15, 2006 by crzftx Link to comment Share on other sites More sharing options...
Vision Posted December 16, 2006 Author Share Posted December 16, 2006 so thanks to all i have add this after i get crazy ^^ WinActivate("TiTLE") an zaaaaaaap it works fine with Do sleep(10) Pixelsearch(45,592,55,612,0x37C78C,5) Until Not @error = 1 Thanks much too all !!!! i go to bed now, enough irritated Link to comment Share on other sites More sharing options...
FreeFry Posted December 21, 2006 Share Posted December 21, 2006 Offtopic: From a performance point of view, isn't PixelGetColor(MouseGetPos(0), MouseGetPos(1)) oÝ÷ ÚÉhÁêí©ÚºÚ"µÍÌÍÔÜÈH[ÝÙQÙ]ÜÊ B^[Ù]ÛÛÜ ÌÍÔÜÖÌK ÌÍÔÜÖÌWJB ? 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