Jump to content

Recommended Posts

Posted

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 ! :)

Posted

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)

Posted

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)

Posted

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)

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
Posted

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")

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
Posted

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.

Posted

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

Posted

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 ?

Posted

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

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
  • Recently Browsing   0 members

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