that was a lie, now everything has a kdoc
This commit is contained in:
parent
18e243a431
commit
79f1e9e0ce
@ -1,6 +1,19 @@
|
|||||||
import java.awt.Point
|
import java.awt.Point
|
||||||
import java.awt.event.KeyEvent
|
import java.awt.event.KeyEvent
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Routines contains utility functions to perform common bot tasks and workflows.
|
||||||
|
*
|
||||||
|
* This includes functions like:
|
||||||
|
* - fullRunIncense: Handles the full incense stick crafting workflow.
|
||||||
|
* - processInventoryAtFurnace: Processes a total volume of inventory at a furnace near the bank.
|
||||||
|
* - processRefinedPlanksIntoFrames:Processes refined planks into frames at a sawmill near the bank.
|
||||||
|
*
|
||||||
|
* The routines use an Agent instance to perform actions like banking,
|
||||||
|
* depositing items, withdrawing presets, etc.
|
||||||
|
*
|
||||||
|
* The routines are encapsulated for pure convenience
|
||||||
|
*/
|
||||||
object Routines {
|
object Routines {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -21,7 +34,9 @@ object Routines {
|
|||||||
* actions at the bank. The bank location is prompted from the user.
|
* actions at the bank. The bank location is prompted from the user.
|
||||||
*
|
*
|
||||||
* Progress is printed after each step. Total elapsed time is printed at the end.
|
* Progress is printed after each step. Total elapsed time is printed at the end.
|
||||||
|
* @deprecated Needs validation before using for real, as sawmill points are hardcoded
|
||||||
*/
|
*/
|
||||||
|
@Deprecated("Needs validation before you use it for realsies")
|
||||||
fun fullRunIncense(volHerbs: Int, volLogs: Int, volAshes: Int, volCleanHerbs: Int) {
|
fun fullRunIncense(volHerbs: Int, volLogs: Int, volAshes: Int, volCleanHerbs: Int) {
|
||||||
val agent = Agent()
|
val agent = Agent()
|
||||||
val start = System.currentTimeMillis()
|
val start = System.currentTimeMillis()
|
||||||
@ -30,36 +45,28 @@ object Routines {
|
|||||||
// Loop to clean grimy herbs:
|
// Loop to clean grimy herbs:
|
||||||
// Withdraw herb preset, clean without dialog at bank
|
// Withdraw herb preset, clean without dialog at bank
|
||||||
if (volHerbs > 0) {
|
if (volHerbs > 0) {
|
||||||
agent.doLoop(volHerbs, 28) {
|
cleanHerbs(volHerbs, agent = agent, chest = chest)
|
||||||
agent.bankStandWithoutDialog(chest, KeyEvent.VK_F1, KeyEvent.VK_1)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
println("\rHerbs cleaned")
|
println("\rHerbs cleaned")
|
||||||
|
|
||||||
// Loop to cut magic logs into sticks:
|
// Loop to cut magic logs into sticks:
|
||||||
// Withdraw log preset, cut logs using hotkey at bank
|
// Withdraw log preset, cut logs using hotkey at bank
|
||||||
if (volLogs > 0) {
|
if (volLogs > 0) {
|
||||||
agent.doLoop(volLogs, 26) {
|
cutIncenseSticks(volLogs, agent = agent, chest = chest)
|
||||||
agent.bankStandForLoop(chest, KeyEvent.VK_F2, KeyEvent.VK_2, 26000, 1200)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
println("\rLogs cut into sticks")
|
println("\rLogs cut into sticks")
|
||||||
|
|
||||||
// Loop to coat sticks in ashes:
|
// Loop to coat sticks in ashes:
|
||||||
// Withdraw ash preset, coat sticks using hotkey at bank
|
// Withdraw ash preset, coat sticks using hotkey at bank
|
||||||
if (volAshes > 0) {
|
if (volAshes > 0) {
|
||||||
agent.doLoop(volAshes, 26) {
|
coatIncenseSticks(volAshes, agent = agent, chest = chest)
|
||||||
agent.bankStandForLoop(chest, KeyEvent.VK_F3, KeyEvent.VK_3, 21000, 600)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
println("\rSticks coated in ashes")
|
println("\rSticks coated in ashes")
|
||||||
|
|
||||||
// Loop to infuse clean herbs into sticks:
|
// Loop to infuse clean herbs into sticks:
|
||||||
// Withdraw herb preset, infuse sticks using hotkey at bank
|
// Withdraw herb preset, infuse sticks using hotkey at bank
|
||||||
if (volCleanHerbs > 0) {
|
if (volCleanHerbs > 0) {
|
||||||
agent.doLoop(volCleanHerbs, 27) {
|
infuseIncenseSticks(volCleanHerbs, agent = agent, chest = chest)
|
||||||
agent.bankStandForLoop(chest, KeyEvent.VK_F4, KeyEvent.VK_4, 48600, 600)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
println("\rClean herbs infused")
|
println("\rClean herbs infused")
|
||||||
|
|
||||||
@ -81,10 +88,10 @@ object Routines {
|
|||||||
*
|
*
|
||||||
* Inside the loop, it withdraws the herb cleaning preset and activates
|
* Inside the loop, it withdraws the herb cleaning preset and activates
|
||||||
* the cleaning without additional dialog boxes.
|
* the cleaning without additional dialog boxes.
|
||||||
|
* @deprecated Needs validation before using for real, as sawmill points are hardcoded
|
||||||
*/
|
*/
|
||||||
fun cleanHerbs(totalVolume: Int, volumePerStep: Int = 14) {
|
@Deprecated("Needs validation before you use it for realsies")
|
||||||
val agent = Agent()
|
fun cleanHerbs(totalVolume: Int, volumePerStep: Int = 14, agent: Agent = Agent(), chest: Point = agent.getBankPoint()) {
|
||||||
val chest = agent.getBankPoint()
|
|
||||||
agent.doLoop(totalVolume, volumePerStep) {
|
agent.doLoop(totalVolume, volumePerStep) {
|
||||||
agent.bankStandWithoutDialog(chest, KeyEvent.VK_F1, KeyEvent.VK_1)
|
agent.bankStandWithoutDialog(chest, KeyEvent.VK_F1, KeyEvent.VK_1)
|
||||||
}
|
}
|
||||||
@ -104,8 +111,10 @@ object Routines {
|
|||||||
*
|
*
|
||||||
* Inside the loop, it withdraws the log cutting preset and cuts the logs into
|
* Inside the loop, it withdraws the log cutting preset and cuts the logs into
|
||||||
* sticks using the specified hotkeys.
|
* sticks using the specified hotkeys.
|
||||||
|
* @deprecated Needs validation before using for real, as sawmill points are hardcoded
|
||||||
*/
|
*/
|
||||||
fun cutIncenseSticks(totalVolume: Int, volumePerStep: Int = 28) {
|
@Deprecated("Needs validation before you use it for realsies")
|
||||||
|
fun cutIncenseSticks(totalVolume: Int, volumePerStep: Int = 28, agent: Agent = Agent(), chest: Point = agent.getBankPoint()) {
|
||||||
val agent = Agent()
|
val agent = Agent()
|
||||||
|
|
||||||
val chest = agent.getBankPoint()
|
val chest = agent.getBankPoint()
|
||||||
@ -129,8 +138,10 @@ object Routines {
|
|||||||
*
|
*
|
||||||
* Inside the loop, it withdraws the ash coating preset and coats the sticks
|
* Inside the loop, it withdraws the ash coating preset and coats the sticks
|
||||||
* using the specified hotkeys.
|
* using the specified hotkeys.
|
||||||
|
* @deprecated Needs validation before using for real, as sawmill points are hardcoded
|
||||||
*/
|
*/
|
||||||
fun coatIncenseSticks(totalVolume: Int, volumePerStep: Int = 26) {
|
@Deprecated("Needs validation before you use it for realsies")
|
||||||
|
fun coatIncenseSticks(totalVolume: Int, volumePerStep: Int = 26, agent: Agent = Agent(), chest: Point = agent.getBankPoint()) {
|
||||||
val agent = Agent()
|
val agent = Agent()
|
||||||
|
|
||||||
val chest = agent.getBankPoint()
|
val chest = agent.getBankPoint()
|
||||||
@ -154,8 +165,10 @@ object Routines {
|
|||||||
*
|
*
|
||||||
* Inside the loop, it withdraws the herb infusing preset and infuses the sticks
|
* Inside the loop, it withdraws the herb infusing preset and infuses the sticks
|
||||||
* using the specified hotkeys.
|
* using the specified hotkeys.
|
||||||
|
* @deprecated Needs validation before using for real, as sawmill points are hardcoded
|
||||||
*/
|
*/
|
||||||
fun infuseIncenseSticks(totalVolume: Int, volumePerStep: Int = 27) {
|
@Deprecated("Needs validation before you use it for realsies")
|
||||||
|
fun infuseIncenseSticks(totalVolume: Int, volumePerStep: Int = 27, agent: Agent = Agent(), chest: Point = agent.getBankPoint()) {
|
||||||
val agent = Agent()
|
val agent = Agent()
|
||||||
|
|
||||||
|
|
||||||
@ -178,8 +191,10 @@ object Routines {
|
|||||||
*
|
*
|
||||||
* Inside the loop, it withdraws the potion crafting preset and crafts
|
* Inside the loop, it withdraws the potion crafting preset and crafts
|
||||||
* using the crafting hotkey which doesn't produce a dialogue box.
|
* using the crafting hotkey which doesn't produce a dialogue box.
|
||||||
|
* @deprecated Needs validation before using for real, as sawmill points are hardcoded
|
||||||
*/
|
*/
|
||||||
fun craftPotionAtBank(totalVolume: Int, volumePerStep: Int = 14) {
|
@Deprecated("Needs validation before you use it for realsies")
|
||||||
|
fun craftPotionAtBank(totalVolume: Int, volumePerStep: Int = 14, agent: Agent = Agent(), chest: Point = agent.getBankPoint()) {
|
||||||
val agent = Agent()
|
val agent = Agent()
|
||||||
|
|
||||||
val chest = agent.getBankPoint()
|
val chest = agent.getBankPoint()
|
||||||
@ -207,8 +222,10 @@ object Routines {
|
|||||||
* After creating the potions, it banks again before the next iteration.
|
* After creating the potions, it banks again before the next iteration.
|
||||||
*
|
*
|
||||||
* The travelDurationInMillis parameter allows configuring the travel time between the bank and the well.
|
* The travelDurationInMillis parameter allows configuring the travel time between the bank and the well.
|
||||||
|
* @deprecated Needs validation before using for real, as sawmill points are hardcoded
|
||||||
*/
|
*/
|
||||||
fun potionGrindWithWell(totalVolume: Int, volumePerStep: Int = 14, travelDurationInMillis: Long = 0) {
|
@Deprecated("Needs validation before you use it for realsies")
|
||||||
|
fun potionGrindWithWell(totalVolume: Int, volumePerStep: Int = 14, travelDurationInMillis: Long = 0, agent: Agent = Agent(), chest: Point = agent.getBankPoint()) {
|
||||||
val agent = Agent()
|
val agent = Agent()
|
||||||
|
|
||||||
val chest = agent.getBankPoint()
|
val chest = agent.getBankPoint()
|
||||||
@ -236,8 +253,10 @@ object Routines {
|
|||||||
* using the well.
|
* using the well.
|
||||||
*
|
*
|
||||||
* After crafting finishes, it banks again before the next iteration.
|
* After crafting finishes, it banks again before the next iteration.
|
||||||
|
* @deprecated Needs validation before using for real, as sawmill points are hardcoded
|
||||||
*/
|
*/
|
||||||
fun supremeOverloadGrind(totalVolume: Int, volumePerStep: Int = 4) {
|
@Deprecated("Needs validation before you use it for realsies")
|
||||||
|
fun supremeOverloadGrind(totalVolume: Int, volumePerStep: Int = 4, agent: Agent = Agent(), chest: Point = agent.getBankPoint()) {
|
||||||
val agent = Agent()
|
val agent = Agent()
|
||||||
val chest = agent.getBankPoint()
|
val chest = agent.getBankPoint()
|
||||||
val well = agent.promptUserForPoint("Put your mouse over the well...")
|
val well = agent.promptUserForPoint("Put your mouse over the well...")
|
||||||
@ -263,8 +282,10 @@ object Routines {
|
|||||||
* process hotkey, and travels back to the bank before the next iteration.
|
* process hotkey, and travels back to the bank before the next iteration.
|
||||||
*
|
*
|
||||||
* The camera is reset before starting.
|
* The camera is reset before starting.
|
||||||
|
* @deprecated Needs validation before using for real, as sawmill points are hardcoded
|
||||||
*/
|
*/
|
||||||
fun processInventoryAtFurnace(totalVolume: Int, volumePerStep: Int = 28) {
|
@Deprecated("Needs validation before you use it for realsies")
|
||||||
|
fun processInventoryAtFurnace(totalVolume: Int, volumePerStep: Int = 28, agent: Agent = Agent(), chest: Point = agent.getBankPoint()) {
|
||||||
val agent = Agent()
|
val agent = Agent()
|
||||||
println("Reset the camera")
|
println("Reset the camera")
|
||||||
agent.scrollOutToHeight(8)
|
agent.scrollOutToHeight(8)
|
||||||
@ -294,7 +315,7 @@ object Routines {
|
|||||||
* @deprecated Needs validation before using for real, as sawmill points are hardcoded
|
* @deprecated Needs validation before using for real, as sawmill points are hardcoded
|
||||||
*/
|
*/
|
||||||
@Deprecated("Needs validation before you use it for realsies")
|
@Deprecated("Needs validation before you use it for realsies")
|
||||||
fun processRefinedPlanksIntoFrames(totalVolume: Int, volumePerStep: Int) {
|
fun processRefinedPlanksIntoFrames(totalVolume: Int, volumePerStep: Int, agent: Agent = Agent(), chest: Point = agent.getBankPoint()) {
|
||||||
println("You must zoom in all the way and have the compass pointing straight N with a completely top-down view\n you must also be standing at the touch point on the saw")
|
println("You must zoom in all the way and have the compass pointing straight N with a completely top-down view\n you must also be standing at the touch point on the saw")
|
||||||
val agent = Agent()
|
val agent = Agent()
|
||||||
agent.scrollOutToHeight(8)
|
agent.scrollOutToHeight(8)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user