reilley Posted April 24, 2007 Posted April 24, 2007 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!
SadBunny Posted April 24, 2007 Posted April 24, 2007 (edited) 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 April 24, 2007 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you.
SadBunny Posted April 24, 2007 Posted April 24, 2007 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.
reilley Posted April 24, 2007 Author Posted April 24, 2007 Yes, I would like to see an example if you don't mind and have the time!!! Thank you so much!
i542 Posted April 24, 2007 Posted April 24, 2007 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.
reilley Posted April 24, 2007 Author Posted April 24, 2007 (edited) 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 April 24, 2007 by reilley
reilley Posted April 24, 2007 Author Posted April 24, 2007 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???
PsaltyDS Posted April 24, 2007 Posted April 24, 2007 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. 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
reilley Posted April 24, 2007 Author Posted April 24, 2007 Wow, that one is really cool - and I figured out how to shorten the distance the cursor moves. Thank you! I am going to test this within the application and see how it works out!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now