August 6, 201510 yr So i wanted to ask about depositBox is it broken now? Because i founded on api this depositBox.open(); But it doesn't open deposit box i stand near box And 2nd question about shop buying I made script that buys simple few items then hop and do this till full inventory,it does everything perfectly except it sometimes after hoping world while buying items try to buy it like 10 times even if i have function if (store.getAmount("Shop item") == 0) and then hops sometimes i need to restart script to get it working again My code of buying items NPC SHOP NPC= npcs.closest("SHOP NPC"); if (SHOP NPC!= null) { if(SHOP NPC.isVisible()) { SHOP NPC.interact("Trade"); sleep(random(2000, 2500)); store.buy(ITEM ID, AMOUNT); sleep(random(500, 600)); store.buy(ITEM , AMOUNT); sleep(random(500, 600)); store.buy(ITEM , AMOUNT sleep(random(600,900)); if (store.getAmount("SHOP ITEM") == 0) { worlds.hopToF2PWorld(); } } } My states NPC SHOP NPC= npcs.closest("SHOP NPC"); if (!inventory.isFull() && Shoparea.contains(myPlayer()) && SHOP NPC!= null) return State.BUY; if (!inventory.isFull() && BankArea.contains(myPlayer())) return State.WALK_TO_SHOP; if (inventory.isFull() && Shoparea.contains(myPlayer())) return State.BANK; return State.WAIT; }
August 6, 201510 yr You have to put the hopping block above the trade block and return. Edited August 6, 201510 yr by Psvxe
Create an account or sign in to comment