Jump to content

GE Help


Recommended Posts

Posted

GE API is pretty simple.

 

 

buyItem (itemId, "ItemName", Amount, price) 

There isnt a selling method at the moment, but you could do something like this

//widget to check if you can collect
if (e.getWidgets().isVisible(465, 6, 1)) {
                            e.grandExchange.collect();
                        }

//widget that is only seen when you're on the selling screen 
if (!e.getWidgets().isVisible(465,27,0)) {
                            e.inventory.interact("Offer", "Bow string");

                            new ConditionalSleep(5000, 5500) {
                                @[member=Override]
                                public boolean condition() throws InterruptedException {
                                    return e.getWidgets().isVisible(465, 27, 0);
                                }
                            }.sleep();
                        } else {

//manipulate prices and amount via widgets here 

}

That's just something I wrote up pretty quickly. Its a basic way to buy/sell and should work. 

  • Like 2
Posted

GE API is pretty simple.

 

 

buyItem (itemId, "ItemName", Amount, price) 

There isnt a selling method at the moment, but you could do something like this

//widget to check if you can collect
if (e.getWidgets().isVisible(465, 6, 1)) {
                            e.grandExchange.collect();
                        }

//widget that is only seen when you're on the selling screen 
if (!e.getWidgets().isVisible(465,27,0)) {
                            e.inventory.interact("Offer", "Bow string");

                            new ConditionalSleep(5000, 5500) {
                                @[member='Override']
                                public boolean condition() throws InterruptedException {
                                    return e.getWidgets().isVisible(465, 27, 0);
                                }
                            }.sleep();
                        } else {

//manipulate prices and amount via widgets here 

}

That's just something I wrote up pretty quickly. Its a basic way to buy/sell and should work. 

 

the buyitems seems to be not working for me, continues to tell me that im not assigning the right integers, and such. GE.box??

 

Posted

the buyitems seems to be not working for me, continues to tell me that im not assigning the right integers, and such. GE.box??

 

 

You're using the old API. Update your project structure to the new client so it gets the update. 

 

**This was recently added so it only shows up if you have the updated client hooked in IntelliJ

Posted

GE API is pretty simple.

 

 

buyItem (itemId, "ItemName", Amount, price) 

There isnt a selling method at the moment, but you could do something like this

//widget to check if you can collect
if (e.getWidgets().isVisible(465, 6, 1)) {
                            e.grandExchange.collect();
                        }

//widget that is only seen when you're on the selling screen 
if (!e.getWidgets().isVisible(465,27,0)) {
                            e.inventory.interact("Offer", "Bow string");

                            new ConditionalSleep(5000, 5500) {
                                @[member='Override']
                                public boolean condition() throws InterruptedException {
                                    return e.getWidgets().isVisible(465, 27, 0);
                                }
                            }.sleep();
                        } else {

//manipulate prices and amount via widgets here 

}

That's just something I wrote up pretty quickly. Its a basic way to buy/sell and should work. 

 

Don't want to be rude, but you're recreating Grand Exchange API with methods that are very unstable and not particularly efficient.

 

You used third level static ids which are really prone to breaking on any update involving the Grand Exchange. Additionally that ConditionalSleep will never execute.

 

//widget that is only seen when you're on the selling screen 

 

 

GrandExchange isSellOfferOpen() 

 

//widget to check if you can collect

 

 

We have hooks for this.

 

http://osbot.org/api/org/osbot/rs07/api/GrandExchange.Status.html

 

Should look something like this:

if(getGrandExchange().getStatus(GrandExchangeBox).equals(GrandExchangeStatus.FINISHED_SALE)
  • Like 1
Posted

 

Don't want to be rude, but you're recreating Grand Exchange API with methods that are very unstable and not particularly efficient.

 

You used third level static ids which are really prone to breaking on any update involving the Grand Exchange. Additionally that ConditionalSleep will never execute.

 

 

GrandExchange isSellOfferOpen() 

 

 

We have hooks for this.

 

http://osbot.org/api/org/osbot/rs07/api/GrandExchange.Status.html

 

Should look something like this:

if(getGrandExchange().getStatus(GrandExchangeBox).equals(GrandExchangeStatus.FINISHED_SALE)

You are right, this is a much better method to approaching it. I need to stay away from widgets like that since they change constantly. Thanks for the tip. :)

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...