 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Loxi
Joined: 12 Mar 2005 Posts: 2
|
Posted: Sat Mar 12, 2005 7:54 am Post subject: Pixel Search Help |
|
|
Hello all !!!
Could someone help me to made a script which :
1. Mouse click right at 870,390
2. Then mouse click left on : Color: 0x4844E8 ( this object move all the time )
3.End of script. Hotkey etc.
If someone could help me i will be really thanksfull. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Sat Mar 12, 2005 9:21 am Post subject: |
|
|
Words you used within your request:
Syntax: Word | AHK command
Pixel Search Color| PixelGetColor
Mouse click | MouseClick
Hotkey | Hotkey
Help | Help yourself ---> [RTFM]!
 |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Mar 12, 2005 9:29 am Post subject: |
|
|
If you dont wanna help just dont respond.
I read tutorial sth like 30 times and dont understand how to made script like this one. Thats why i made topic.
Is it crime that i dont understand how to do it ?
O thought forum is made to ask about problematic questions. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Sat Mar 12, 2005 9:46 am Post subject: |
|
|
Your request:
| Quote: | | Could someone help me to made a script which | I've pointed out the commands you should check in AHK's help. Instead I could have saved my time and ignore you, your correct. I will think about it. If I would write you some code, you still wouldn't understand it. IMHO support means help you to help yourself. Gimme something that you've tried to manage on your own (some code) and I'm/we are more then willing to help you out.
Your request gives the idea that I should take my time to solve your issue, while you save your time for playin, having party, etc ...
But sorry, that's not the game.
You've requested this:
| Quote: | | Mouse click right at 870,390 | AHK's help about MouseClick (what I've already advised you to check)
MouseClick [, WhichButton , X, Y, ClickCount, Speed, D|U, R]
The code:
| Quote: | | MouseClick, R, 870,390 |
I doubt you wouldn't have been able to provide that piece of code, if you would have followed my advise to RTFM ...
-----
Where are you from ? |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Sat Mar 12, 2005 9:53 am Post subject: |
|
|
| Which one of the 82 postings (you'll find if you search the forum for the word "Pixel") you've checked ? What of the code you haven't understood ? |
|
| Back to top |
|
 |
Loxi
Joined: 12 Mar 2005 Posts: 2
|
Posted: Sat Mar 12, 2005 10:04 am Post subject: |
|
|
Hmm... generally you are right.
Hmm..... i dont know how to made that mose move to Color : 0x4844E8
and click left there.
| Code: |
MouseClick, RIGHT, 875, 455
CoordMode, Mouse
MouseGetPos, WhereX, WhereY
< and here i dont know what have to be :(
i dont know how to made that mouse move to Color : 0x4844E8>
MouseClick, LEFT, %WhereX%, %WhereY% |
If you could help me with it that will be great. |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Mar 12, 2005 10:20 am Post subject: |
|
|
You've to check the screen(area) for that pixel using PixelGetColor, of course you've to change its screencoords dynamically.
| Code: | Loop, 100
{
PixelGetColor, OutputVar, %A_Index%, 1 ; check its color code parameter !
If OutputVar = 4844E8
{
MsgBox, Bingo!
Break
}
} |
This sample checks PixelCoords x=1-100; y=1 for a specific pixelcolor.
BTW: I doubt that that pixel(color) is unique, so the first match doesn't necessarily has to be the target, right ?
I'll be off now. Familly business. Take care. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Sat Mar 12, 2005 10:21 am Post subject: |
|
|
The post above was mine  |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Mar 12, 2005 11:28 am Post subject: |
|
|
Hmm.... if i use loop moue dont move
Maybe it could be sth like this :
| Code: |
PixelSearch, X_Position, Y_Position, X850, Y360, X1000, Y640, 0x3844C0, 10, Fast
If ErrorLevel = 0
MouseMove, %X_Position%, %Y_Position%nderMouse%
If color = 3844C0
MouseClick, LEFT, %WhereX%, %WhereY% |
|
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5049 Location: imaginationland
|
Posted: Sat Mar 12, 2005 12:47 pm Post subject: Re: Pixel Search Help |
|
|
| Loxi wrote: | 1. Mouse click right at 870,390
2. Then mouse click left on : Color: 0x4844E8 ( this object move all the time )
3.End of script. Hotkey etc. |
| Code: | ;1. Click at (870,390)
MouseClick, Right, 870, 390
;2. Click left on Color: 0x4844E8
Loop, 10
{
PixelSearch, XColorPos, YColourPos, 0, 0, 1024, 768, 0x4844E8, 10, Fast
If ErrorLevel = 0
Break
Else If ErrorLevel = 1
Continue
}
If ErrorLevel in 1,2
MsgBox, 16, Error, Colour not found or there was a problem
If ErrorLevel = 0
MouseClick, Left, %XColorPos%, %YColourPos%
Return
;3. Hotkey to close immediately
Esc::ExitApp | -Untested
See: MouseClick, PixelSearch, ErrorLevel. _________________
RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2") |
|
| 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
|