 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
delcolt Guest
|
Posted: Sun Jun 27, 2004 10:27 am Post subject: pixelgetcolor? |
|
|
| 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
|
Posted: Sun Jun 27, 2004 10:30 am Post subject: |
|
|
| 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
|
Posted: Sun Jun 27, 2004 12:30 pm Post subject: |
|
|
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 |
|
 |
delcolt Guest
|
Posted: Sun Jun 27, 2004 4:07 pm Post subject: |
|
|
| 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
|
Posted: Sun Jun 27, 2004 4:34 pm Post subject: |
|
|
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 |
|
 |
BoBo Guest
|
Posted: Sun Jun 27, 2004 7:16 pm Post subject: |
|
|
| 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  |
|
| Back to top |
|
 |
delcolt Guest
|
Posted: Mon Jun 28, 2004 4:51 pm Post subject: |
|
|
| 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  |
heh heh sry  |
|
| Back to top |
|
 |
delcolt Guest
|
Posted: Mon Jun 28, 2004 4:56 pm Post subject: |
|
|
| 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
|
Posted: Mon Jun 28, 2004 8:29 pm Post subject: |
|
|
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 |
|
 |
delcolt Guest
|
Posted: Sat Jul 03, 2004 1:37 pm Post subject: |
|
|
wow... nice
but is there also sumthing like that for the mouseposition? (not fullscreen) |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10465
|
Posted: Sat Jul 03, 2004 2:40 pm Post subject: |
|
|
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|