@@ -16,6 +16,7 @@ import net.runelite.client.plugins.microbot.util.bank.Rs2Bank
16
16
import net.runelite.client.plugins.microbot.util.gameobject.Rs2GameObject
17
17
import net.runelite.client.plugins.microbot.util.inventory.Rs2Inventory
18
18
import net.runelite.client.plugins.microbot.util.math.Random
19
+ import net.runelite.client.plugins.microbot.util.math.Random.random
19
20
import net.runelite.client.plugins.microbot.util.npc.Rs2Npc
20
21
import net.runelite.client.plugins.microbot.util.player.Rs2Player
21
22
import net.runelite.client.plugins.microbot.util.walker.Rs2Walker
@@ -72,22 +73,23 @@ private class Root : State() {
72
73
Global .sleepUntil { ! Rs2Inventory .contains(8778 ) }
73
74
Rs2Bank .withdrawAll(1521 )
74
75
Global .sleepUntil { Rs2Inventory .contains(1521 ) }
75
- Rs2Bank .closeBank()
76
- Global .sleepUntil { ! Rs2Bank .isOpen() }
77
76
}
78
77
return
79
78
} else {
80
79
val sawmillMan = Rs2Npc .getNpc(3101 )
81
80
if (sawmillMan == null || sawmillMan.worldLocation.distanceTo(Rs2Player .getWorldLocation()) > 10 ) {
82
- Rs2Walker .walkTo(WorldPoint (1626 , 3500 , 0 ))
81
+ Rs2Walker .walkTo(WorldPoint (1626 , 3500 , 0 ), 7 )
82
+ Global .sleep(random(622 , 952 ))
83
83
return
84
84
}
85
+ Rs2Walker .setTarget(null )
85
86
val buyButton = Rs2Widget .getWidget(17694735 )
86
87
if (buyButton != null ) {
87
88
Rs2Widget .clickWidget(buyButton)
88
89
Global .sleepUntil { ! Rs2Inventory .contains(1521 ) }
90
+ Global .sleep(random(323 , 522 ))
89
91
} else if (Rs2Npc .interact(sawmillMan, " Buy-plank" ))
90
- Global .sleepUntil { ! Rs2Player .isMoving() }
92
+ Global .sleepUntil({ Rs2Widget .getWidget( 17694735 ) != null }, 10000 )
91
93
}
92
94
}
93
95
}
0 commit comments