Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Commodore » Commodore 8-bit » OT: Need help with this Windows task
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
OT: Need help with this Windows task [message #203907] Wed, 27 January 2010 12:42 Go to next message
Hg is currently offline  Hg
Messages: 162
Registered: January 2012
Karma: 0
Senior Member
Not really sure where to get a quick honest answer to my problem, so I
thought I might as well ask my fellow Commodore users first.

Is there a quick way to automate a very simple task in Windows,
namely to constantly check a pixel of the screen for a change to a
specific color, and then automate a mouse click into a different area of
the screen. This has to be done more or less in real time (as soon as the
colour changes the mouse click has to be done in the same or next video
refresh cycle.)
Checked a few small utilities, some can grab a pixel's colour and some are
great at automating windows tasks. None of them have an all-in-one ability
to do what I want.

Any ideas?

Many thanks
Re: OT: Need help with this Windows task [message #203918 is a reply to message #203907] Wed, 27 January 2010 17:37 Go to previous messageGo to next message
christianlott1 is currently offline  christianlott1
Messages: 1852
Registered: January 2012
Karma: 0
Senior Member
not sure. maybe autoit:

http://www.autoitscript.com/autoit3/
Re: OT: Need help with this Windows task [message #203934 is a reply to message #203907] Fri, 29 January 2010 01:40 Go to previous messageGo to next message
Anonymous
Karma:
Originally posted by: tom

In article <hjptu7$ses$1@speranza.aioe.org>, Hg <Hg@hg2.hg> wrote:
>
> Not really sure where to get a quick honest answer to my problem, so I
> thought I might as well ask my fellow Commodore users first.
>
> Is there a quick way to automate a very simple task in Windows,
> namely to constantly check a pixel of the screen for a change to a
> specific color, and then automate a mouse click into a different area of
> the screen. This has to be done more or less in real time (as soon as the
> colour changes the mouse click has to be done in the same or next video
> refresh cycle.)
> Checked a few small utilities, some can grab a pixel's colour and some are
> great at automating windows tasks. None of them have an all-in-one ability
> to do what I want.

I've written programs that do similar things. If the pixel you want to check
is inside a regular GDI-drawn window then this should be fairly easy. However
if the owner program uses any DirectX or Direct3D then it may not be possible.
As for doing it within the next refresh cycle, that depends. If you poll the
pixel once per clock tick (every 10ms) and your refresh rate is 60 Hz and the
poller thread can be elevated to high priority, then maybe yes. You might
even be able to do it faster and without polling if you can intercept the
message that triggers the color change in the first place. There are other
considerations as well, for example what if the window is minimized or not on
top, etc. Also, what are the consequences if the system is busy and the click
doesn't get through until 30ms later? Will you lose points in a game or will
an airplane fall out of the sky?
Re: OT: Need help with this Windows task [message #203942 is a reply to message #203934] Fri, 29 January 2010 13:15 Go to previous messageGo to next message
Hg is currently offline  Hg
Messages: 162
Registered: January 2012
Karma: 0
Senior Member
On Fri, 29 Jan 2010 06:40:48 +0000, Tom wrote:

> In article <hjptu7$ses$1@speranza.aioe.org>, Hg <Hg@hg2.hg> wrote:
>>
>> Not really sure where to get a quick honest answer to my problem, so I
>> thought I might as well ask my fellow Commodore users first.
>>
>> Is there a quick way to automate a very simple task in Windows, namely
>> to constantly check a pixel of the screen for a change to a specific
>> color, and then automate a mouse click into a different area of the
>> screen. This has to be done more or less in real time (as soon as the
>> colour changes the mouse click has to be done in the same or next video
>> refresh cycle.)
>> Checked a few small utilities, some can grab a pixel's colour and some
>> are great at automating windows tasks. None of them have an all-in-one
>> ability to do what I want.
>
> I've written programs that do similar things. If the pixel you want to
> check is inside a regular GDI-drawn window then this should be fairly
> easy. However if the owner program uses any DirectX or Direct3D then it
> may not be possible. As for doing it within the next refresh cycle, that
> depends. If you poll the pixel once per clock tick (every 10ms) and your
> refresh rate is 60 Hz and the poller thread can be elevated to high
> priority, then maybe yes. You might even be able to do it faster and
> without polling if you can intercept the message that triggers the color
> change in the first place. There are other considerations as well, for
> example what if the window is minimized or not on top, etc. Also, what
> are the consequences if the system is busy and the click doesn't get
> through until 30ms later? Will you lose points in a game or will an
> airplane fall out of the sky?

I'll lose something alright :-( and it won't be something as trivial as
game points, that's for sure.
Apart from very simple macro editing my days as a coder are long gone - I
was hoping somebody had made public a simple routine that does exactly
what I need. No luck yet. I did look more deeply into existing automation
utils and there were a couple that did what I wanted but because they use
fancy image recognition tech they're overkill for my needs and renders
them useless (for me) as they both take approx half a second to correctly
ID a block of color on the screen.
Re: OT: Need help with this Windows task [message #203943 is a reply to message #203942] Fri, 29 January 2010 14:17 Go to previous messageGo to next message
Hg is currently offline  Hg
Messages: 162
Registered: January 2012
Karma: 0
Senior Member
On Fri, 29 Jan 2010 18:15:21 +0000, Hg wrote:

> On Fri, 29 Jan 2010 06:40:48 +0000, Tom wrote:
>
>> In article <hjptu7$ses$1@speranza.aioe.org>, Hg <Hg@hg2.hg> wrote:
>>>
>>> Not really sure where to get a quick honest answer to my problem, so I
>>> thought I might as well ask my fellow Commodore users first.
>>>
>>> Is there a quick way to automate a very simple task in Windows, namely
>>> to constantly check a pixel of the screen for a change to a specific
>>> color, and then automate a mouse click into a different area of the
>>> screen. This has to be done more or less in real time (as soon as the
>>> colour changes the mouse click has to be done in the same or next video
>>> refresh cycle.)
>>> Checked a few small utilities, some can grab a pixel's colour and some
>>> are great at automating windows tasks. None of them have an all-in-one
>>> ability to do what I want.
>>
>> I've written programs that do similar things. If the pixel you want to
>> check is inside a regular GDI-drawn window then this should be fairly
>> easy. However if the owner program uses any DirectX or Direct3D then it
>> may not be possible. As for doing it within the next refresh cycle,
>> that depends. If you poll the pixel once per clock tick (every 10ms)
>> and your refresh rate is 60 Hz and the poller thread can be elevated to
>> high priority, then maybe yes. You might even be able to do it faster
>> and without polling if you can intercept the message that triggers the
>> color change in the first place. There are other considerations as
>> well, for example what if the window is minimized or not on top, etc.
>> Also, what are the consequences if the system is busy and the click
>> doesn't get through until 30ms later? Will you lose points in a game or
>> will an airplane fall out of the sky?
>
> I'll lose something alright :-( and it won't be something as trivial as
> game points, that's for sure.
> Apart from very simple macro editing my days as a coder are long gone -
> I was hoping somebody had made public a simple routine that does exactly
> what I need. No luck yet. I did look more deeply into existing
> automation utils and there were a couple that did what I wanted but
> because they use fancy image recognition tech they're overkill for my
> needs and renders them useless (for me) as they both take approx half a
> second to correctly ID a block of color on the screen.

Just looked again at AutoIt and there is a function that seems to do
exactly what I was looking for (Pixelsearch function), so i'll have to
spend this weekend with my coding hat on.
Re: OT: Need help with this Windows task [message #203944 is a reply to message #203943] Fri, 29 January 2010 14:50 Go to previous message
christianlott1 is currently offline  christianlott1
Messages: 1852
Registered: January 2012
Karma: 0
Senior Member
On Jan 29, 1:17 pm, Hg <H...@hg2.hg> wrote:

> Just looked again at AutoIt and there is a function that seems to do
> exactly what I was looking for (Pixelsearch function), so i'll have to
> spend this weekend with my coding hat on.

maybe

http://www.autohotkey.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Eprom question..
Next Topic: Commodore Free issue 36 available (fwd)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Mar 29 09:26:24 EDT 2024

Total time taken to generate the page: 0.32241 seconds