Hey, I want to make script that would do:
• HOLDS Alt, and presses with Mouse left click on certain location random between x and y (I put the picture to make it clear what I want) which I would set
I want that I would press for example G:: and it would hold Alt while pressing on the box random location, just inside what parameters I give.
Maybe anyone haves already done it something similar and could share?
Asking for a huge help
Re: Asking for a huge help
Code: Select all
MouseGetPos, xpos, ypos
ToolTip, % "X : " . xpos . "`nY : " ypos
F2::Reload ;To choose the coordinates Max and Min
F1:: ;Lunch the script
Random, X, Max, Min ;Replace the Max and Min Found values eg : Random, X, 100, 500
Random, Y, Max, Min
MouseMove, %X%, %Y%, 100
Sleep,10
Send, !{Click ,%X%, %Y%}
return
Re: Asking for a huge help
Perhaps this?
Code: Select all
#SingleInstance, Force
Coordmode, Mouse, Window ;Change as needed.
Positions := [{X1:0,Y1:300,X2:30,Y2:350},{X1:60,Y1:300,X2:90,Y2:350},{X1:120,Y1:300,X2:150,Y2:350},{X1:180,Y1:300,X2:210,Y2:350}] ;Change positions as needed.
return
Ran(Min,Max){
Random,Out,Min,Max
return Out
}
g::
Send, {Alt Down}
MouseClick,,Ran(Positions[out:=Ran(1,4)].X1,Positions[out].X2),Ran(Positions[out].Y1,Positions[out].Y2)
Send, {Alt Up}
return
*ESC::ExitApp
Re: Asking for a huge help
Thanks first of all, I edited something wrong or the script is not what I asked, I don't want to random click on those boxes I want that random would be the click inside the box, everytime I would execute, everytime it would be random position where it would click, just inside that boxHellbent wrote: ↑02 Apr 2020, 15:37Perhaps this?
Code: Select all
#SingleInstance, Force Coordmode, Mouse, Window ;Change as needed. Positions := [{X1:0,Y1:300,X2:30,Y2:350},{X1:60,Y1:300,X2:90,Y2:350},{X1:120,Y1:300,X2:150,Y2:350},{X1:180,Y1:300,X2:210,Y2:350}] ;Change positions as needed. return Ran(Min,Max){ Random,Out,Min,Max return Out } g:: Send, {Alt Down} MouseClick,,Ran(Positions[out:=Ran(1,4)].X1,Positions[out].X2),Ran(Positions[out].Y1,Positions[out].Y2) Send, {Alt Up} return *ESC::ExitApp
I put an example, also I want a loop that would execute click on one box random inside somewhere in that square, another, third and would stop.
Thanks for help, im trying to also edit some scripts but I can't make it..
Re: Asking for a huge help
Barney15 wrote: ↑02 Apr 2020, 15:32see if this works for you.Code: Select all
MouseGetPos, xpos, ypos ToolTip, % "X : " . xpos . "`nY : " ypos F2::Reload ;To choose the coordinates Max and Min F1:: ;Lunch the script Random, X, Max, Min ;Replace the Max and Min Found values eg : Random, X, 100, 500 Random, Y, Max, Min MouseMove, %X%, %Y%, 100 Sleep,10 Send, !{Click ,%X%, %Y%} return
this one seems works, what I just need how can I add three more rows and loop it ?
Re: Asking for a huge help
Code: Select all
MouseGetPos, xpos, ypos
ToolTip, % "X : " . xpos . "`nY : " ypos
F2::Reload ;To choose the coordinates Max and Min
F1:: ;Lunch the script
Loop, 3 ; repeat this 3 times
{
Random, X, Max, Min ;Replace the Max and Min Found values eg : Random, X, 100, 500
Random, Y, Max, Min
MouseMove, %X%, %Y%, 100
Sleep,10
Send, !{Click ,%X%, %Y%}
}
return
if you want them to be constant move Random x and Y out of the loop.
Who is online
Users browsing this forum: No registered users and 348 guests