Is it possible to click somewhere within a certain range? Topic is solved
-
- Posts: 2
- Joined: 13 Jun 2020, 10:07
Is it possible to click somewhere within a certain range?
Hi, I just started using ahk today and I'm catching on very quickly, but there's something I just can't figure out. Is it even possible to click somewhere random within a certain range? Thanks!
- Yakshongas
- Posts: 590
- Joined: 21 Jan 2020, 08:41
Re: Is it possible to click somewhere within a certain range? Topic is solved
Here is a way to do it:
Code: Select all
F1::
MouseMove, RandomPos1(1,100), RandomPos2(1,150)
Click
Return
RandomPos1(MinX, MaxX)
{
Random, ClickX, MinX, MaxX
Return ClickX
}
RandomPos2(MinY, MaxY)
{
Random, ClickY, MinY, MaxY
Return CLickY
}
Please mark your topics as solved if you don't need any further help.
Need a little more help? Discord : Yakshongas#9893 🕹
Need a little more help? Discord : Yakshongas#9893 🕹
Re: Is it possible to click somewhere within a certain range?
There isn’t a reason for two different functions that are identical other than their internal variable names, which don’t make any functional difference. Could (and should) just be this:
Code: Select all
F1::
MouseMove, Random(1,100), Random(1,150)
Click
Return
Random(Min, Max)
{
Random, Num, Min, Max
Return Num
}
Who is online
Users browsing this forum: Billykid and 172 guests