Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Buying from the Grand Exchange

Featured Replies

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 by uyfgfarOS

have same issue but idk. never used ge api b4

  • Author

I used it the same way and it was working a few days ago on another script! weird

  • Author

Use the GE API in the snippets section

 

Could you link me? I tried GrandExchange.java but also no luck

 

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

buyItem is currently working for me now.

  • Author

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

Mine isn't sad.png

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

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

  • Author

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.

  • Author

	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.

 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.