Hi, I'm in the process of making a script that utilises RandomBezier's random mouse movement and I ran into a little problem whilst building it.
The script, of course, works as intended, but for the life of me I can't figure out how to have the end position of the cursor randomised instead of sitting in the same X/Y coords every single time. Beforehand I'd been playing around with the random line-
Random, a, 767,777
Random, b, 755,765
Is there a way to apply this to the end result of RandomBezier's script? Is it staring me right in the face?
Any help would be greatly appreciated.
Link to his work- https://autohotkey.com/board/topic/8504 ... zier-path/
Randomised RandomBezier's code?
Re: Randomised RandomBezier's code?
A simple fix would simply to add a random value to your final x/y pos
Code: Select all
RandomBezier( 0, 0, x+random(-10,10), y+random(-10,10), "" ) ;if your x was 500 this would end at 490-510, same as y
Random(min,max=100) {
random,result,min,max
return result
}
Some of my AHK programs: 3D Voxel Game - Platformer Game
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
Re: Randomised RandomBezier's code?
Ahah, this is what I was looking for. The script i'm trying to make would utilise many of the RandomBezier code lines, and each one would of course need it's own random end point, or would it?
After every would there need to be a
or does there just have to be one present in the entire script for each RandomBezier to pull from?
After every
Code: Select all
RandomBezier( 0, 0, x+random(-10,10), y+random(-10,10)
Code: Select all
Random(min,max=100) {
random,result,min,max
return result
}
Re: Randomised RandomBezier's code?
Correct, as long as it is present somewhere within your script, you can use the user defined function Random().Manjack40 wrote:does there just have to be one present in the entire script for each RandomBezier to pull from?
Some of my AHK programs: 3D Voxel Game - Platformer Game
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
Re: Randomised RandomBezier's code?
Alright, thanks a tonne for the help so quickly. I was scratching my head at it for the longest time, I'm still a little new to AHK, but it's an amazing tool really.
Who is online
Users browsing this forum: Google [Bot] and 306 guests