Tool-Assisted-RS/src/main/kotlin/Routines.kt
2023-08-03 11:30:52 -04:00

163 lines
5.0 KiB
Kotlin

import java.awt.Point
import java.awt.event.KeyEvent
object Routines {
fun fullRunIncense(volHerbs: Int, volLogs: Int, volAshes: Int, volCleanHerbs: Int){
val agent = Agent()
val start = System.currentTimeMillis()
val chest = agent.getBankPoint()
//process any grimy herbs we might need
if(volHerbs > 0){
agent.doLoop(volHerbs, 28){
agent.bankStandWithoutDialog(chest, KeyEvent.VK_F1, KeyEvent.VK_1)
}
}
println("\rHerbs cleaned")
//cut up any magic logs we might need
if(volLogs > 0){
agent.doLoop(volLogs, 26){
agent.bankStandForLoop(chest, KeyEvent.VK_F2, KeyEvent.VK_2, 26000, 1200)
}
}
println("\rLogs cut into sticks")
//coat any sticks
if(volAshes > 0){
agent.doLoop(volAshes, 26){
agent.bankStandForLoop(chest, KeyEvent.VK_F3, KeyEvent.VK_3, 21000, 600)
}
}
println("\rSticks coated in ashes")
//infuse any sticks
if(volCleanHerbs > 0){
agent.doLoop(volCleanHerbs, 27){
agent.bankStandForLoop(chest, KeyEvent.VK_F4, KeyEvent.VK_4, 48600, 600)
}
}
println("\rClean herbs infused")
val finish = System.currentTimeMillis()
println("Entire chain finished in ${agent.prettyTimeString(finish-start)}")
}
fun cleanHerbs(volume: Int, step: Int = 14){
val agent = Agent()
val chest = agent.getBankPoint()
agent.doLoop(volume, step){
agent.bankStandWithoutDialog(chest, KeyEvent.VK_F1, KeyEvent.VK_1)
}
}
fun cutIncenseSticks(volume: Int, step: Int = 28){
val agent = Agent()
val chest = agent.getBankPoint()
agent.doLoop(volume, step){
agent.bankStandForLoop(chest, KeyEvent.VK_F2, KeyEvent.VK_2, 26000, 1200)
}
}
fun coatIncenseSticks(volume: Int, step: Int = 26){
val agent = Agent()
val chest = agent.getBankPoint()
agent.doLoop(volume, step){
agent.bankStandForLoop(chest, KeyEvent.VK_F3, KeyEvent.VK_3, 21000, 600)
}
}
fun infuseIncenseSticks(volume: Int, step: Int = 27 ){
val agent = Agent()
val chest = agent.getBankPoint()
agent.doLoop(volume, step){
agent.bankStandForLoop(chest, KeyEvent.VK_F4, KeyEvent.VK_4, 48600, 600)
}
}
fun potionGrind(volume: Int, step: Int = 14){
val agent = Agent()
val chest = agent.getBankPoint()
agent.doLoop(volume, step){
agent.bankStandForLoop(chest, Agent.F6, Agent.Minus, 19200, 600)
}
}
fun potionGrindWithWell(volume: Int, step: Int = 14){
val agent = Agent()
val chest = agent.getBankPoint()
val well = agent.promptUserForPoint("Put your mouse over the well...")
agent.doLoop(volume, step){
agent.processAtStationNearBank(chest, well, Agent.F6, 0, 0, 18600, 600)
}
}
fun supremeOverloadGrind(volume: Int, step: Int = 4){
val agent = Agent()
val chest = agent.getBankPoint()
val well = agent.promptUserForPoint("Put your mouse over the well...")
agent.doLoop(volume, step){
agent.processAtStationNearBank(chest, well, Agent.F6, 0, 0, 6500, 1000)
}
}
fun processInventoryAtFurnace(volume: Int, step: Int = 28){
val agent = Agent()
println("Reset the camera and zoom in")
agent.scrollOutToHeight(2)
val furnaceFromChest = Point(776, 321)
val chestFromFurance = Point(1713, 843)
agent.doLoop(volume, step){
agent.processAtStationNearBank(chestFromFurance, furnaceFromChest, Agent.F6, 2500, 600, 53200, 600)
}
}
@Deprecated("Needs validation before you use it for realsies")
fun processRefinedPlanksIntoFrames(volume: Int, step: Int){
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()
agent.scrollOutToHeight(8)
val sawFromChest = Point(1079, 907)
val chestFromSaw = Point(1226, 180)
agent.doLoop(volume, step){
// //standing at bank with full inv
// d.mouseMove(sawFromChest)
// d.sleep(100, 50)
// //run to saw
// d.click(LeftClick)
// d.sleep(2700, 500)
// //start cutting frames
// d.keypress(Space)
// //waiting
// d.sleep(64000, 1000)
// d.mouseMove(chestFromSaw)
// d.sleep(100, 50)
// //running to bank
// d.click(LeftClick)
// d.sleep(2700, 500)
// d.keypress(F6)
// d.sleep(1200, 500)
// //full inv
agent.processAtStationNearBank(chestFromSaw, sawFromChest, Agent.F6, 2700, 500, 64000, 1000)
}
}
}