Sign in to follow this  
Followers 0
Taks

Noob Question Sorry!

4 posts in this topic

Ive been using autoit for awhile but never knew how to make one. I open the scripts i use and i sort of understand them.

Im trying to make a script that presses, LCTRL, LCTRL, and G every 36-41 seonds

Func CtrlCtrlG()

Sleep(Random(36000,41000))

Send("{LCTRL}")

Sleep(Random(500,700))

Send("{LCTRL}")

Sleep(Random(800,900))

Send("g")

EndFunc

And presses TAB every 2.25-2.5 seconds,

Func Tab()

Sleep(Random(225,250))

Send("{TAB}")

EndFunc

Thats basicly my whole script put together. Im not sure if i need to put something at the top to start anything, can someone help me please, this doesnt look like something that will take very long to make. Sorry for your troubles and Thanks for reading.

Share this post


Link to post
Share on other sites



Ive been using autoit for awhile but never knew how to make one. I open the scripts i use and i sort of understand them.

Im trying to make a script that presses, LCTRL, LCTRL, and G every 36-41 seonds

Func CtrlCtrlG()

Sleep(Random(36000,41000))

Send("{LCTRL}")

Sleep(Random(500,700))

Send("{LCTRL}")

Sleep(Random(800,900))

Send("g")

EndFunc

And presses TAB every 2.25-2.5 seconds,

Func Tab()

Sleep(Random(225,250))

Send("{TAB}")

EndFunc

Thats basicly my whole script put together. Im not sure if i need to put something at the top to start anything, can someone help me please, this doesnt look like something that will take very long to make. Sorry for your troubles and Thanks for reading.

You will have to do some reading on how Function work.

Defining a function without referring to it will not work.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Not bad for a first try.

While 1;This starts a loop
    CtrlCtrlG();This calls your first function
    Tab();When you first function is done, this does the second function
WEnd;This ends the loop
    
Func CtrlCtrlG()
    Sleep(Random(36000,41000))
    Send("{LCTRL}")
    Sleep(Random(500,700))
    Send("{LCTRL}")
    Sleep(Random(800,900))
    Send("g")
EndFunc

Func Tab()
    Sleep(Random(225,250))
    Send("{TAB}")
EndFunc

Read comments

EDIT: and I almost forgot

For future reference, when posting a thread , make its title remotely pertinent to question/subject you are posting about.

This is the support section of the forum, its meant for questions, so naming a thread "I Have A Problem", or "Question", or "Help Me My, Code Doesn't Work", or "Noob Requesting Assistance" Is redundant, and makes it harder for anyone else who has the same/similar questions as you to find the answer by searching the forums, which in turn means people often have to make extra threads and people who are answering the threads just end up repeating themselves several times over.

Edited by Paulie

Share this post


Link to post
Share on other sites

And also, did you say TAB every 2.25 - 2.5 seconds?

Then instead of

Func Tab()
    Sleep(Random(225,250))
    Send("{TAB}")
EndFuncoÝ÷ Øl¥u·ºÚ"µÍ[ÈX
BÛY
[ÛJLL
JBÙ[
    ][ÝÞÕPI][ÝÊB[[

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