botstig 0 Share Posted August 10 (edited) Can't seem to get GE.buyItem() to work.. If I try either API buyitem or searchItem(<ItemName>) it just sits on search screen and times out. public static boolean buyItem(int ItemID, int amount, int price){ if (!isGeOpen()){ openGE(); } Debug.log("Placing buy offer for x" + amount + " of " + ItemList.getItem(ItemID).name + " for " + price + " each"); return GrandExchange.buyItem(ItemID, amount, price); } The manual way that is not working either: /* int slot = GrandExchange.getFirstOpenSlot(); Debug.log("Available slot " + slot + "!"); if (slot > -1) { Debug.log("Opening available slot " + slot + "!"); GrandExchange.openBuyScreen(slot); Sleep.sleepUntil(GrandExchange::isBuyOpen, 2000); Debug.log("Adding buy offer for " + ItemList.getItem(ItemID).name); GrandExchange.searchItem(ItemList.getItem(ItemID).name); Sleep.sleepUntil(() -> GrandExchange.getCurrentChosenItemID() == ItemID, 5000); Debug.log("Setting amount: " + amount); GrandExchange.setQuantity(amount); Debug.log("Setting price: " + price); GrandExchange.setPrice(price); Debug.log("Place offer"); GrandExchange.confirm(); Sleep.sleepUntil(() -> GrandExchange.slotContainsItem(slot), 5000); if (GrandExchange.slotContainsItem(slot)){ return slot; } else { return -1; } } else { return -1; } */ Edited August 10 by botstig Link to comment Share on other sites More sharing options...
brad734 2 Share Posted August 10 (edited) Why make it so difficult. Just use something like if(GrandExchange.isOpen()) { if (GrandExchange.buyItem("Nature rune", 100, 50)) { if (Sleep.sleepUntil(GrandExchange::isReadyToCollect, Calculations.random(10000, 20000))) { GrandExchange.collect(); } } } Edited August 10 by brad734 Link to comment Share on other sites More sharing options...
botstig 0 Author Share Posted August 10 (edited) I tried/am, that's basically the first block, it doesn't search for the item when buyItem or searchItem are called. The commented code was a attempt to brute force when buyitem wasn't working. Edited August 10 by botstig Link to comment Share on other sites More sharing options...
idhurtit 6 Share Posted August 11 (edited) ``` if (GrandExchange.isOpen()) { if (GrandExchange.buyItem(knife, 1, 150)) { log("Buying knife"); Sleep.sleepTicks(2); if (GrandExchange.isOpen()) { if (GrandExchange.isReadyToCollect() && GrandExchange.collect()) { log("Knife collected successfully"); } else { log("Failed to collect knife or knife was not ready to collect"); } } } Edited August 11 by idhurtit Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now