Hey, I'm a beginner and I've been looking for a code which can click on a random position within a range of set coordinates and sleep for a random amount of time within a range of time. The code I made only clicks on a specific coordinate and sleeps for a specific time.
f1::
MouseClick , Left , 10 , 19
sleep 600
MouseClick , Left , 565 , 180
sleep 600
MouseClick , Left , 289 , 199
sleep 600
Any help will be greatly appreciated.
Help with my AutoClicker Topic is solved
Re: Help with my AutoClicker
Use the Random function to generate a random number.
Let me know if you have any more questions.
Code: Select all
Random, OutputVar, Min, Max
Re: Help with my AutoClicker Topic is solved
wrap random in a function, then define another function for clicking, sleep accepts expressions, so it can be used as is, in conjunction with your wrapped random function
Code: Select all
q::
randClick(1, 1, 20, 20)
Sleep rand(300, 1000)
randClick(1, 1, 20, 20)
Return
rand(min, max) {
Random, rand, min, max
return rand
}
randClick(x1, y1, x2, y2) {
x := rand(x1, x2)
y := rand(y1, y2)
Click %x%, %y%
}
Re: Help with my AutoClicker
Hey, thanks for replying, I used your code below and it works great but I don't know what I'm doing wrong because on 'click 3' which I've added it doesn't seem to click on the right co-ordinate. Also how would I loop this entire code for a specific number of times? Thanks.swagfag wrote:wrap random in a function, then define another function for clicking, sleep accepts expressions, so it can be used as is, in conjunction with your wrapped random functionCode: Select all
q:: randClick(1, 1, 20, 20) Sleep rand(300, 1000) randClick(1, 1, 20, 20) Return rand(min, max) { Random, rand, min, max return rand } randClick(x1, y1, x2, y2) { x := rand(x1, x2) y := rand(y1, y2) Click %x%, %y% }
Code: Select all
q::
randClick(0, 0, 80, 80) ;click1
Sleep rand(300, 1000)
randClick(680, 1040, 730, 1060) ;click2
Sleep rand(300, 1000)
randClick(890, 100, 900, 110) ;click3
Return
rand(min, max) {
Random, rand, min, max
return rand
}
randClick(x1, y1, x2, y2) {
x := rand(x1, x2)
y := rand(y1, y2)
Click %x%, %y%
}
Re: Help with my AutoClicker
Hey, thanks for replying, I've implemented the random function into the code but was wondering how I would loop this entire code below for a specific number of times. Also 'click 3' doesn't seem to click on to the correct co-ordinate. Thanks.DyaTactic wrote:Use the Random function to generate a random number.Let me know if you have any more questions.Code: Select all
Random, OutputVar, Min, Max
Code: Select all
q::
randClick(0, 0, 80, 80) ;click1
Sleep rand(300, 1000)
randClick(680, 1040, 730, 1060) ;click2
Sleep rand(300, 1000)
randClick(890, 100, 900, 110) ;click3
Return
rand(min, max) {
Random, rand, min, max
return rand
}
randClick(x1, y1, x2, y2) {
x := rand(x1, x2)
y := rand(y1, y2)
Click %x%, %y%
}
Re: Help with my AutoClicker
check the CoordMode function and select a mode accordingly.
Re: Help with my AutoClicker
Looping like this?
Code: Select all
q::
Loop, 3 ; Repeat 3 times.
{
randClick(0, 0, 80, 80) ;click1
Sleep rand(300, 1000)
randClick(680, 1040, 730, 1060) ;click2
Sleep rand(300, 1000)
randClick(890, 100, 900, 110) ;click3
}
Return
Re: Help with my AutoClicker
Yup that works fine and I figured out the problem with click 3 thanks a lot for the help.DyaTactic wrote:Looping like this?Code: Select all
q:: Loop, 3 ; Repeat 3 times. { randClick(0, 0, 80, 80) ;click1 Sleep rand(300, 1000) randClick(680, 1040, 730, 1060) ;click2 Sleep rand(300, 1000) randClick(890, 100, 900, 110) ;click3 } Return
Re: Help with my AutoClicker
You're most welcome
Who is online
Users browsing this forum: No registered users and 221 guests