Jump to content

Newbie wants to do repetitive mouse clicks...


Recommended Posts

Good day!

I am a new user of AutoIt v3 and would like to use this program to automate a "Refresh" mouse button in an application that times out after no activity. The app has a refresh button that I have used the AutoIt Window feature to identify, but what I would like to do is to click on this button every few minutes or so in order to keep activity going so the application doesn't time out. I didn't know if AutioIt can do this by itself without the need for a macro generator, but I would appreciate ANY advice from you guys out there that are power-users. I have searched the forum using keywords such as "timer", but nothing ovious is hitting me!

Thank you in advance for your suggestions and assistance!

Link to comment
Share on other sites

By the way, to run a script doing other stuff in the meantime (meaning, when unable to use Sleep() to pause your script), you can either use something like TimerInit() and then wait in the rest of the script loops for the TimerDiff() (=time interval since timerinit) to reach a certain value, or use the Adlib (search the help) functionality to execute a function every xxx time.

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

damn, edited my first reply instead of adding to it. Sorry! Hope you got the original one in the mail. Now got to go, if you want i'll reconstruct it later.

Cheers

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

Yes, I would like to see an example if you don't mind and have the time!!! Thank you so much!

It is best expirience when you wrote program yourself, without examples.

Post us a snippet so we know whats all about.

i542

I can do signature me.

Link to comment
Share on other sites

I tried this code before the last couple of responses (and thank you for those!) and so far it seems to work, but I will test further.

MouseClick ( "left", 487, 957, 1, 0)

Opt("MouseClickDelay", 600000) ;10 minutes

The customer has the time-out set for 15 minutes, so I figured a refresh of 10 minutes would do the job. The interesting part is - I don't see the mouse to that position. Is this activated in the bakground so you wouldn't see the mouse change positions?

Edited by reilley
Link to comment
Share on other sites

OK, so I think that the option for MouseClick Delay means if your # of clicks is more than 1, this is the amount of time between each click. The Sleep command seems to probably be the best choice, but how do I make this execute every ten minutes? Is this a loop process that has to be created that runs continuously???

Link to comment
Share on other sites

Twitch the mouse:

$Twitch = 0
While 1
    $TwitchFactor = 100 + (200 * ($Twitch * -1))
    MouseMove(MouseGetPos(0) + $TwitchFactor, MouseGetPos(1) + $TwitchFactor)
    Sleep(5 * 1000) ; 5sec delay
    $Twitch = Not $Twitch
WEnd

Edit the Sleep() for the time you want.

:shocked:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...