Jump to content
Sign in to follow this  
lullabyss

Continuous Automation

Recommended Posts

lullabyss

Hi,

sorry for all for being a newbie and ignorance about programming languages.

I am working with an intenet explorer based package program, where i register document numbers to the database..

there is a barcod reader, i put the barcod attached to the document and the number appears in the barcode number box, the program is operating(searching the number) after some miliseconds (automatically, without pushing enter) and gets the document in first string. Then i left click once or double hit the enter, the work is done.

What i need here is, let me use the barcod reader, and let the autoit do the clicking by understanding the process of search.

i mean, whenever the first string appears as a search result, autoit should left click it. can anyone compile such a code?

thank you..

Share this post


Link to post
Share on other sites
jvanegmond

No, we cannot compile such code. Your request does not meet the requirements set by this forum.

Now, before you ask about the requirements, you should use your brain and think: What could a programmer possibly need to automate an application? Could it be.. possibly.. the application.

Share this post


Link to post
Share on other sites
lullabyss

the program is internet explorer based, as seen in the screenshots, not a separate program, don't know much about details.

the operations are held on a explorer pop up page like this.

post-42191-1224840476_thumb.jpg

is it possible to create an auto-left click whenever the first string appears as the query result, so that i don't have to click the first string every time to transfer to the right, because i repeat this hundreds of time a day..

thanks.

Share this post


Link to post
Share on other sites
jvanegmond

PixelGetColor can be used to monitor 1 certain pixel on the screen. MouseClick will do the trick of clicking.

You should be able to find the right pixel with the AutoIt Window Info tool.

Share this post


Link to post
Share on other sites
lullabyss

That's been a great advance for me! I discovered what i needed, that is "PixelChecksum"..

I somewhat composed such a code:

CODE
; Get initial checksum

$checksum = PixelChecksum(65,285,555,315)

; Wait for the region to change, the region is checked every 100ms to reduce CPU load

While $checksum = PixelChecksum(65,285, 555,315)

Sleep(100)

WEnd

MouseClick("left", 250, 295)

But..

It works only once.. How can i make it continue to click the same coordinates in every region change?

Tried lotsa different combinations but failed...

Share this post


Link to post
Share on other sites
dbzfanatic

Did you try

$checksum = PixelChecksum(65,285,555,315)

While 1
If PixelCheckSum(65,285,555,315) <> $checksum Then
;do w/e here
Endif
Sleep(250)
WEnd

Edit: Forgot to add the sleep >.>

Edited by dbzfanatic

Share this post


Link to post
Share on other sites
lullabyss

@dbzfanatic

i tried to interpret :P your codes and wrote something like this:

CODE
$checksum = PixelChecksum(65,285,555,315)

While 1

If PixelCheckSum(65,285,555,315) <> $checksum Then

MouseClick("left", 250, 295)

Endif

Sleep(250)

WEnd

now, i can't move the cursor from the coordinates 250,295!!!

Did i put the MouseClick in wrong place?

Share this post


Link to post
Share on other sites
dbzfanatic

Well that will click forever until the pixel changes back to original so if you want it to click once and wait for a change again try this.

$checksum = PixelChecksum(65,285,555,315)

While 1
$newsum = PixelCheckSum(65,285,555,315)
If $newsum <> $checksum Then
MouseClick("left", 250, 295)
$checksum = $newsum
Endif
Sleep(250)
WEnd

Share this post


Link to post
Share on other sites
lullabyss

Well that will click forever until the pixel changes back to original so if you want it to click once and wait for a change again try this.

$checksum = PixelChecksum(65,285,555,315)

While 1
$newsum = PixelCheckSum(65,285,555,315)
If $newsum <> $checksum Then
MouseClick("left", 250, 295)
$checksum = $newsum
Endif
Sleep(250)
WEnd

That is MARVELOUS..

Thank you thank you thank you...

:P

Share this post


Link to post
Share on other sites
Cw2K1

That is MARVELOUS..

Thank you thank you thank you...

and next time don't forget to Read the help file for such simple codes :P

Enjoy the complexity.Feel the power of simplicity.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×