jawed Posted August 19, 2013 Posted August 19, 2013 (edited) im wishing you guys a good (here in germany rainy ^^) morning i would like to ask you guys, is there a possible solution for this problem without putting it in into switch.. case or 4 if...else? i want a function to move my mouse and check every pixel for the Color white. i can say "top", "left", "right" orĀ "bottom" as direction func _Comboboxsearch($name, $item, $direction) $pos = ControlGetPos($Caption, "", "[TEXT:"&$name&"]") $y = $pos[1] + 10 $color = PixelGetColor($x, $y) if Hex($color, 6) = "FFFFFF" Then for $x = $x + 10 to 1160 Step 1 ;<<<<<<<problem $color = PixelGetColor($x, $y) if Hex($color, 6) = "FFFFFF" Then for $x = $x + 10 to 1160 Step 1 ;<<<<<<<problem $color = PixelGetColor($x, $y) if Hex($color, 6) = "C0C0C0" Then MouseClick("left", $x + 7, $y, 2, 0) sleep(222) send($Item) sleep(222) send("{ENTER}") sleep(222) ControlFocus($Caption, "", "[REGEXPCLASS:AfxFrame]") Return 1 EndIf Next EndIf Next EndIf the problem is, based on the direction i have to let it move like (the problem lines) $x = $x +-1 OR $y = $y +-1 the +- problem is solved, the x or y problem not... btw i think do... while is better then for...next Edited August 19, 2013 by jawed
FireFox Posted August 19, 2013 Posted August 19, 2013 Hi,What is this script for?There are surely more reliable ways to automate the target application.Br, FireFox.
jawed Posted August 19, 2013 Author Posted August 19, 2013 (edited) this script is targeting a combobox in an other programm. im targeting it through the label its reffered to. so i need the "direction", i can tell him the combobox is in the "right" direction of the label or top/left/bottom. then going twice for the pixelsearch until i find it or the window ends... the problem is.. not everything is targetable with controlcommand or controlclick. Edited August 19, 2013 by jawed
FireFox Posted August 19, 2013 Posted August 19, 2013 Please wait at least 24 hours before bumping your topic.
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