From b4b56f4e1fcc99d49ad3c2a3cce0bf6e85e437c1 Mon Sep 17 00:00:00 2001 From: dtookey Date: Fri, 22 Sep 2023 07:11:32 -0400 Subject: [PATCH] syncing up a few tweaks to entries --- .idea/misc.xml | 1 - src/main/kotlin/entries/FurnaceEntry.kt | 2 +- src/main/kotlin/entries/HighAlch.kt | 10 ++++ src/main/kotlin/entries/IncenseEntry.kt | 8 +++ .../game_logic/runescape/RunescapeRoutines.kt | 59 ++++++++++++++++--- 5 files changed, 71 insertions(+), 9 deletions(-) create mode 100644 src/main/kotlin/entries/HighAlch.kt create mode 100644 src/main/kotlin/entries/IncenseEntry.kt diff --git a/.idea/misc.xml b/.idea/misc.xml index 24a2080..9bde07d 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/src/main/kotlin/entries/FurnaceEntry.kt b/src/main/kotlin/entries/FurnaceEntry.kt index 3a114f4..3e8a632 100644 --- a/src/main/kotlin/entries/FurnaceEntry.kt +++ b/src/main/kotlin/entries/FurnaceEntry.kt @@ -4,5 +4,5 @@ import game_logic.runescape.RunescapeRoutines fun main() { - RunescapeRoutines.processInventoryAtFurnace(2137) + RunescapeRoutines.processInventoryAtFurnace(2077) } \ No newline at end of file diff --git a/src/main/kotlin/entries/HighAlch.kt b/src/main/kotlin/entries/HighAlch.kt new file mode 100644 index 0000000..eb19364 --- /dev/null +++ b/src/main/kotlin/entries/HighAlch.kt @@ -0,0 +1,10 @@ +package entries + +import game_logic.runescape.RunescapeRoutines + + +fun main(){ + val natureRunes = 15331 + val necklaces = 4948 + RunescapeRoutines.highAlchInvPoint(Math.min(natureRunes, necklaces)) +} \ No newline at end of file diff --git a/src/main/kotlin/entries/IncenseEntry.kt b/src/main/kotlin/entries/IncenseEntry.kt new file mode 100644 index 0000000..7ce392a --- /dev/null +++ b/src/main/kotlin/entries/IncenseEntry.kt @@ -0,0 +1,8 @@ +package entries + +import game_logic.runescape.RunescapeRoutines + + +fun main() { + RunescapeRoutines.fullRunIncense(0,0, 46, 23) +} \ No newline at end of file diff --git a/src/main/kotlin/game_logic/runescape/RunescapeRoutines.kt b/src/main/kotlin/game_logic/runescape/RunescapeRoutines.kt index ad77ed0..c73b046 100644 --- a/src/main/kotlin/game_logic/runescape/RunescapeRoutines.kt +++ b/src/main/kotlin/game_logic/runescape/RunescapeRoutines.kt @@ -1,8 +1,12 @@ package game_logic.runescape + +import controllers.PointerVarianceBounds import params.StandingTaskParams import params.TravelTaskParams import util.HelperFunctions import java.awt.Point +import java.awt.event.ActionEvent +import java.awt.event.InputEvent import java.awt.event.KeyEvent /** @@ -105,7 +109,11 @@ object RunescapeRoutines { * @param bankPoint Optional. The Point location of the bank to use. * */ - fun cleanHerbs(volume: Int, agent: RSOrchestrator = RSOrchestrator.getInstance(), bankPoint: Point = agent.getBankPoint()) { + fun cleanHerbs( + volume: Int, + agent: RSOrchestrator = RSOrchestrator.getInstance(), + bankPoint: Point = agent.getBankPoint() + ) { val params = StandingTaskParams( volume, util.Constants.FullInventory, @@ -127,7 +135,11 @@ object RunescapeRoutines { * @param bankPoint Optional. The Point location of the bank to use. * */ - fun cutIncenseSticks(volume: Int, agent: RSOrchestrator = RSOrchestrator.getInstance(), bankPoint: Point = agent.getBankPoint()) { + fun cutIncenseSticks( + volume: Int, + agent: RSOrchestrator = RSOrchestrator.getInstance(), + bankPoint: Point = agent.getBankPoint() + ) { val params = StandingTaskParams( volume, util.Constants.FullInventory, @@ -149,7 +161,11 @@ object RunescapeRoutines { * @param bankPoint Optional Point location of the bank to use. * */ - fun coatIncenseSticks(volume: Int, agent: RSOrchestrator = RSOrchestrator.getInstance(), bankPoint: Point = agent.getBankPoint()) { + fun coatIncenseSticks( + volume: Int, + agent: RSOrchestrator = RSOrchestrator.getInstance(), + bankPoint: Point = agent.getBankPoint() + ) { val params = StandingTaskParams( volume, util.Constants.CoatingIncenseWithAsh, @@ -169,7 +185,11 @@ object RunescapeRoutines { * @param agent Optional Agent instance to use for banking actions. * @param bankPoint Optional Point location of the bank to use. */ - fun infuseIncenseSticks(volume: Int, agent: RSOrchestrator = RSOrchestrator.getInstance(), bankPoint: Point = agent.getBankPoint()) { + fun infuseIncenseSticks( + volume: Int, + agent: RSOrchestrator = RSOrchestrator.getInstance(), + bankPoint: Point = agent.getBankPoint() + ) { val params = StandingTaskParams( volume, util.Constants.InfusingIncenseWithHerb, @@ -193,7 +213,11 @@ object RunescapeRoutines { * @deprecated This method needs validation before use in production. */ @Deprecated("Needs validation before you use it for realsies") - fun craftPotionAtBank(volume: Int, agent: RSOrchestrator = RSOrchestrator.getInstance(), bankPoint: Point = agent.getBankPoint()) { + fun craftPotionAtBank( + volume: Int, + agent: RSOrchestrator = RSOrchestrator.getInstance(), + bankPoint: Point = agent.getBankPoint() + ) { val params = StandingTaskParams( volume, util.Constants.FullInventory, @@ -272,6 +296,23 @@ object RunescapeRoutines { RSOrchestrator.doTravelTask(agent, params) } + fun highAlchInvPoint(volume: Int) { + val agent = RSOrchestrator.getInstance() + val invSlot = agent.promptUserForPoint("Place mouse over stack you'd like to high alch") + + val highAlchSleep = 16L * 3L + + + agent.doLoop(volume, 1) { + agent.automaton.keyPress(KeyEvent.VK_MINUS) + agent.sleepForNTicks(1) + agent.automaton.moveMouse(agent.automaton.getNearbyPoint(invSlot, PointerVarianceBounds(5, 5))) + agent.sleepForNTicks(1) + agent.automaton.mouseClick(InputEvent.BUTTON1_DOWN_MASK) + agent.sleepForNTicks(1) + } + } + /** * Crafts a specified volume of necromancy ink at the bank. * @@ -283,10 +324,14 @@ object RunescapeRoutines { * @param agent The orchestrator instance to use, defaults to global instance * @param bankPoint The tile position of the bank booth to use */ - fun createNecromancyInk(volume: Int, agent: RSOrchestrator = RSOrchestrator.getInstance(), bankPoint: Point = agent.getBankPoint()) { + fun createNecromancyInk( + volume: Int, + agent: RSOrchestrator = RSOrchestrator.getInstance(), + bankPoint: Point = agent.getBankPoint() + ) { val params = StandingTaskParams( volume, - 20*13, + 20 * 13, bankPoint, KeyEvent.VK_F6, KeyEvent.VK_MINUS,