uyfgfarOS Posted January 11, 2017 Posted January 11, 2017 (edited) Hi all! I've had buying working before, so I've used code again, however in this script when I call the grandExchange.buyItem() method it writes "Grimy guam leaf" 2 times over, confirms without settings how many to buy then it ends up sending "Grimy guam leaf" on chat as it writes it a third time! EDIT: ignore how many im buying and selling, it's purely just testing if (buy == true) { //Sell all guam sleep(random(500,900)); grandExchange.sellItem(250, 10, 50000); sleep(random(5000,6000)); grandExchange.confirm(); sleep(random(700,1300)); do { sleep(random(1,30)); } while (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.PENDING_SALE); grandExchange.collect(); getGrandExchange().buyItem(200, "Grimy guam leaf", 20, 100); sleep(random(700,1300)); do { sleep(random(700,1300)); } while (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.PENDING_BUY); grandExchange.collect(); buy = false; } Edited January 11, 2017 by uyfgfarOS 2
uyfgfarOS Posted January 11, 2017 Author Posted January 11, 2017 I used it the same way and it was working a few days ago on another script! weird
uyfgfarOS Posted January 11, 2017 Author Posted January 11, 2017 Use the GE API in the snippets section Could you link me? I tried GrandExchange.java but also no luck
Ayylmao420 Posted January 12, 2017 Posted January 12, 2017 Hi all! I've had buying working before, so I've used code again, however in this script when I call the grandExchange.buyItem() method it writes "Grimy guam leaf" 2 times over, confirms without settings how many to buy then it ends up sending "Grimy guam leaf" on chat as it writes it a third time! EDIT: ignore how many im buying and selling, it's purely just testing if (buy == true) { //Sell all guam sleep(random(500,900)); grandExchange.sellItem(250, 10, 50000); sleep(random(5000,6000)); grandExchange.confirm(); sleep(random(700,1300)); do { sleep(random(1,30)); } while (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.PENDING_SALE); grandExchange.collect(); getGrandExchange().buyItem(200, "Grimy guam leaf", 20, 100); sleep(random(700,1300)); do { sleep(random(700,1300)); } while (grandExchange.getStatus(GrandExchange.Box.BOX_1) == GrandExchange.Status.PENDING_BUY); grandExchange.collect(); buy = false; } http://osbot.org/forum/topic/90148-simple-ge-api
uyfgfarOS Posted January 13, 2017 Author Posted January 13, 2017 http://osbot.org/forum/topic/90148-simple-ge-api Tried this, it simply does nothing. Haha! Has anyone tested either method recently?
uyfgfarOS Posted January 13, 2017 Author Posted January 13, 2017 buyItem is currently working for me now. Mine isn't So I've imported the simple ge api and used the .createBuyOffer() method. It still types it out 3 times! So it must be something to do with my code I just can't figure it out. It doesn't repeat anything else 3 times just the buy offer
Chris Posted January 13, 2017 Posted January 13, 2017 Mine isn't So I've imported the simple ge api and used the .createBuyOffer() method. It still types it out 3 times! So it must be something to do with my code I just can't figure it out. It doesn't repeat anything else 3 times just the buy offer lol well for some reason sellItem doesnt work for me xD. I dunno man I guess you will have to make edits to the code
Aiban Posted January 13, 2017 Posted January 13, 2017 have same issue but idk. never used ge api b4 I used it the same way and it was working a few days ago on another script! weird Had that happen to me when client was laggy/low resource mode, it eventually corrects itself and buys item after 1-3 tries
uyfgfarOS Posted January 14, 2017 Author Posted January 14, 2017 Had that happen to me when client was laggy/low resource mode, it eventually corrects itself and buys item after 1-3 tries Low resource mode? any more info on this? I leave mine to run but it just stops attempting to buy after typing the item in 3 times. Really annoying me because it's the only thing I need working to finish the script. lol well for some reason sellItem doesnt work for me xD. I dunno man I guess you will have to make edits to the code veerrrryyyy frustratingggg. pretty much rewrote the script (i was gonna do this anyway not just because of this problem) and still the same problem.
uyfgfarOS Posted January 14, 2017 Author Posted January 14, 2017 case BUY: grandExchange.collect(); sleep(random(100, 200)); RS2Widget buyButton = widgets.get(465, 7, 26); if (buyButton != null) { buyButton.interact(); sleep(random(800, 900)); keyboard.typeString(searchTerm); keyboard.sleep(5000); RS2Widget buySelection = widgets.get(162, 38, 1); sleep(random(500, 700)); if (buySelection != null) { buySelection.interact(); RS2Widget confirmButton = widgets.get(265, 27); RS2Widget buyPrice = widgets.get(465, 24, 52); RS2Widget quantity = widgets.get(465, 24, 49); sleep(random(200,300)); if (buyPrice != null) { buyPrice.interact(); sleep(random(900, 1200)); keyboard.typeString(price); keyboard.pressKey(13); keyboard.sleep(5000); sleep(random(200,300)); if (quantity != null) { long quantityAmount = getInventory().getAmount("Coins"); int quantityEquation = (((Number)quantityAmount).intValue() / Integer.parseInt(price) - 10); String quantityString = Integer.toString(quantityEquation); quantity.interact(); sleep(random(600, 700)); keyboard.typeString(quantityString); keyboard.pressKey(13); keyboard.sleep(5000); sleep(random(200,300)); grandExchange.confirm(); ge = false; } } } } Wrote my own buying method using widgets, finally working lol. Here's the code if anyone is having the same issue as me. 1