Sign in to follow this  
Followers 0
lilandywandy

Noob need help again

9 posts in this topic

#1 ·  Posted (edited)

ok what im trying to do this time is make a program that opens a program and logs me in and click in various places.... this is what i managed to get

HotKeySet("{PAUSE}", "Terminate")

While 1
   For $i = 1 to 7
      Sleep(7000)
      MouseClick("right", 796, 360)
      $i = $i + 1
   Next
Wend

Func Terminate()
   Exit
EndFunc

what i want is instead of the mouse that im gonna do lots of mouse clicks which i know how but i want to know what to do is how can i make this program so that it does one set of commands (ie mouse move mouse click , keystroke) then not do anything for about an hour or so, then do a different set of commands. i want it to repeat but here is something i kinda designed

commands set 1 ---1 hour of nothing---- commands set 2 and after command set 2 is done, automaticall start at command 1 again and repeat

Edited by Larry

Share this post


Link to post
Share on other sites



You could put a

Sleep(3600000)

Share this post


Link to post
Share on other sites

Here is what you are going to want to do...

Dim $pause = 1;Time to pause in hours
$pause = $pause * 60 * 60 * 1000

HotKeySet("^!x", "mExit()"); Ctrl+Alt+x exits program

While 1

 ;First Set of Commands
  Sleep($pause)

 ;Second Set of Commands
  Sleep($pause)

WEnd

Func mExit()
  Exit
EndFunc

Make sure you always have a pause after the last command, or you will end up having the last command immediatly followed by the first one.

I hope the above helps abit,

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

;First Set of Commands

Sleep($pause)

*******

;Second Set of Commands

Sleep($pause)

on the **** part... are u should there is 1 hour gap betweent those two..? i dont see anything...

and yes i want after second set of commands to dirrect go back to one with no pause... so any changes?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

This work for you?

HotKeySet("^!x", "mExit()"); Ctrl+Alt+x exits program

While 1
  ;First Set of Commands
   Sleep(3600000)

 ;Second Set of Commands
WEnd

Func mExit()
   Exit
EndFunc
Edited by killaz219

Share this post


Link to post
Share on other sites

HotKeySet("{PAUSE}", "Terminate")

While 1

; Double click at 43,464

MouseClick("left", 43, 464, 2)

Sleep(5000)

MouseClick("left", 578, 617, 1)

Sleep(25000)

MouseClick("left", 342, 679, 1)

Send ( "0123456789")

Sleep(6000)

MouseClick("left", 997, 712, 1)

Sleep(3600000)

**second command set

WEnd

Func mExit()

Exit

EndFunc

for some reason.. it says the first line no work

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

HotKeySet("{PAUSE}", "mExit")

While 1
   MouseClick("left", 43, 464, 2)
   Sleep(5000)
   MouseClick("left", 578, 617, 1)
   Sleep(25000)
   MouseClick("left", 342, 679, 1)
   Send ( "0123456789")
   Sleep(6000)
   MouseClick("left", 997, 712, 1)
   Sleep(3600000)
WEnd

Func mExit()
   Exit
Endfunc

You forgot to change "Terminate" to "mExit" or vice versa

Edited by killaz219

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

If you look at the code below the $pause contains a 1 hour wait. I do it this way for ease of use and being able to change it. You dont have to remember a big long number, just a simple variable.

Dim $pause = 1;Time to pause in hours
$pause = $pause * 60 * 60 * 1000

HotKeySet("^!x", "mExit()"); Ctrl+Alt+x exits program

While 1
   MouseClick("left", 43, 464, 2)
   Sleep(5000)

   MouseClick("left", 578, 617, 1)
   Sleep(25000)

   MouseClick("left", 342, 679, 1)
   Send ( "0123456789")
   Sleep(6000)

   MouseClick("left", 997, 712, 1)
   Sleep($pause)

;Second Set of Commands

WEnd

Func mExit()
 Exit
EndFunc

I removed the Sleep($pause) from the second set of commands as you described you wanted it to go immediately back to the first command when finished with the last.

Edit: I input the commands he was wanting in the first set of commands.

I hope this helps, let me know if you have any more questions.

JS

Edited by JSThePatriot

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

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  
Followers 0