Sign in to follow this  
Followers 0
GrillV20

I'm real new at this.

17 posts in this topic

How do i add a 3 minute delay at the beginning of my script ?

And once the time has elapsed i want the script to do (alt+1) for a long time until I stop the script. What would this script look like? please help ! :)

Share this post


Link to post
Share on other sites



Okay... just for starters... look at the help file. I will guide you in the direction.

Search for Sleep() (make it sit for X amount of time before continuing) HotKeySet() (for exiting the script) Loops (make it do one item over and over again) and I think the last thing you need right now is Send().

You might also need to check out the WinActive() and WinActivate() functions.

Please note that if you are having trouble with any particular section of a script I would be more than happy to re write or optomize it to the best of my ability. I dont want to write this script for you as it wouldnt help you learn much.

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

A simple example for helping ya.

For $c = 1 to 180 
    Sleep(1000)
Next

Share this post


Link to post
Share on other sites

I always do mine as follows...

Dim $delay = 3;Time in minutes that it checks the date
$delay = $delay * 60 * 1000

Sleep($delay)

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

Why not

Sleep(180000)

?

The point was showing also a loop. :)

Share this post


Link to post
Share on other sites

Why not

Sleep(180000)

?

The point was showing also a loop.  :)

<{POST_SNAPBACK}>

The reason being it makes it easier to change if you use a multiplier. Your method is fine. I didnt show the loop because you did a fine job of that I was just showing how I usually do the sleep() :)

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

Why not

Sleep(180000)

?

The point was showing also a loop.  :)

<{POST_SNAPBACK}>

Too. :)

But, I did it because he says: "I'm real new..."

And If he needs increase/decrease (minutes), he only must change the variable. ;)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

This is all i got so far (first attempt at scripting anything).

Sleep (180000)

Could you show me what the script would look like so i can get an idea of what i'm doing. I'm really in the dark here lol.

Edited by GrillV20

Share this post


Link to post
Share on other sites

Sleep (180000)

Send ("!1")

Did some more work on my own , but im not sure if its right or not.

If it is i need somebody to tell me how to loop the Send ("!1")

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

I want it to send it every 500ms, and I want to run the script until I decide I want it turned off.

What would it look like if i could do this.

Edited by GrillV20

Share this post


Link to post
Share on other sites

It would look like everyone wrote it for ya:

hotkeyset("{pause}","stopme")
Sleep(180000)

For $i = 1 to 7200
  Send("!1")
  Sleep(500)
Next

func stopme()
exit
endfunc

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Now that I know how the script works. Can you tell me why I get an error on line 1 of the script ? Am I copying and pasting wrong or what am I doing wrong .... ?

New_Text_Document__2_.txt

Edited by GrillV20

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Don't use Microsoft Word or Wordpad to edit your scripts.

Edited by SlimShady

Share this post


Link to post
Share on other sites

Now that I know how the script works.  Can you tell me why I get an error on line 1 of the script  ?  Am I copying and pasting wrong or what am I doing wrong .... ?

<{POST_SNAPBACK}>

It seems to work normally to me. However:

; AutoIt Version: 2.x

Maybe this is the problem. I know nothing about the v2 syntax but I do know that it very very different than the current. Grap the latest AutoIT copy @ http://www.autoitscript.com/autoit3/downloads.php

Share this post


Link to post
Share on other sites

Thanks alot everyone i got it working fine (wasnt using v3 lmao).

One more quick question; how do i shorten the delay to were it will press alt-1 every 500ms ?

Share this post


Link to post
Share on other sites

can u explain what this line is

For $i = 1 to 7200

ive already tried changing 7200 into a smaller number but just caused my script to fail. Thats the big delay right !?

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