Jump to content

Noob here


Recommended Posts

For some reason when I run this script the sleep doesnt do anything, it still works like sleep is at zero..

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.11.1 (beta)
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

HotKeySet("{end}","spam")
While 1
    sleep(13000)
WEnd

Func spam()
    send("{enter}")
    send("Sit")
    send("{enter}")
    send("The")
    send("{enter}")
    send("Fuck")
    send("{enter}")
    send("Down.")
    send("{enter}")
    send("LnE > You")
    send("{enter}")
EndFunc
Link to comment
Share on other sites

Hey

actually, the sleep is working.

i can proof this by writing the following:

HotKeySet("{end}","spam")
sleep(13000)
MsgBox(0,"","WORKS")

Func spam()
    Exit
EndFunc

if you wait 13 seconds, it will show a message box with the text WORKS.

but if you press the END button before the 13 seconds it wont.

immense

When I do this, I press End and the script automatically quits out.
Link to comment
Share on other sites

The sleep in the loop is too long. The hotkey press won't register because of that time. Do as Zedna said, make it Sleep (100). If you want to delay it, add a sleep just after you declare your function. The reason his example closes is because he set the end key to close. Read the script :)

EDIT: And reading your third post in a row (THERE IS SUCH A THING AS AN EDIT BUTTON)

Persudo Code:

Send

Sleep

Send

Sleep

Send...

Edited by Bert
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...