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.

Selling items in GE

Featured Replies

I've been trying to implement @LoudPacks GE API here (no idea if it is outdated or not, but when I tested it for GE actions (buy & sell items in quantities, etc.), it did everything according to the code). Now I try to implement it in my local personal script and the script manages to get stuck in different places (terminal shows that commands have been executed though). I've been on this mission for the past two days but I get stuck without commands being executed...

So far I've made it that makes it to the GE, opens an offer, sets price for the item and then closes the offer window (strange that it doesn't do anything with the amount, eventhough it is noted in params).
So here is the snippet:

	private void sell() throws InterruptedException {
		getWalking().webWalk(GrandEx);
		GrandExchange GE = new GrandExchange(this);
		GE.openGE();
		GE.createSellOffer("Jug of water", 14, 300);
		GE.collectItems(false);
	}

Yes, I am aware of the GE API implemented in the OSBot API, but since I am new to Java in general this seemed easier. Perhaps you could point me in the right direction how my intended action would look in the code if I used original OsBot GE API instead?

Thank you!

Edited by Magerange

getGrandExchange().sellItem(this,works,whynot,useit)

stopusingoldsnippetsthanks

Edited by k9thebeast

  • Author
4 minutes ago, k9thebeast said:

getGrandExchange().sellItem(this,works,whynot,useit)

stopusingoldsnippetsthanks

Thanks!

Now I feel even worse after 2 days of struggling. I guess I learned the hard way.

1 hour ago, Magerange said:

I've been trying to implement @LoudPacks GE API here (no idea if it is outdated or not, but when I tested it for GE actions (buy & sell items in quantities, etc.), it did everything according to the code). Now I try to implement it in my local personal script and the script manages to get stuck in different places (terminal shows that commands have been executed though). I've been on this mission for the past two days but I get stuck without commands being executed...

So far I've made it that makes it to the GE, opens an offer, sets price for the item and then closes the offer window (strange that it doesn't do anything with the amount, eventhough it is noted in params).
So here is the snippet:


	private void sell() throws InterruptedException {
		getWalking().webWalk(GrandEx);
		GrandExchange GE = new GrandExchange(this);
		GE.openGE();
		GE.createSellOffer("Jug of water", 14, 300);
		GE.collectItems(false);
	}

Yes, I am aware of the GE API implemented in the OSBot API, but since I am new to Java in general this seemed easier. Perhaps you could point me in the right direction how my intended action would look in the code if I used original OsBot GE API instead?

Thank you!

It's better to just use the OSBot api.

Also, just some tips:

only webwalk if ge area does not contain player pos and we are very far away

use Banks.GRAND_EXCHANGE as it's in the bank location api and it's better to just call the area from that instead of making your own area which may be redundant.

every time the method sell is called it will create the GE object/class and it's better to just create it on the onstart once not every time it's called

i havent seen his snippet but i assume the open ge caters for opening the ge if it isnt open in the first place? because if it doesnt it will probably just spam click it open or somethin

  • Author
1 minute ago, LoudPacks said:

Its mad outdated lmao

Couldn't just replied to a PM lol? But thanks for confirming.

 

On to the OSBot API - how come that I import the GrandExchange Class and use it in the script, but script shows that I do not use it...? The commands I call are allowed, but they do not work when testing the script on OSRS...

Maybe it's because I wrote it over LoudPacks API?

1 hour ago, Magerange said:

I am aware of the GE API implemented in the OSBot API, but since I am new to Java in general this seemed easier. Perhaps you could point me in the right direction how my intended action would look in the code if I used original OsBot GE API instead?

Thank you!

You should probably learn Java before trying to script. That method is pretty bad, not going to sugarcoat it.

4 hours ago, Magerange said:

Couldn't just replied to a PM lol? But thanks for confirming.

 

On to the OSBot API - how come that I import the GrandExchange Class and use it in the script, but script shows that I do not use it...? The commands I call are allowed, but they do not work when testing the script on OSRS...

Maybe it's because I wrote it over LoudPacks API?

Just write your own that works built on top of the osbot api. Also you can't have classes with the same names or it can use issues.

1. The GE API I wrote is probably much better (no offense to whoever wrote it)
2. It's easier to use the OSBot API than including external libraries (or copy-pastaing snippets)

 

  • Author

Finally cracked it. Turns out you have to put in some hefty sleeps in between the commands. I guess it's because of heavy code that Alek has pushed together under GE API and the fact that GE tends to lag.

1 hour ago, Magerange said:

Finally cracked it. Turns out you have to put in some hefty sleeps in between the commands. I guess it's because of heavy code that Alek has pushed together under GE API and the fact that GE tends to lag.

Putting a sleep before or after buyItem/sellItem won't change a single thing; that or you deobfuscated the jar, reversed the methods, then re-wrote them with your new sleeps in the method? I have no idea where you are putting these magical sleeps.

  • Developer

GE only lags if you are checking the box status way too much, bcs it takes a fair amount of cpu.
If you are running a lot of bots and the cpu is on a high load, it's better to use you donw method. The Osbot method isn't made for slow stuff ;)

22 hours ago, Imateamcape said:

You should probably learn Java before trying to script. 

The hell you say! 

  • 4 years later...

sellItem() doesn't really appear to be working in 2021? sellItem(Box) works fine in opening the interface, but much of the time sellItems() just returns false having failed. I'm writing a merching script and having to rewrite wrappers around all these methods (eg. also around getOverallPrice() which randomly NPEs from time to time) is frustrating. Let me know if it's my fault -- short context on how I'm using it is below. Help much appreciated! Maybe it is also failing in a similar way nowadays for others.

if (free_box != null){
    log("found free box to bigSell in: " + free_box);
    getGrandExchange().sellItems(free_box);
    log("opened sell interface");
    sleep(approx(3000));
    boolean sold = getGrandExchange().sellItem(name2id(itemName), price, (int) this.inventory.getAmount(itemName));

 

Edited by galois69

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.