Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Bug GrandExchange.placeBuyOffer() gets stuck every time

Joined
Jun 20, 2015
Messages
161
I can't get GrandExchange.placeBuyOffer() to work. It names and selects the item and sets the amount properly, but then it clicks the button to set the price and just sits there on this ChatDialog:

https://i.imgur.com/RkWkEN9.png

Here's how I'm using it (I set the price to a constant to see if that worked):

GrandExchange.placeBuyOffer(bot.itemName,bot.buyAmount,2300);

I checked the log, but there's nothing relevant, here's how it ends:

Code:
00:00:13 TRACE    [PlayerSense] Parsed PSElement "regal_max_LOGOUT_DELAY" with opcode 0 and value 6577.0
00:00:13 TRACE    [PlayerSense] Parsed PSElement "step_threshold" with opcode 0 and value 4.0
00:00:17 TRACE    [Bank] Withdrawing with action: Withdraw-X

@Party @Cloud
 
It now correctly sets the amount and price, but instead of clicking Confirm it just re-enters the price over and over again.
@Party @Cloud
 
Client Developer
Joined
Oct 12, 2015
Messages
3,760
Sounds like it's failing to detect the set price. Can you try again, let me know the price you requested it set and grab me a screenshot of the price shown after the bot enters it?
 
Joined
Jun 20, 2015
Messages
161
GrandExchange.placeBuyOffer(bot.hideName,bot.buyAmount,2300);

bBjCv0m.png


Keeps hitting the ... and setting the price, again and again.
 
Client Developer
Joined
Oct 12, 2015
Messages
3,760
GrandExchange.placeBuyOffer(bot.hideName,bot.buyAmount,2300);

bBjCv0m.png


Keeps hitting the ... and setting the price, again and again.

I wonder if it's picking up the total price below and thinking that it's wrong...
Code:
    private static int getSelectedPrice() {
        int price = -1;
        final InterfaceComponent priceComponent = Interfaces.newQuery().containers(GE_CONTAINER).types(InterfaceComponent.Type.LABEL).texts(PRICE_TERM).heights(20).results().first();
        if (priceComponent != null) {
            final Matcher matcher = PRICE_TERM.matcher(priceComponent.getText());
            if (matcher.matches()) {
                price = Integer.valueOf(matcher.group("price").replace("\\D", ""));
            }
        }
        return price;
    }

Seems I'm not filtering by text color, which would be the fix for this.
 
Joined
Apr 9, 2015
Messages
1
How was this fixed?
Code:
final InterfaceComponent priceComponent = Interfaces.newQuery().containers(GE_CONTAINER).types(InterfaceComponent.Type.LABEL).texts(PRICE_TERM).heights(20).results().first();
returns null for me
 
Top