Jump to content
Sign in to follow this  
nick21

autoclick within an allowed area question

Recommended Posts

nick21

If I want it to autoclick left a selected area how would I go about doing that.

For example I want it to click this area:

; top left corner
MouseClick ("left",152,130)
; top right corner
MouseClick ("left",796,130)
; bottom right corner
MouseClick ("left",796,620)
; bottom left corner
MouseClick ("left",152, 620)

any help would be great

Thank you,

nick21

Share this post


Link to post
Share on other sites
daniel02

Hi,

perhaps this could help?

$a=30 ; x position
$b=740; y position
    
 while $a < 80 and $b < 1050        
  $a= $a + 1
    If $a > 79 Then
    $a=30
    $b = $b +1
    EndIf
   MouseClick ("left", $a, $b)
 Wend

Code not tested.

Cheers

Daniel

Edited by daniel02

Share this post


Link to post
Share on other sites
jebus495

If I want it to autoclick left a selected area how would I go about doing that.

For example I want it to click this area:

; top left corner
MouseClick ("left",152,130)
; top right corner
MouseClick ("left",796,130)
; bottom right corner
MouseClick ("left",796,620)
; bottom left corner
MouseClick ("left",152, 620)

any help would be great

Thank you,

nick21

Just in case you want it to randomly click a bunch of times in a set area then...

Local $Clicks = 0
Do
$Clicks += 1
MouseClick("left", Random(152,796), Random(130,620))
Until $Clicks = 5

I wouldn't have bothered but since it seems you're fairly new I figured this would be a good script because it seems in line with what you'll probably be using AutoIt for in the future.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.