Jump to content

Silly Question Regarding Mouseclick


Recommended Posts

Hi everyone,

Very new to autoit. Trying to get it to do some simple tasks while I'm away, primarily with the mouseclick function.

Func Off()

Sleep(1000)

MouseClick("left"[,x,y[,$a[,2]]])

Sleep(1000)

EndFunc ;==>Off

What I want to happen is a left mouseclick, how many times I want the mouseclick (which is variable $a), every 2 seconds. This is something I just created and I haven't field tested it yet. I'm not even sure it will work.

My previous script had been set up like...:

Func Off()

Do

Sleep(1000)

MouseClick("left")

Sleep(1000)

$a = $a + 1

Until $a = 14

EndFunc ;==>Off

But this was causing problems. Every time it would loop through a second time, it would just keep clicking and never stop for the next function.

If you all have any ideas concerning this autoit script, feel free!! Any help is greatly appreciated.

Thanks,

Brandon

Edited by Bmcn
Link to comment
Share on other sites

Hi everyone,

Very new to autoit. Trying to get it to do some simple tasks while I'm away, primarily with the mouseclick function.

Func Off()

Sleep(1000)

MouseClick("left"[,x,y[,$a[,2]]])

Sleep(1000)

EndFunc ;==>Off

What I want to happen is a left mouseclick, how many times I want the mouseclick (which is variable $a), every 2 seconds. This is something I just created and I haven't field tested it yet. I'm not even sure it will work.

My previous script had been set up like...:

Func Off()

Do

Sleep(1000)

MouseClick("left")

Sleep(1000)

$a = $a + 1

Until $a = 14

EndFunc ;==>Off

But this was causing problems. Every time it would loop through a second time, it would just keep clicking and never stop for the next function.

If you all have any ideas concerning this autoit script, feel free!! Any help is greatly appreciated.

Thanks,

Brandon

Just use a For/Next loop, i.e.
Func Off($a)
    For $n = 1 To $a
        ; Do mouse click, or something
    Next
EndFunc

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...