Skip 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.

Loading any Tradeable item image onto a GUI

Featured Replies

I made this for fun and I really don't plan on using it. I'm gonna release it. Feel free to use it or don't. I don't care doge.png

 

Also the code isn't that clean.

 

What it does:

 

https://gyazo.com/442cf002eb683ed0343f6f62f79e2d15

 

 

Code (Note* the first item search may lag a tiny bit due to loading the text document from online. An easy fix is to load the text document locally):

 

package org.empathy.combat.equipment.gui;

import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;

public class Gui extends JFrame {

    private JPanel contentPane;
    private JTextField textField;
    private int itemId;
    String path = "http://cdn.rsbuddy.com/items/" + itemId + ".png";
    JLabel lblNewLabel;
    BufferedImage image;
    private JLabel lblTypeAnItem;
    
    
    /**
     * Launch the application.
     */
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    Gui frame = new Gui();
                    frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    /**
     * Create the frame.
     */
    public Gui() {
        //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(100, 100, 340, 382);
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        setContentPane(contentPane);
        contentPane.setLayout(null);
        
        textField = new JTextField();
        textField.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent arg0) {
                checkText();                
                
            }
            
        });
        textField.setBounds(118, 49, 86, 20);
        contentPane.add(textField);
        textField.setColumns(10);
        
        try {

        image = ImageIO.read(new URL(path));
        lblNewLabel = new JLabel();
        lblNewLabel.setBounds(118, 92, 86, 73);
        contentPane.add(lblNewLabel);
        
        lblTypeAnItem = new JLabel("Type an item name and hit Enter");
        lblTypeAnItem.setBounds(80, 28, 208, 14);
        contentPane.add(lblTypeAnItem);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    
    public void checkText() {
        if (textField.getText() != null) {
            try {
                URL url = new URL("https://gist.githubusercontent.com/anonymous/a1aa9894c1acc0c1c201/raw/b8bd35ed57a9cedfb1dc2379212ac79faa979136/IDs.txt");
                BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
                String line;
                while ((line = in.readLine()) != null) {
                    if (line.toLowerCase().contains(textField.getText().toLowerCase())) {
                        String[] x = line.toLowerCase().split(textField.getText().toLowerCase() + " - ");
                        int i = Integer.parseInt(x[1]);
                        image = ImageIO.read(new URL("http://cdn.rsbuddy.com/items/" + i + ".png"));
                        lblNewLabel.setIcon(new ImageIcon(image));
                        break;
                        }
                    }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

Edited by empathy

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.