Jump to content

Is this script possible to create?


boozer

Recommended Posts

Is there a way to create a script that buys/sells in ge? yes.

however, my  actual question is, if i use a live database to flip/merch in ge, is there a way to utilize the site i use for a bot to refresh the database go by margins and create buy/sell orders on ge?

 

if that didn't make much sense then to break it down, can a bot use database sites such as ge-tracker to update items to purchase/sell and create a bot for flipping new items throughout the day due to items changing value everyday

Edited by boozer
Link to comment
Share on other sites

What you've described is certainly possible, but wouldn't be allowed on the SDN (https://osbot.org/forum/announcement/62-script-rules-read-before-applying/)

That being said, there's nothing stopping you making it yourself / purchasing it as a private script. If you do go for a private script, expect it to cost a lot!

OSBuddy provide a nice and pretty accurate item value db which many of us scripters use for profit tracking and the likes. This reddit thread might help: https://www.reddit.com/r/2007scape/comments/543n8b/rsbuddy_exachange_api_documentation/

 

GL!

Apa

  • Like 1
Link to comment
Share on other sites

It's certainly possible... I can't seem to find an API that ge-trackers gives access to but there are many out there. If you know basic Java you can easily form GET requests to the APIs end-point and parse that data to get item prices + add your margins.

For a headstart - here's a class I wrote that uses a basic reader to return the live item price and can store other variables about the item

Spoiler

 


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

class ItemResource {

    private String name;
    private String url;

    private int id;
    private int price;
    private int amount;

    public ItemResource(String name, int id) {

        this.url = "http://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=" + id;
        this.name = name;
        this.id = id;
        this.price = fetchPrice();

    }

    // Getters

    public int getPrice() {
        return price;
    }

    public int getAmount() {
        return amount;
    }

    public String getName() {
        return name;
    }

    // Setters

    public void setAmount(int i) {
        amount = amount + i;
    }

    // Reset Amount

    public void resetAmount() {
        amount = 0;
    }

    private int fetchPrice() {
        try (final BufferedReader reader = new BufferedReader(new InputStreamReader(new URL(url).openStream()))) {
            final String raw = reader.readLine().replace(",", "").replace("\"", "").split("price:")[1].split("}")[0];

            reader.close();
            return raw.endsWith("m") || raw.endsWith("k") ? (int) (Double.parseDouble(raw.substring(0, raw.length() - 1))
                    * (raw.endsWith("m") ? 1_000_000 : 1_000)) : Integer.parseInt(raw);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return -1;
    }

}

 

Edited by jca
Link to comment
Share on other sites

1 hour ago, Apaec said:

What you've described is certainly possible, but wouldn't be allowed on the SDN (https://osbot.org/forum/announcement/62-script-rules-read-before-applying/)

That being said, there's nothing stopping you making it yourself / purchasing it as a private script. If you do go for a private script, expect it to cost a lot!

OSBuddy provide a nice and pretty accurate item value db which many of us scripters use for profit tracking and the likes. This reddit thread might help: https://www.reddit.com/r/2007scape/comments/543n8b/rsbuddy_exachange_api_documentation/

 

GL!

Apa

 

1 hour ago, jca said:

It's certainly possible... I can't seem to find an API that ge-trackers gives access to but there are many out there. If you know basic Java you can easily form GET requests to the APIs end-point and parse that data to get item prices + add your margins.

For a headstart - here's a class I wrote that uses a basic reader to return the live item price and can store other variables about the item

  Reveal hidden contents

 



import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

class ItemResource {

    private String name;
    private String url;

    private int id;
    private int price;
    private int amount;

    public ItemResource(String name, int id) {

        this.url = "http://services.runescape.com/m=itemdb_oldschool/api/catalogue/detail.json?item=" + id;
        this.name = name;
        this.id = id;
        this.price = fetchPrice();

    }

    // Getters

    public int getPrice() {
        return price;
    }

    public int getAmount() {
        return amount;
    }

    public String getName() {
        return name;
    }

    // Setters

    public void setAmount(int i) {
        amount = amount + i;
    }

    // Reset Amount

    public void resetAmount() {
        amount = 0;
    }

    private int fetchPrice() {
        try (final BufferedReader reader = new BufferedReader(new InputStreamReader(new URL(url).openStream()))) {
            final String raw = reader.readLine().replace(",", "").replace("\"", "").split("price:")[1].split("}")[0];

            reader.close();
            return raw.endsWith("m") || raw.endsWith("k") ? (int) (Double.parseDouble(raw.substring(0, raw.length() - 1))
                    * (raw.endsWith("m") ? 1_000_000 : 1_000)) : Integer.parseInt(raw);
        } catch (final Exception e) {
            e.printStackTrace();
        }
        return -1;
    }

}

 

thank yall for the advice ima be looking into scripting over next few weeks since i'll be babysitting bots and bored af lol

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...