ashley Posted November 4, 2007 Posted November 4, 2007 how do i click on a color. Free icons for your programs
ashley Posted November 4, 2007 Author Posted November 4, 2007 How about PixelSearch() and MouseClick()i forgoten how to use lol. Free icons for your programs
Nahuel Posted November 4, 2007 Posted November 4, 2007 i forgoten how to use lol.Run(@ProgramFilesDir & "\AutoiT3\AutoIt3Help.exe")
ashley Posted November 4, 2007 Author Posted November 4, 2007 (edited) Run(@ProgramFilesDir & "\AutoiT3\AutoIt3Help.exe") excample would be 100% better please Edited November 4, 2007 by ashley Free icons for your programs
JustinReno Posted November 4, 2007 Posted November 4, 2007 ITS IN THE HELP FILE! EXAMPLES ARE EVERYWHERE!!!
ashley Posted November 4, 2007 Author Posted November 4, 2007 awwww please... Free icons for your programs
Nahuel Posted November 4, 2007 Posted November 4, 2007 excample would be 100% better pleasehahaha, I love it how you edited your post to add 'please' Click on red $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000,10) If Not @error Then MouseClick("left",$coord[0],$coord[1]) EndIf That example is in the help file, but uses MsgBox instead of MouseClick
ashley Posted November 4, 2007 Author Posted November 4, 2007 tryed and failed... $coord = PixelSearch( 0, 0, 50000, 30000, 0xFFFFFF) MouseClick("Left") Free icons for your programs
ashley Posted November 4, 2007 Author Posted November 4, 2007 hahaha, I love it how you edited your post to add 'please' Click on red $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000,10) If Not @error Then MouseClick("left",$coord[0],$coord[1]) EndIf That example is in the help file, but uses MsgBox instead of MouseClick nop, look here all my code(so far) expandcollapse popup#include <GUIConstants.au3> Global $readcolor #Region ### START Koda GUI section ### Form= $Powercutter = GUICreate("Powercutter", 234, 83, 193, 115) $Button1 = GUICtrlCreateButton("Start", 8, 54, 99, 25, 0) $Combo1 = GUICtrlCreateCombo("Please select", 8, 8, 217, 25) Guictrlsetdata($Combo1, "Tree|Oak") $lable = GUICtrlCreateLabel("Status: Still", 115, 54, 99, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $wait = 20; wait 20ms for next progressstep $s = 0; progressbar-saveposition While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Combo1 Case $button1 _run() EndSwitch WEnd Func _run() If GUICtrlRead($Combo1) = "Please Select" then Return $Progress1 = GUICtrlCreateProgress(8, 32, 212, 20) $read = GUICtrlRead($Combo1) GUICtrlSetData($lable, "Status: Setting Tree name as: " & $read) For $i = $s To 100 $s = $i;save the current bar-position to $s $s=0 GUICtrlSetData ($progress1,$i) Sleep($wait) Next Sleep(1000) GUICtrlSetData($lable, "Status: Still") GUICtrlDelete($Progress1) Sleep(1000) $Progress1 = GUICtrlCreateProgress(8, 32, 212, 20) GUICtrlSetData($lable, "Status: Loading tree infomation") For $i = $s To 100 $s = $i;save the current bar-position to $s $s=0 GUICtrlSetData ($progress1,$i) Sleep($wait) Next Sleep(1000) GUICtrlSetData($lable, "Status: Still") GUICtrlDelete($Progress1) Sleep(1000) $Progress1 = GUICtrlCreateProgress(8, 32, 212, 20) GUICtrlSetData($lable, "Status: Loading Anti-Randoms") For $i = $s To 100 $s = $i;save the current bar-position to $s $s=0 GUICtrlSetData ($progress1,$i) Sleep($wait) Next Sleep(1000) GUICtrlSetData($lable, "Status: Failed") GUICtrlDelete($Progress1) Sleep(1000) GUICtrlSetData($lable, "Status: Still") MsgBox(48,"Internal Error","Powerminer has discovered an internal error" & @CRLF & @CRLF & "Code: 002050 Result: 01" & @CRLF & @CRLF & "Powerminer will continue after ok is pressed.") _runpower() EndFunc Func _runpower() GUICtrlSetData($lable, "Status: Running") If $readcolor = GUICtrlRead($Combo1) = "Tree" then $coord = PixelSearch( 0, 0, 20, 300, 0xFF0000,10) EndIf If Not @error Then MouseClick("left",$coord[0],$coord[1]) EndIf GUICtrlSetData($lable, "Status: Finished") EndFunc Free icons for your programs
ashley Posted November 4, 2007 Author Posted November 4, 2007 Hum.. what do you want?for it to click on a color, in a java screen if possible Free icons for your programs
Nahuel Posted November 4, 2007 Posted November 4, 2007 But I already told you how to do it here's another example TrayTip("Click on color", "Move your mouse over the color you want to click and press F10" & @CRLF & "Then press HOME to click and ESC to exit", 3) Global $color HotKeySet("{F10}", "getcolor") HotKeySet("{home}", "click") HotKeySet("{esc}", "quit") While 1 Sleep(100) WEnd Func getcolor() $pos = MouseGetPos() $color = PixelGetColor($pos[0], $pos[1]) EndFunc ;==>getcolor Func click() $coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, $color) If Not @error Then MouseClick("left", $coord[0], $coord[1]) EndIf EndFunc ;==>click Func quit() Exit EndFunc ;==>quit
Nevin Posted November 4, 2007 Posted November 4, 2007 It looks like you're clicking on something, so I don't get what the problem is that you're having. That code isn't working?
ashley Posted November 4, 2007 Author Posted November 4, 2007 But I already told you how to do it here's another example TrayTip("Click on color", "Move your mouse over the color you want to click and press F10" & @CRLF & "Then press HOME to click and ESC to exit", 3) Global $color HotKeySet("{F10}", "getcolor") HotKeySet("{home}", "click") HotKeySet("{esc}", "quit") While 1 Sleep(100) WEnd Func getcolor() $pos = MouseGetPos() $color = PixelGetColor($pos[0], $pos[1]) EndFunc ;==>getcolor Func click() $coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, $color) If Not @error Then MouseClick("left", $coord[0], $coord[1]) EndIf EndFunc ;==>click Func quit() Exit EndFunc ;==>quit ok can u make it so it clicks say purple in MY script. Free icons for your programs
Nahuel Posted November 4, 2007 Posted November 4, 2007 ok can u make it so it clicks say purple in MY script. No, sorry...
Moderators SmOke_N Posted November 4, 2007 Moderators Posted November 4, 2007 Ashley, you've been here plenty of enough time, and have voiced your opinion openly for others to know how you feel about what they do or how they do it. So allow me to return the favor. This is a "childs" function to learn, if you can't learn how to implement it into your script to do what you want without others writing it for you... maybe you should take up another hobby other than AutoIt. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
ashley Posted November 4, 2007 Author Posted November 4, 2007 Ashley, you've been here plenty of enough time, and have voiced your opinion openly for others to know how you feel about what they do or how they do it.So allow me to return the favor. This is a "childs" function to learn, if you can't learn how to implement it into your script to do what you want without others writing it for you... maybe you should take up another hobby other than AutoIt.ok thanks for ur opinion, i ahve just one question left...How can i use the code given to me and it clicks on the color like asked, but then how can i make it move do i diffrent pixel of the same color... Free icons for your programs
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