| View previous topic :: View next topic |
| Author |
Message |
lazy wiiox Guest
|
Posted: Sat Jan 20, 2007 11:41 pm Post subject: PixelColorWait |
|
|
Waits for a pixel in the specified range to become a certain colour. Having a timeout value, and a colour range would be nice too!
PixelSearch and PixelGetColor could be used, but with this you would avoid unreliable loops and 'if equal' statements.
I guess this is just a PixelSearch and a loop, all tied into a nice easy package, haha. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Sun Jan 21, 2007 9:05 am Post subject: |
|
|
| Quote: | | I guess this is just a PixelSearch and a loop | You're right, so what? |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Sun Jan 21, 2007 10:15 am Post subject: |
|
|
| Because it's more convenient, and because certain optimizations are possible when you pass the "waiting" part to AHK. That's why we have wait commands, even though they can all be handled with loops. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sun Jan 21, 2007 4:31 pm Post subject: |
|
|
| This is probably a good candidate for the standard library, but it might be a long time in coming. |
|
| Back to top |
|
 |
JSLover
Joined: 20 Dec 2004 Posts: 542 Location: LooseChange911.com... the WTC attacks were done by the US Gov't... the official story is a lie...
|
Posted: Sun Jan 21, 2007 11:19 pm Post subject: |
|
|
I wrote an...
...function...I'll add it to my Base.ahi & post it soon...& I'll look into writing a PixelWait() too...it sounds almost the same as my ImageWait()... _________________
Home • Click image! • Blog |
|
| Back to top |
|
 |
wiiox
Joined: 04 Nov 2006 Posts: 12
|
Posted: Mon Jan 22, 2007 1:43 am Post subject: |
|
|
| BoBo wrote: | | Quote: | | I guess this is just a PixelSearch and a loop | You're right, so what? |
| jonny wrote: | | Because it's more convenient, and because certain optimizations are possible when you pass the "waiting" part to AHK. That's why we have wait commands, even though they can all be handled with loops. |
jonny pretty much justified it perfectly
Thanks for the great response. JSLover, the only difference is that with ImageWait, you need a defined image. Say you are working with a virtual environment, and want something to trigger when an object is at a certain location. This is the only way I could think of doing that easily and reliably. Or did you mean it will be similar coding?
Anyway, that would be awesome if you could write it. Thanks! |
|
| Back to top |
|
 |
JSLover
Joined: 20 Dec 2004 Posts: 542 Location: LooseChange911.com... the WTC attacks were done by the US Gov't... the official story is a lie...
|
Posted: Mon Jan 22, 2007 3:19 am Post subject: |
|
|
| wiiox wrote: | | Or did you mean it will be similar coding? |
...yes I meant similar coding...(I know they are both necessary & you can't use ImageWait to do exactly what PixelWait will do)...
OK...
...is now up... _________________
Home • Click image! • Blog |
|
| Back to top |
|
 |
wiiox
Joined: 04 Nov 2006 Posts: 12
|
Posted: Mon Jan 22, 2007 7:38 am Post subject: |
|
|
| Wow that was fast. Thanks again JSLover. |
|
| Back to top |
|
 |
lazy wiiox Guest
|
Posted: Mon Jan 22, 2007 8:14 am Post subject: |
|
|
Apparently theres an error at line 162 in your base.ahi file, which prevents the whole thing from executing.
| Code: |
else if (RegExMatch(p_pos, "i)\b(S(?:creen)?)?(?:xl|(?:T|C|B)?L(?:eft)?(?:T|C|B)?)\b", m))
x:=((m1="")?(A_ScreenLeftWA()):=0) ;':' Can't appear in an expression??
|
So.. is that true or am I missing something haha[/quote] |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Mon Jan 22, 2007 9:59 am Post subject: |
|
|
You are missing something, upgrade to the latest AHK... _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
wiiox
Joined: 04 Nov 2006 Posts: 12
|
Posted: Mon Jan 22, 2007 7:41 pm Post subject: |
|
|
Ah right. thanks  |
|
| Back to top |
|
 |
BIOSRAM Guest
|
Posted: Sun Jun 15, 2008 12:49 pm Post subject: PixelWaitColor |
|
|
Hi, just wanted to note that from my experience the function PixelWaitColor is very useful and would be hapy to have it in AutoHotkey build.
I am using it quite a lot.
Thanks JSLover, I allways used a loop before but now I can youse your function. |
|
| Back to top |
|
 |
nobodyukno Guest
|
Posted: Tue Jul 08, 2008 11:04 pm Post subject: |
|
|
| How would i use ImageWait()? I click download and then it brings up a script looking type thing. |
|
| Back to top |
|
 |
Slanter
Joined: 28 May 2008 Posts: 307 Location: Minnesota, USA
|
Posted: Tue Jul 08, 2008 11:59 pm Post subject: |
|
|
| nobodyukno wrote: | | How would i use ImageWait()? I click download and then it brings up a script looking type thing. | Download it from here. You can #Include into your script, or put it in your Lib folder, whatever works for you. _________________ Unless otherwise stated, all code is untested
(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination. |
|
| Back to top |
|
 |
|