AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pixelgetcolor?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
delcolt
Guest





PostPosted: Sun Jun 27, 2004 10:27 am    Post subject: pixelgetcolor? Reply with quote

Code:
IfWinExist,  Crash and Spyro - Microsoft Internet Explorer
{
   WinActivate
}
MsgBox, druk op ok om te beginne :P

MouseClick, left,  84,  361
Sleep, 300
MouseClick, left,  392,  347
Sleep, 1000
;done with intro
MouseClick, left,  249,  284
Sleep, 100
;first screen to go away

loop
{
   MouseClick, left,  263,  253
   Sleep, 100
   ; starting
   loop
   {
      PixelGetColor, pixelvar, 286, 252
      if pixelvar=2738904
      break
   }
   MouseClick, left,  312,  287
   loop
   {
      PixelGetColor, pixels, 269, 311
      if pixels=255
      break
   }
   MouseClick, left,  311,  291
   loop
   {
      PixelGetColor, pixe, 371, 135
      if pixe=7814488
      break
   }
   Mouseclick, left, 300, 300
   sleep, 2000
}
^z::ExitApp
^x::Reload
exitapp


whats wrong with this script? the pixelgetcolor doesnt seem to work :S
Back to top
delcolt
Guest





PostPosted: Sun Jun 27, 2004 10:30 am    Post subject: Reply with quote

autoit3 is also a bit weird, when i do shift alt tab it goes to another window, what should i do?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Sun Jun 27, 2004 12:30 pm    Post subject: Reply with quote

Each of your loops will be infinite if the color is never detected. Also, note that PixelGetColor uses coordinates relative to the active window by default. If you wish to change that to be absolute/screen coordinates, put this somewhere near the top of your script:
CoordMode, Pixel
Back to top
View user's profile Send private message Send e-mail
delcolt
Guest





PostPosted: Sun Jun 27, 2004 4:07 pm    Post subject: Reply with quote

oh, thx, but errm, autoit3 still isnt working well, what should i do?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Sun Jun 27, 2004 4:34 pm    Post subject: Reply with quote

If you can be more specific, we might be able to help you. Try putting in some temporary MsgBox commands to help you debug it.

Last edited by Chris on Sun Jun 27, 2004 8:27 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
BoBo
Guest





PostPosted: Sun Jun 27, 2004 7:16 pm    Post subject: Reply with quote

Quote:
autoit3 is also a bit weird, when i do shift alt tab it goes to another window, what should i do?

oh, thx, but errm, autoit3 still isnt working well, what should i do?


Decolt, have you requested support at its page: AutoIt 3 - Forum Question
Back to top
delcolt
Guest





PostPosted: Mon Jun 28, 2004 4:51 pm    Post subject: Reply with quote

BoBo wrote:
Quote:
autoit3 is also a bit weird, when i do shift alt tab it goes to another window, what should i do?

oh, thx, but errm, autoit3 still isnt working well, what should i do?


Decolt, have you requested support at its page: AutoIt 3 - Forum Question


heh heh sry Razz
Back to top
delcolt
Guest





PostPosted: Mon Jun 28, 2004 4:56 pm    Post subject: Reply with quote

so now i have another question, with pixelgetcolor, do you get the color from autoit3 active window?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Mon Jun 28, 2004 8:29 pm    Post subject: Reply with quote

You can get the color from Window Spy, or you can use PixelGetColor in a simple script such as this (useful for full screen games):

#z::
MouseGetPos, X, Y
; Move the cursor out of the way so that it doesn't block the pixel we want.
; Move the mouse slowly so that the game can keep up with it:
MouseMove, 0, 0, 3
PixelGetColor, color, %X%, %Y%
MouseMove, %X%, %Y%, 1 ; moving faster seems ok in this case
clipboard = %clipboard%`nX%X% Y%Y% Color %color%
return

After you've pressed Win+Z to capture a few pixels of interest, you can then alt-tab out of the game and paste them into a text editor with Ctrl-C.
Back to top
View user's profile Send private message Send e-mail
delcolt
Guest





PostPosted: Sat Jul 03, 2004 1:37 pm    Post subject: Reply with quote

wow... nice Smile
but is there also sumthing like that for the mouseposition? (not fullscreen)
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Sat Jul 03, 2004 2:40 pm    Post subject: Reply with quote

Window Spy shows the color of the pixel under the mouse. Example:
>>>>>>>>>>>>>( Pixel Color )<<<<<<<<<<<<<
13160660

You can also use combine the MouseGetPos command with PixelGetColor to do the same thing. See the help file for details.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group