Skip to content

Commit abe41e2

Browse files
authored
improvement(AutoTotem): move cursor item before swap (#187)
1 parent 963a8fc commit abe41e2

File tree

1 file changed

+5
-0
lines changed
  • src/main/kotlin/com/lambda/module/modules/combat

1 file changed

+5
-0
lines changed

src/main/kotlin/com/lambda/module/modules/combat/AutoTotem.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ object AutoTotem : Module(
6464
.filterSlots(player.currentScreenHandler.slots)
6565
.takeIf { it.isNotEmpty() }
6666
?.let { totems ->
67+
val cursor = player.currentScreenHandler.cursorStack
68+
val targetSlot = player.currentScreenHandler.slots
69+
.findLast { !cursor.isEmpty && it.canInsert(cursor) }
70+
6771
inventoryRequest {
72+
targetSlot?.let { pickup(it.id, 0) }
6873
swap(totems.first().id, 40)
6974
}.submit()
7075
}

0 commit comments

Comments
 (0)