Annointed Posted October 23, 2016 Share Posted October 23, 2016 Could someone help me out with some Grand Exchange buying and selling script? My Skype: babadu1234 Thanks! Quote Link to comment Share on other sites More sharing options...
Solzhenitsyn Posted October 23, 2016 Share Posted October 23, 2016 I can. Feel free to add me on Skype: live:aek.solzhenitsyn aek.solzhenitsyn@@gmail.com Quote Link to comment Share on other sites More sharing options...
Juggles Posted October 24, 2016 Share Posted October 24, 2016 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. 2 Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted October 26, 2016 Share Posted October 26, 2016 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?? Quote Link to comment Share on other sites More sharing options...
Juggles Posted October 26, 2016 Share Posted October 26, 2016 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 Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted October 26, 2016 Share Posted October 26, 2016 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 Updated the bot, using Eclipse. Can you just update it that way or some other way? Quote Link to comment Share on other sites More sharing options...
Juggles Posted October 26, 2016 Share Posted October 26, 2016 Updated the bot, using Eclipse. Can you just update it that way or some other way? I use IntelliJ but basically I just unhooked the old client and then rehooked the new client 2.4.96 Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted October 26, 2016 Share Posted October 26, 2016 I use IntelliJ but basically I just unhooked the old client and then rehooked the new client 2.4.96 Ah ok, gonna do that now. Basically adding the .jar files I assume correct? Got it Juggles, tyvm buddy! Quote Link to comment Share on other sites More sharing options...
Juggles Posted October 26, 2016 Share Posted October 26, 2016 Ah ok, gonna do that now. Basically adding the .jar files I assume correct? Got it Juggles, tyvm buddy! No problem Quote Link to comment Share on other sites More sharing options...
TheGreatests Posted October 26, 2016 Share Posted October 26, 2016 No problem Ah that sucks, so the API doesnt have the e.sellItems(2354,"Steel bar", 22, 299); method does it... Quote Link to comment Share on other sites More sharing options...
Juggles Posted October 26, 2016 Share Posted October 26, 2016 Ah that sucks, so the API doesnt have the e.sellItems(2354,"Steel bar", 22, 299); method does it... No not yet. Hopefully it'll be added soon You can try the snippet I posted earlier for selling if you like Quote Link to comment Share on other sites More sharing options...
Alek Posted October 27, 2016 Share Posted October 27, 2016 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) 1 Quote Link to comment Share on other sites More sharing options...
Juggles Posted October 27, 2016 Share Posted October 27, 2016 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. Quote Link to comment Share on other sites More sharing options...
sudoinit6 Posted December 10, 2016 Share Posted December 10, 2016 Is there a reason no sell method has been included in the API? Would be kinda nice... Quote Link to comment Share on other sites More sharing options...