Jump to content

GE Help


Annointed

Recommended Posts

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
Link to comment
Share on other sites

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??

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

 

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. :)

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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