Jump to content

Continuous Automation


Recommended Posts

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..

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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
Link to comment
Share on other sites

@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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...