Jump to content

Noob Question Sorry!


Taks
 Share

Recommended Posts

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.

Link to comment
Share on other sites

  • Developers

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.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
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...