Jump to content



Photo

Noobie Struggling with Pixels


  • Please log in to reply
13 replies to this topic

#1 Tuurngait

Tuurngait

    Seeker

  • Active Members
  • 16 posts

Posted 23 June 2012 - 09:04 PM

Okay so basically I have another problem with my script again, Not exactly the script it's self but more finding how to add a certain pixel color into it. I've made a few attempts and got it close but not close enough. I'm trying to make the mouse hover over the Pause Button on my Media Player. I'll add the Pixel color into the attachments. If someone could show me how to find the Pixel color in the form of the line "PixelSearch( 0, 0, $i, 768, 0xFF0000, 10 )" then I'd be the most greatful noobie that ever existed

Attached Thumbnails

  • ThisColor.jpg

Attached Files







#2 Kidney

Kidney

    Adventurer

  • Active Members
  • PipPip
  • 134 posts

Posted 23 June 2012 - 09:11 PM

Tools -> AutoIT info window.

Click and drag the target to where the pause button is and let go. In the info window, click on the mouse tab and it will have the color of where you let go of the target.

#3 Tuurngait

Tuurngait

    Seeker

  • Active Members
  • 16 posts

Posted 23 June 2012 - 10:04 PM

I gave that a Shot. Now it's attracted to one of my desktop Icons but not the pause button. I tried multiple times but it just doesn't seem to wan't to move to the button.

#4 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 8,824 posts

Posted 23 June 2012 - 10:09 PM

PixelSearch() returns after it finds the first instance of a colour in the search area.

There are a number of ways to try, I'll list two of them.

1. Change the direction of your search (see help file)
2. Find the position of the GUI (WinGetPos) and search only that area.
AutoIt Absolute Beginners Require a serial
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)

#5 Tuurngait

Tuurngait

    Seeker

  • Active Members
  • 16 posts

Posted 23 June 2012 - 10:11 PM

Is there a way I could get it to search the entire screen for the Pixel instead of just having it in one place with the (Wingetpos)? Because I often move my windows around so it won't always be in "fullscreen mode"

#6 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 8,824 posts

Posted 23 June 2012 - 10:50 PM

Wait, you are searching for something within you media player right?
Why would you want to search the whole screen?
You already said when you do, it stops at a pixel on your desktop.
AutoIt Absolute Beginners Require a serial
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)

#7 Tuurngait

Tuurngait

    Seeker

  • Active Members
  • 16 posts

Posted 23 June 2012 - 11:05 PM

yes but I realise I may not have expanded as much as I should of. Basically I know the script works. Because It follows a form of red on my desktop. But it doesn't have the same connection for when I run the Player, (even in full screen) it's almost as if it's a different red from the one on my desktop. The exact red of my pause button is displayed in the attachment part of the post. But for some reason when I do the Window AutoIT tool thing it gives me "0x14CF0000" as the color but that doesn't seem to be correct as it isn't attracted to that shade. The whole line I have is " $coord = PixelSearch( 0, 0, $i, 650, 0x14CF0000, 10 )"

#8 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 8,824 posts

Posted 23 June 2012 - 11:13 PM

I see, I'm just guessing here, but it sounds like media player might employ the same method
which some full screen games do, which hinder the detection of pixels.

I don't know anything about that sorry. And I could be wrong.
AutoIt Absolute Beginners Require a serial
Run('hh mk:@MSITStore:'&StringReplace(@AutoItExe,'.exe','.chm')&'::/html/tutorials/helloworld/helloworld.htm','',@SW_MAXIMIZE)

#9 Tuurngait

Tuurngait

    Seeker

  • Active Members
  • 16 posts

Posted 24 June 2012 - 08:04 PM

mokay, well is there away to maybe convert it to RGB? that'd be a simpler form I guess. Alot easier to get exact colors or even test colors. or maybe just have an imbetween so like imbetween red and purple?

#10 Kidney

Kidney

    Adventurer

  • Active Members
  • PipPip
  • 134 posts

Posted 24 June 2012 - 09:03 PM

The problem here is that you are not understanding how the pixel search works. If you r searching for a red pixel and there is an icon on your desktop, it will return only the only one time which is the first instance that is true. You have the exact color. Using rgb will not change anything. It will still return the same thing.

I also don't understand why your pause and play button is red but that's another subject. If you really want to pause and play, look into controlclick because that will not require the window to be showing.

#11 Tuurngait

Tuurngait

    Seeker

  • Active Members
  • 16 posts

Posted 24 June 2012 - 09:14 PM

well i don't know how to describe the button it'self but it's like a cirlce with a rectangle inside. and it's red. so thats that. but anyway. If the pixel search wont work is there another possible way i could do a search?

#12 Kidney

Kidney

    Adventurer

  • Active Members
  • PipPip
  • 134 posts

Posted 24 June 2012 - 10:05 PM

Imagesearch is the next possible option or like I said before, controlclick.

#13 Tuurngait

Tuurngait

    Seeker

  • Active Members
  • 16 posts

Posted 27 June 2012 - 08:58 PM

:D okay this is way too out of my league. i'll try something easier

#14 dragonheard

dragonheard

    Seeker

  • Active Members
  • 27 posts

Posted 26 July 2012 - 10:16 PM

but i saw u used this: ( 0, 0, $i, 650, 0x14CF0000, 10 ) as your color but isnt the 10 at the end shade?
if so try 1 or 0 because at 10 it will detect yellow if its on ur screen or green instead of red 1 is ok if ur not sure what red it is 0 it only gets to the specified color.
as for the fullscreen problem maybe its solved this way.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users