Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resource Grand Exchange API for buying and selling items [BETA]

Joined
Nov 18, 2013
Messages
120
So since there is no API for buying and selling items on the GE I decided today that I was going to make a basic functioning one.

Version: 0.4
Features:
Haven't Started | In Progress | Done
  • Buy items from the GE
    • Buy X Amount for Y Price
    • Based on ID
    • Based on Name
      • TFW Dumb. Don't need item ID for this at all >.>.
    • Retrieve Items and money from GE
    • Fix Bugs
      • Input never gains focus to input X amount or Y price. Have you click input box
        • Needed Execution.delay after clicking the [...] (I tried Thread.sleep previously)
  • Sell Items on the GE
    • Sell X Amount for X Price
    • Based on ID
    • Based on Name
    • Retrieve money from GE
If you want the source or would like to fork and push changes/additions press the button below!



psBNjOS.gif

Basic Use of buying 2 items (As seen in the gif above):
Java:
package com.dibes.bots.getest;

import com.dibes.bots.getest.GrandExchange.GrandExchangeComplete;
import com.runemate.game.api.rs3.net.GrandExchange;
import com.runemate.game.api.script.framework.LoopingScript;

public class GETest extends LoopingScript {
    boolean boughtItem1;
    boolean boughtItem2;

    @Overridepublic void onLoop() {
        // Note: It seems to me this implementation is messy. Probably a better way to do it!
        if (!boughtItem1 || !boughtItem2) {
            if (!boughtItem1)
                // Buys 1 rune longsword at default price.
                boughtItem1 = GrandExchangeComplete.buyItem(1303);
            if (boughtItem1 && !boughtItem2)
                // Buys 20 air runes at 20gp each
                boughtItem2 = GrandExchangeComplete.buyItem(556, 20, 20);
        } else {
            GrandExchangeComplete.retrieveItem(1303);
            GrandExchangeComplete.retrieveItem(561);}
    }
}
 
Last edited:
Mod Automation
Joined
Jul 26, 2013
Messages
3,046
@Dibes thanks for the contribution! Hope to see your name in green soon. ;)

@Cloud perhaps we could use this codebase to implement a version directly into our API.
 
Joined
Nov 18, 2013
Messages
120
@Dibes thanks for the contribution! Hope to see your name in green soon. ;)

@Cloud perhaps we could use this codebase to implement a version directly into our API.

Uhhh, this is a very rough version of the API haha. It needs a lot of reworking :). But I appreciate it!
 
Added a gif of it doing it's thing.. for fun!
 
Added ability to select X amount of an item at X price. The use of the interface is now slightly buggy cause when I hit the [...] in the GE it doesn't immediately allow me to type the amount of items or price as expected. Had to do a workaround where I clicked the input box to give it any sort of number, seems like a possible bug @Cloud

NVM Cloud, fixed the bug, sorry!
 
Last edited:
Joined
Nov 18, 2013
Messages
120
Nice work! What do you mean @ name based not doable without Web?

Didn't see an easy way to convert the name of an item to it's ID without calling some sort of outside API. If there is, please let me know!! Thanks :)

Also thanks to @SlashnHax I fixed the input bug. Just needed Execution.delay! haha
 
Joined
Dec 10, 2014
Messages
3,255
GrandExchange.Item #getName() ?
GrandExchange.Offer #getItemDefinition() #getName() ?
ItemDefinition.get(id) already exists
 
Didn't see an easy way to convert the name of an item to it's ID without calling some sort of outside API. If there is, please let me know!! Thanks :)

Also thanks to @SlashnHax I fixed the input bug. Just needed Execution.delay! haha
ItemDefinition.get(id), pretty sure i mentioned it on skype xD
 
Joined
Nov 18, 2013
Messages
120
How about creating a new SpriteItem(id) and doing #getDefinition #getName() ?

That would probably work but SlashnHax made me realize I was being dumb and didn't even need the ID. Silly me!

ItemDefinition.get(id) already exists
 

ItemDefinition.get(id), pretty sure i mentioned it on skype xD

Doing that now ^.^. Thnx
 
Added GE Buying by name and cleaned up the class!
 
Last edited:
Joined
Dec 9, 2015
Messages
152
Holy mother of goldfarming, using this you can make a bot thatll buy EG wines when running out of stock <3

Verstuurd vanaf mijn SM-G900F met Tapatalk
 
Top