diff --git a/src/main/kotlin/Doer.kt b/src/main/kotlin/Doer.kt index 92dd786..de84949 100644 --- a/src/main/kotlin/Doer.kt +++ b/src/main/kotlin/Doer.kt @@ -12,7 +12,7 @@ class Doer(val r: Robot) { val yWiggle = 15; } - public fun doLoop(volume: Int, step: Int, task: (Doer)->Unit){ + fun doLoop(volume: Int, step: Int, task: (Doer)->Unit){ val r = Doer(Robot()) val totalSteps =(ceil((volume/step).toDouble()) +1).toInt() @@ -21,7 +21,7 @@ class Doer(val r: Robot) { report(i+1, totalSteps, System.currentTimeMillis() - start) task(this) } - + println() val finish = System.currentTimeMillis() println("Finished everything in ${prettyTimeString(finish - start)}") r.drawStar(getPointerLocationAfter(0)) diff --git a/src/main/kotlin/Entry.kt b/src/main/kotlin/Entry.kt index f29feef..e25fce0 100644 --- a/src/main/kotlin/Entry.kt +++ b/src/main/kotlin/Entry.kt @@ -8,6 +8,6 @@ import kotlin.math.ceil import kotlin.random.Random fun main() { - Routines.potionGrindWithWell(5100, 14) + Routines.potionGrindWithWell(2000) } diff --git a/src/main/kotlin/Routines.kt b/src/main/kotlin/Routines.kt index 46482e7..68b1ea3 100644 --- a/src/main/kotlin/Routines.kt +++ b/src/main/kotlin/Routines.kt @@ -3,7 +3,8 @@ import java.awt.Robot object Routines { - fun cleanHerbs(volume: Int, step: Int){ + fun cleanHerbs(volume: Int, step: Int = 14){ + val step = 28; val r = Doer(Robot()) println("Put your mouse over the bank...") val chest = r.getPointerLocationAfter(3000L) @@ -13,7 +14,7 @@ object Routines { } - fun potionGrind(volume: Int, step: Int){ + fun potionGrind(volume: Int, step: Int = 14){ val r = Doer(Robot()) println("Put your mouse over the bank...") val chest = r.getPointerLocationAfter(3000L) @@ -22,9 +23,8 @@ object Routines { } } - fun potionGrindWithWell(volume: Int, step: Int){ + fun potionGrindWithWell(volume: Int, step: Int = 14){ val r = Doer(Robot()) - println("Put your mouse over the bank...") val chest = r.getPointerLocationAfter(3000L) println("Put your mouse over the well...") @@ -34,7 +34,7 @@ object Routines { } } - fun furnaceGrind(volume: Int, step: Int){ + fun furnaceGrind(volume: Int, step: Int = 28){ val r = Doer(Robot()) println("Reset the camera and zoom in") r.sleep(1000) @@ -68,7 +68,7 @@ object Routines { } } - fun supremeOverloadGrind(volume: Int, step: Int){ + fun supremeOverloadGrind(volume: Int, step: Int = 4){ val r = Doer(Robot()) println("Place mouse over chest") val chestPoint = r.getPointerLocationAfter(3000L) diff --git a/src/main/kotlin/Tasks.kt b/src/main/kotlin/Tasks.kt index 3fd36a3..3f43a33 100644 --- a/src/main/kotlin/Tasks.kt +++ b/src/main/kotlin/Tasks.kt @@ -23,46 +23,41 @@ object Tasks { d.mouseMove(chest) d.sleep(100, 0, 100) d.click(InputEvent.BUTTON1_DOWN_MASK) - d.sleep(600, 0, 800) + d.sleep(800, 100, 500) d.keypress(KeyEvent.VK_F6) - d.sleep(600, 0, 800) - d.keypress(KeyEvent.VK_EQUALS) - d.sleep(600, 0, 800) + d.sleep(800, 100, 500) + d.keypress(KeyEvent.VK_MINUS) + d.sleep(800, 0, 500) } fun makePotions(d: Doer, chest: Point) { d.mouseMove(d.getAlmostPoint(chest)) d.click(InputEvent.BUTTON1_DOWN_MASK) - d.sleep(Random.nextInt(1300, 1600).toLong()) + d.sleep(1200, 100, 500) d.keypress(KeyEvent.VK_F6) - d.sleep(Random.nextInt(1000, 1500).toLong()) + d.sleep(1200, 100, 500) - d.keypress(KeyEvent.VK_EQUALS) - val sleepDur = Random.nextInt(1000, 1500).toLong() - d.sleep(sleepDur) + d.keypress(KeyEvent.VK_MINUS) + d.sleep(1200, 100, 500) d.keypress(KeyEvent.VK_SPACE) - if (sleepDur < 1200) { - d.sleep(Random.nextInt(600, 1200).toLong()) - d.keypress(KeyEvent.VK_SPACE) - } - d.sleep(17000L, 500, 1000) + d.sleep(18600L, 600, 1200) } fun makePotions(d: Doer, chest: Point, well: Point) { d.mouseMove(d.getAlmostPoint(chest)) d.click(InputEvent.BUTTON1_DOWN_MASK) - d.sleep(1000, 600, 1000) + d.sleep(800, 100, 500) d.keypress(KeyEvent.VK_F6) - d.sleep(1000, 50, 500) + d.sleep(800, 100, 500) d.mouseMove(well) d.sleep(100, 0, 50) d.click(InputEvent.BUTTON1_DOWN_MASK) - d.sleep(1500, 0, 500) + d.sleep(800, 100, 500) d.keypress(KeyEvent.VK_SPACE)