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

Discussion in 'Tutorials & Resources' started by Dibes, Jun 20, 2015.

  1. 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!

    [​IMG]

    [​IMG]

    Basic Use of buying 2 items (As seen in the gif above):
    Code (Java):
    1. package com.dibes.bots.getest;
    2.  
    3. import com.dibes.bots.getest.GrandExchange.GrandExchangeComplete;
    4. import com.runemate.game.api.rs3.net.GrandExchange;
    5. import com.runemate.game.api.script.framework.LoopingScript;
    6.  
    7. public class GETest extends LoopingScript {
    8.     boolean boughtItem1;
    9.     boolean boughtItem2;
    10.  
    11.     @Overridepublic void onLoop() {
    12.         // Note: It seems to me this implementation is messy. Probably a better way to do it!
    13.         if (!boughtItem1 || !boughtItem2) {
    14.             if (!boughtItem1)
    15.                 // Buys 1 rune longsword at default price.
    16.                 boughtItem1 = GrandExchangeComplete.buyItem(1303);
    17.             if (boughtItem1 && !boughtItem2)
    18.                 // Buys 20 air runes at 20gp each
    19.                 boughtItem2 = GrandExchangeComplete.buyItem(556, 20, 20);
    20.         } else {
    21.             GrandExchangeComplete.retrieveItem(1303);
    22.             GrandExchangeComplete.retrieveItem(561);}
    23.     }
    24. }
     
    #1 Dibes, Jun 20, 2015
    Last edited: Jun 21, 2015
    Qosmiof2 likes this.
  2. @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.
     
  3. Uhhh, this is a very rough version of the API haha. It needs a lot of reworking :). But I appreciate it!
    --- Double Post Merged, Jun 21, 2015, Original Post Date: Jun 20, 2015 ---
    Added a gif of it doing it's thing.. for fun!
    --- Double Post Merged, Jun 21, 2015 ---
    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!
     
    #3 Dibes, Jun 21, 2015
    Last edited: Jun 21, 2015
  4. Nice work! What do you mean @ name based not doable without Web?
     
  5. 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
     
  6. Why do you need to convert ID's to names?
    (Why are you even using ID's)
     
  7. Because the GE database goes off the item's ID, not it's name.
     
  8. GrandExchange.Item #getName() ?
    GrandExchange.Offer #getItemDefinition() #getName() ?
     
  9. How about creating a new SpriteItem(id) and doing #getDefinition #getName() ?
     
  10. ItemDefinition.get(id) already exists
    --- Double Post Merged, Jun 21, 2015, Original Post Date: Jun 21, 2015 ---
    ItemDefinition.get(id), pretty sure i mentioned it on skype xD
     
  11. That would probably work but SlashnHax made me realize I was being dumb and didn't even need the ID. Silly me!

    Doing that now ^.^. Thnx
    --- Double Post Merged, Jun 21, 2015 ---
    Added GE Buying by name and cleaned up the class!
     
    #12 Dibes, Jun 21, 2015
    Last edited: Jun 21, 2015
    badboykenzie likes this.
  12. Keep up the good work this will be a wicked useful script bot! :p
     
  13. Pretty sure he's not making it into a bot, but rather creating the methods to interact with the ge and sharing it so other devs can use it
     
  14. xD
     
  15. 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
     
  16. @Dibes i would love to have that mouse flawlessness etc :( how can i make it?
     
  17. You need a beast pc and 50fps paint rendering
     
  18. Bruh, your gmail is visible.
     

Share This Page

Loading...