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;
}
*/