From ca184fbaedb8dead3302612544500af04efd5bc6 Mon Sep 17 00:00:00 2001 From: dtookey Date: Thu, 3 Aug 2023 12:11:44 -0400 Subject: [PATCH] EVEN BETTERER. I have to go play video games --- src/main/kotlin/Doer.kt | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/Doer.kt b/src/main/kotlin/Doer.kt index 5e78e88..93755d9 100644 --- a/src/main/kotlin/Doer.kt +++ b/src/main/kotlin/Doer.kt @@ -71,7 +71,26 @@ class Doer { * This holds the maximum x and y wiggle offset values to use when randomly * offsetting mouse movements to make them less robotic. * - * For example, this could be passed to [getAlmostPoint] to control the randomization. + * This class is used to encapsulate the parameters for defining the bounds of allowable click area when calling + * [getAlmostPoint]. The calculation may change over time, so the class is used to decouble the data from the logic. + * + * Usage Example: + * ``` + * func main(){ + * val doer = Doer() + * + * //we'll create a 100x100 box to click inside of + * val wiggleParams = WiggleParams(100, 100) + * + * //define the center + * val centerPoint = Point(100, 200) + * + * //get a random point from the allowable area + * val randomPoint = doer.getAlmostPoint(centerPoint, wiggleParams) + * + * println("centerPoint: {${centerPoint.x}, ${centerPoint.y}} vs {${randomPoint.x}, ${randomPoint.y}}") + * } + * ``` * * @param xWiggle The max x offset for both parities. So a xWiggle value of 5 will result in a value of x +/- 5, default 25. * @param yWiggle The max y offset for both parities. So a yWiggle value of 5 will result in a value of y +/- 5, default 25.