Randomizing path from point A to point B to point C, etc.

Ask gaming related questions (AHK v1.1 and older)
0kcaj
Posts: 1
Joined: 25 Feb 2020, 20:09

Randomizing path from point A to point B to point C, etc.

25 Feb 2020, 20:39

So I successfully made a perfectly working script that goes to point A, clicks, sleeps, moves to point B, clicks, sleeps, etc. you get the idea. Coordinates of every click is randomized, same for sleep times and movement speed of mouse. I have 5 points in total.


What I'm missing is randomized path from point to point and I want to be able to get more randomized humanlike pathing, but I have no idea what to do after googling about it for about 15 minutes. Right now, I just get a straight line from point to point. Any ideas? Is there something simple that I can just add after each MouseClick?


Thanks in advance for help.



Here's a snippet from the script, it's pretty much the same just different numbers for all of the points.

Code: Select all

Random i, 215, 332

Random x, 850, 870

Random y, 780, 800

Random s, 5, 11

MouseClick, left, x , y, 1, s

Sleep, %i%
Rohwedder
Posts: 7740
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Randomizing path from point A to point B to point C, etc.

02 Mar 2020, 15:16

Hallo,
try:

Code: Select all

CoordMode, Mouse, Screen
q::
HumanMouseMove(100,200)
HumanMouseMove(1000,800)
HumanMouseMove(950,950)
HumanMouseMove(100,900)
HumanMouseMove(50,950)
HumanMouseMove(900,200)
Return
HumanMouseMove(x2,y2)
{
	MouseGetPos,x,y
	V := 15, VF := .9
	R := Sqrt((x2-x)*(x2-x)+(y2-y)*(y2-y)), RF := .8
	Random, RX, -R, R
	Random, RY, -R, R
	MouseGetPos,x,y
	While, Abs(x2-x) + Abs(y2-y) > 4
	{
		MouseMove,(x2-x+RX*=RF)/V,(y2-y+RY*=RF)/V*=VF,0,R
		MouseGetPos,x,y
	}
	Return
}

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 36 guests