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.

[Free] TT Simple Items

Featured Replies

Hey guys, I coded this because I was too bored to make swamp tars myself. It might be a bit buggy, but shouldn't be. It's just a script that you can use near a bank when you need to craft items on one another. I added in a GUI to make it a bit easier for those who don't really know programming. It's pretty fuggin' ugly but it works decently.

d188ac5d67d4ec6e09d63df3582ea0b8.png

def62f9fc361de5cc10e83550796ce4f.png

c4e4fb2837e2b875e09c20505cc21ce5.png

only 2k of those marrentill tars are from this proggy iteration

I'll add a longer proggy in a bit, i'm using it as i make this post. but here's the .jar if you want it: https://www.mediafire.com/file/92d93klwx01c9rg/TT SimpleItemer.jar

 

 

 

For those skeptical few out there, here's the sloppy, nasty source code:

Main.java

package pkg;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.text.DecimalFormat;
import java.util.concurrent.TimeUnit;

import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;
@ScriptManifest(author = "TTScripts", info = "TT Itemer", name = "TT Itemer", version = 1.0, logo = "")
public class Main extends Script {
	
	public static String makeType = "Make All";
	public static int withdrawAmount = 24;
	public static double expPerAction = 42.5;
	public static boolean depositProduct = false;
	public static int[] widgetID = {309, 6, -1};
	public static String item1 = "Swamp tar";//stays in inv
	public static String item2 = "Marrentill";//gets withdrawn
	public static String product = "Marrentill tar";
	public static Skill training = Skill.DEFENCE;
	
	
	public boolean waiting = false;
	
	public int getState() {
		if (!getInventory().contains(item2) || !getInventory().contains(item1)) {
			return 1;
		}
		if (getInventory().contains(item2) && getInventory().contains(item1)) {
			return 0;
		}
		if (!getInventory().contains(item2) && getInventory().contains(product) && getInventory().contains(item1)) {
			return 2;
		}
		return -1;
	}
	
	
	public static Skill setTrainingSkill(String s) {
		switch (s.toUpperCase()) {
		case "PRAYER":
			return Skill.PRAYER;
		case "MAGIC":
			return Skill.MAGIC;
		case "HERBLORE":
			return Skill.HERBLORE;
		case "CRAFTING":
			return Skill.CRAFTING;
		case "FLETCHING":
			return Skill.FLETCHING;
		case "FIREMAKING":
			return Skill.FIREMAKING;
		}
		return Skill.DEFENCE;
	}
	
	
	public long startTime;
	public void onStart() throws InterruptedException {
		gui GUI = new gui();
		GUI.setVisible(true);
		while (GUI.isVisible()) {
			sleep(200);
		}
		
		getExperienceTracker().start(training);
		startTime = System.currentTimeMillis();
	}
	
	public int state = -1;
	public int waitTicks = 0;
	public int currAmount = 0;
	@Override
	public int onLoop() throws InterruptedException {
		state = getState();
		switch (state) {
		case 0:
			if (getInventory().getItem(item2).interact("Use")) {
				sleep(random(500, 700));
				if (getInventory().getItem(item1).interact()) {
					sleep(random(600, 800));
					if (widgetID[2] < 0) {
					if (getWidgets().get(widgetID[0], widgetID[1]) != null && getWidgets().get(widgetID[0], widgetID[1]).isVisible()) {
						if (getWidgets().get(widgetID[0], widgetID[1]).interact(makeType)) {
							sleep(random(800, 1100));
							if (makeType == "Make X") {
								int iA = random(28, 200);
								getKeyboard().typeString("" + iA);
							}
							new ConditionalSleep(55000){
								@ Override
								public boolean condition() throws InterruptedException
								{
									return (!getInventory().contains(item2) || getDialogues().isPendingContinuation() || getDialogues().inDialogue());
								}
							}.sleep();
						}
					}
					} else {
						if (getWidgets().get(widgetID[0], widgetID[1], widgetID[2]) != null && getWidgets().get(widgetID[0], widgetID[1], widgetID[2]).isVisible()) {
							if (getWidgets().get(widgetID[0], widgetID[1], widgetID[2]).interact(makeType)) {
								sleep(random(800, 1100));
								if (makeType == "Make X") {
									int iA = random(28, 200);
									getKeyboard().typeString("" + iA);
								}
							}
						}
					}
				}
			}
			break;
			
			
			
		case 1:
			while (!getBank().isOpen()) {
				getBank().open();
				sleep(random(1200, 1500));
			}
			sleep(random(300, 600));
			if (!getInventory().contains(item1)) {
				getBank().withdraw(item1, 1);
				sleep(random(900, 1100));
			}
			getBank().withdraw(item2, withdrawAmount);
			sleep(random(900, 1200));
			getBank().close();
			sleep(random(500, 800));
			break;
			
			
		case 2:
			NPC banker = getNpcs().closest("Banker");
			if (banker != null) {
				if (banker.interact("Bank")) {
					waitTicks = 0;
					sleep(random(900, 1200));
					if (getBank().isOpen()) {
						if (depositProduct) {
						getBank().depositAll(product);
						sleep(random(800, 1000));
						}
						getBank().withdraw(item2, withdrawAmount);
						sleep(random(800, 1100));
						getBank().close();
						sleep(random(600, 800));
					}
				}
			}
			break;
		}
		return random(500, 700);
	}
	
	
	public void onPaint(Graphics2D g) {
		int orbsDone = (int)(getExperienceTracker().getGainedXP(training) / expPerAction);
		g.setColor(Color.WHITE);
		long millis = System.currentTimeMillis() - startTime;
		String timeStr = String.format("%02d min, %02d sec", 
				TimeUnit.MILLISECONDS.toMinutes(millis),
				TimeUnit.MILLISECONDS.toSeconds(millis) - 
				TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))
				);
		DecimalFormat dc = new DecimalFormat("#,###");
		g.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
		g.drawString("Iterations completed: " + dc.format(orbsDone) , 10, 250);
		g.drawString("Time running: " + timeStr, 10, 265);
		if (training != Skill.DEFENCE) {
			g.drawString("Exp gained: " + dc.format(getExperienceTracker().getGainedXP(training)), 10, 280);
		}
	}
	

}

 

GUI.java

package pkg;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;

import javax.swing.*;
import javax.swing.GroupLayout;
import javax.swing.LayoutStyle;

public class gui extends JFrame {

	private static final long serialVersionUID = -3448595482246700623L;
	public gui() {
		initComponents();
	}

	private static String readFile(String path, Charset encoding) 
			  throws IOException 
			{
			  byte[] encoded = Files.readAllBytes(Paths.get(path));
			  return new String(encoded, encoding);
			}
	
	private void initComponents() {
		lblTool = new JLabel();
		txtTool = new JTextField();
		btnStart = new JButton();
		txtUse = new JTextField();
		lblUse = new JLabel();
		txtProduct = new JTextField();
		lblProduct = new JLabel();
		txtExp = new JTextField();
		lblExp = new JLabel();
		txtSkill = new JTextField();
		lblSkill = new JLabel();
		txtAmount = new JTextField();
		lblAmount = new JLabel();
		chkDeposit = new JCheckBox();
		txtAmount2 = new JTextField();
		lblAmount2 = new JLabel();
		txtAmount3 = new JTextField();
		txtAmount4 = new JTextField();
		label1 = new JLabel();
		label2 = new JLabel();
		comboBox1 = new JComboBox<>();
		label3 = new JLabel();
		button1 = new JButton();
		button2 = new JButton();

		//======== this ========
		setTitle("TT Simple Itemer");
		Container contentPane = getContentPane();

		//---- lblTool ----
		lblTool.setText("Tool To Use");

		//---- txtTool ----
		txtTool.setText("Chisel");

		//---- btnStart ----
		btnStart.setText("Start Script");
		btnStart.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				if (txtTool.getText() != "") {
					Main.item1 = txtTool.getText();
				}
				if (txtUse.getText() != "") {
					Main.item2 = txtUse.getText();
				}
				if (txtProduct.getText() != "") {
					Main.product = txtProduct.getText();
				}
				if (txtExp.getText() != "") {
					try {
						Main.expPerAction = Double.parseDouble(txtExp.getText());
					} catch(NumberFormatException d) {
						
					}
				}
				if (txtAmount.getText() != "") {
					try {
						Main.withdrawAmount = Integer.parseInt(txtAmount.getText());
					} catch(NumberFormatException d) {
						
					}
				}
				if (txtAmount2.getText() != "") {
					try {
						Main.widgetID[0] = Integer.parseInt(txtAmount2.getText());
					} catch(NumberFormatException d) {
						
					}
				}
				if (txtAmount3.getText() != "") {
					try {
						Main.widgetID[1] = Integer.parseInt(txtAmount3.getText());
					} catch(NumberFormatException d) {
						
					}
				}
				if (txtAmount4.getText() != "") {
					try {
						Main.widgetID[2] = Integer.parseInt(txtAmount4.getText());
					} catch(NumberFormatException d) {
						
					}
				}
				Main.makeType = comboBox1.getSelectedItem().toString();
				Main.depositProduct = chkDeposit.isSelected();
				Main.training = Main.setTrainingSkill(txtSkill.getText());
				setVisible(false);
			}
			
		});

		//---- txtUse ----
		txtUse.setText("Uncut Sapphire");

		//---- lblUse ----
		lblUse.setText("Item to use on");

		//---- txtProduct ----
		txtProduct.setText("Sapphire");

		//---- lblProduct ----
		lblProduct.setText("Product");

		//---- lblExp ----
		lblExp.setText("EXP per iteration");

		//---- lblSkill ----
		lblSkill.setText("Skill being trained");

		//---- lblAmount ----
		lblAmount.setText("Withdraw amount");

		//---- chkDeposit ----
		chkDeposit.setText("Deposit products");

		//---- txtAmount2 ----
		txtAmount2.setText("309");

		//---- lblAmount2 ----
		lblAmount2.setText("Widget IDs");

		//---- txtAmount3 ----
		txtAmount3.setText("6");

		//---- txtAmount4 ----
		txtAmount4.setText("-1");

		//---- label1 ----
		label1.setText("Set to -1 for no");

		//---- label2 ----
		label2.setText("subChildId");

		//---- comboBox1 ----
		comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
			"Make All",
			"Make X"
		}));

		//---- label3 ----
		label3.setText("Make X or Make All?");

		//---- button1 ----
		button1.setText("Save Config");
		button1.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				File dir = new File(System.getProperty("user.home") + "/AppData/Local/Temp/TT Scripts");
				dir.setExecutable(true);
				dir.setReadable(true);
				dir.setWritable(true);
				if (!dir.exists()) {
					System.out.println("Creating TT Scripts directory in Documents");
					try {
						dir.mkdir();
					} catch (SecurityException se) {
						System.out.println("Security exception");
					}
				}
				try {
					File saveFile = new File(System.getProperty("user.home") + "/AppData/Local/Temp/TT Scripts/TT Items Script.txt");
					saveFile.setExecutable(true);
					saveFile.setReadable(true);
					saveFile.setWritable(true);
					saveFile.createNewFile();
					PrintWriter writer = new PrintWriter(saveFile);
					writer.write(txtTool.getText() + "~" + txtUse.getText() + "~" + txtProduct.getText() + "~" + txtExp.getText() + "~" + txtSkill.getText() + "~" + txtAmount.getText() + "~" + txtAmount2.getText() + "~" + txtAmount3.getText() + "~" + txtAmount4.getText() + "~" + comboBox1.getSelectedIndex() + "~" + (chkDeposit.isSelected() ? "yes" : "no"));
					writer.close();
				} catch (FileNotFoundException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				} catch (IOException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
				
			}
			
		});

		//---- button2 ----
		button2.setText("Load Config");
		button2.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				File dir = new File(System.getProperty("user.home") + "/AppData/Local/Temp/TT Scripts");
				dir.setExecutable(true);
				dir.setReadable(true);
				dir.setWritable(true);
				if (!dir.exists()) {
					System.out.println("Creating TT Scripts directory in Documents");
					try {
						dir.mkdir();
					} catch (SecurityException se) {
						System.out.println("Security exception");
					}
				}
				try {
					File saveFile = new File(System.getProperty("user.home") + "/AppData/Local/Temp/TT Scripts/TT Items Script.txt");
					saveFile.setExecutable(true);
					saveFile.setReadable(true);
					saveFile.setWritable(true);
					saveFile.createNewFile();
					String content = readFile(saveFile.toString(), StandardCharsets.UTF_8);
					String parsed[] = content.split("~");
					
					try {
						txtTool.setText(parsed[0]);
						txtUse.setText(parsed[1]);
						txtProduct.setText(parsed[2]);
						txtExp.setText(parsed[3]);
						txtSkill.setText(parsed[4]);
						txtAmount.setText(parsed[5]);
						txtAmount2.setText(parsed[6]);
						txtAmount3.setText(parsed[7]);
						txtAmount4.setText(parsed[8]);
						comboBox1.setSelectedIndex(Integer.parseInt(parsed[9]));
						if (parsed[10] == "yes") {
							chkDeposit.setSelected(true);
						} else {
							chkDeposit.setSelected(false);
						}
					} catch (Exception e2) {
						
					}
				} catch (FileNotFoundException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				} catch (IOException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
				
			}
			
		});

		GroupLayout contentPaneLayout = new GroupLayout(contentPane);
		contentPane.setLayout(contentPaneLayout);
		contentPaneLayout.setHorizontalGroup(
			contentPaneLayout.createParallelGroup()
				.addGroup(contentPaneLayout.createSequentialGroup()
					.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
						.addGroup(contentPaneLayout.createSequentialGroup()
							.addGap(153, 153, 153)
							.addComponent(txtAmount2, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
							.addComponent(txtAmount3, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
							.addComponent(txtAmount4, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
							.addGroup(contentPaneLayout.createParallelGroup()
								.addComponent(label2)
								.addComponent(label1)))
						.addGroup(contentPaneLayout.createSequentialGroup()
							.addGap(18, 18, 18)
							.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
								.addComponent(lblTool)
								.addComponent(lblUse)
								.addComponent(lblProduct)
								.addComponent(lblExp)
								.addComponent(lblSkill)
								.addComponent(lblAmount2)
								.addGroup(contentPaneLayout.createParallelGroup()
									.addComponent(label3)
									.addComponent(lblAmount)))
							.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
							.addGroup(contentPaneLayout.createParallelGroup()
								.addComponent(txtUse, GroupLayout.PREFERRED_SIZE, 191, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtTool, GroupLayout.PREFERRED_SIZE, 191, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtProduct, GroupLayout.PREFERRED_SIZE, 191, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtExp, GroupLayout.PREFERRED_SIZE, 191, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtAmount, GroupLayout.PREFERRED_SIZE, 191, GroupLayout.PREFERRED_SIZE)
								.addComponent(txtSkill, GroupLayout.PREFERRED_SIZE, 191, GroupLayout.PREFERRED_SIZE)
								.addComponent(chkDeposit)
								.addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, 142, GroupLayout.PREFERRED_SIZE)))
						.addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
							.addContainerGap()
							.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
								.addComponent(button1, GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE)
								.addComponent(button2, GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE))
							.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
							.addComponent(btnStart, GroupLayout.PREFERRED_SIZE, 130, GroupLayout.PREFERRED_SIZE)))
					.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
		);
		contentPaneLayout.setVerticalGroup(
			contentPaneLayout.createParallelGroup()
				.addGroup(contentPaneLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
						.addComponent(txtTool, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblTool))
					.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
					.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
						.addComponent(txtUse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblUse))
					.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
						.addComponent(txtProduct, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblProduct))
					.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
						.addComponent(txtExp, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblExp))
					.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
						.addComponent(txtSkill, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblSkill))
					.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
						.addComponent(txtAmount, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblAmount))
					.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
						.addComponent(lblAmount2)
						.addComponent(txtAmount2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(txtAmount3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(txtAmount4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(label1))
					.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					.addComponent(label2)
					.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
					.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
						.addComponent(label3)
						.addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
					.addComponent(chkDeposit)
					.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					.addGroup(contentPaneLayout.createParallelGroup()
						.addComponent(btnStart, GroupLayout.PREFERRED_SIZE, 62, GroupLayout.PREFERRED_SIZE)
						.addGroup(contentPaneLayout.createSequentialGroup()
							.addComponent(button1)
							.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
							.addComponent(button2)))
					.addGap(5, 5, 5))
		);
		pack();
		setLocationRelativeTo(getOwner());
		// JFormDesigner - End of component initialization  //GEN-END:initComponents
	}

	private JLabel lblTool;
	private JTextField txtTool;
	private JButton btnStart;
	private JTextField txtUse;
	private JLabel lblUse;
	private JTextField txtProduct;
	private JLabel lblProduct;
	private JTextField txtExp;
	private JLabel lblExp;
	private JTextField txtSkill;
	private JLabel lblSkill;
	private JTextField txtAmount;
	private JLabel lblAmount;
	private JCheckBox chkDeposit;
	private JTextField txtAmount2;
	private JLabel lblAmount2;
	private JTextField txtAmount3;
	private JTextField txtAmount4;
	private JLabel label1;
	private JLabel label2;
	private JComboBox<String> comboBox1;
	private JLabel label3;
	private JButton button1;
	private JButton button2;
	// JFormDesigner - End of variables declaration  //GEN-END:variables
}

 

Edited by TTScripts
Added Save and Load Config buttons

  • Author
2 minutes ago, mageroni said:

going to try this

Hey i'm about to update it. I sorted out a few errors and also just added a feature where you can save a config (The GUI set up)

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.