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 

PixelColorWait

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
lazy wiiox
Guest





PostPosted: Sat Jan 20, 2007 11:41 pm    Post subject: PixelColorWait Reply with quote

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





PostPosted: Sun Jan 21, 2007 9:05 am    Post subject: Reply with quote

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

PostPosted: Sun Jan 21, 2007 10:15 am    Post subject: Reply with quote

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
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sun Jan 21, 2007 4:31 pm    Post subject: Reply with quote

This is probably a good candidate for the standard library, but it might be a long time in coming.
Back to top
View user's profile Send private message Send e-mail
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...

PostPosted: Sun Jan 21, 2007 11:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
wiiox



Joined: 04 Nov 2006
Posts: 12

PostPosted: Mon Jan 22, 2007 1:43 am    Post subject: Reply with quote

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 Very Happy

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
View user's profile Send private message
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...

PostPosted: Mon Jan 22, 2007 3:19 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
wiiox



Joined: 04 Nov 2006
Posts: 12

PostPosted: Mon Jan 22, 2007 7:38 am    Post subject: Reply with quote

Wow that was fast. Thanks again JSLover.
Back to top
View user's profile Send private message
lazy wiiox
Guest





PostPosted: Mon Jan 22, 2007 8:14 am    Post subject: Reply with quote

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)

PostPosted: Mon Jan 22, 2007 9:59 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
wiiox



Joined: 04 Nov 2006
Posts: 12

PostPosted: Mon Jan 22, 2007 7:41 pm    Post subject: Reply with quote

Ah right. thanks Razz
Back to top
View user's profile Send private message
BIOSRAM
Guest





PostPosted: Sun Jun 15, 2008 12:49 pm    Post subject: PixelWaitColor Reply with quote

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





PostPosted: Tue Jul 08, 2008 11:04 pm    Post subject: Reply with quote

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

PostPosted: Tue Jul 08, 2008 11:59 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List 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