darkxor Posted October 5, 2013 Share Posted October 5, 2013 Writed simple version of scrollToSlot(int slot) that does not become stupid on first/last partially visible rows. It works maximally depending on existing scrolling functions. public void bankScrollToSlot(int slot) throws InterruptedException{ bank = client.getBank(); int yTop = bank.getVirtualSlotPosition(0).y; int yBottom = bank.getVirtualSlotPosition(40).y; Rectangle rect = bank.getAbsoluteSlotPosition(slot); int y = rect.y; if(y < yTop) bank.scrollToSlot(slot - 8 >= 0 ? slot - 8 : slot); //scroll up if(y > yBottom) bank.scrollToSlot(slot + 8 < 400 ? slot + 8 : slot); //scroll down } P.S. Did'nt test it much enough, so can contain some bugs. Link to comment Share on other sites More sharing options...
liverare Posted October 6, 2013 Share Posted October 6, 2013 When even bother scrolling? This is a re-post of my submitted code on the Withdraw without scrolling bug thread: public static RectangleDestination getScrollerDes(Script script, int id) { if (!script.client.getBank().isOpen() || !script.client.getBank().contains(id)) return null; int i = 0; for (Item next : script.client.getBank().getItems()) if (next != null && next.getId() == id) break; else i++; i /= 2; return new RectangleDestination(new Rectangle(480, 68 + i, 15, 4)); } 1 Link to comment Share on other sites More sharing options...
darkxor Posted October 8, 2013 Author Share Posted October 8, 2013 I tested my function on bot farm and it is working flawless for me. Maybe yours also, but they are different. And this is not re-post in any ways. Link to comment Share on other sites More sharing options...
Recommended Posts