Jump to content
Sign in to follow this  
jawed

$x or $y based on other variable

Recommended Posts

jawed

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 by jawed

Share this post


Link to post
Share on other sites
FireFox

Hi,

What is this script for?

There are surely more reliable ways to automate the target application.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
jawed

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 by jawed

Share this post


Link to post
Share on other sites
jawed

nobody who can help me out there...? :(

Share this post


Link to post
Share on other sites
FireFox

Please wait at least 24 hours before bumping your topic.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×