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.

Basic Script Skeleton

Featured Replies

Download: http://uppit.com/tfpejnqlq0t1/ScriptBase.java

 

In Text:

import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;

import org.osbot.script.Script;
import org.osbot.script.ScriptManifest;

@ScriptManifest(name = "Script Name", author = "Author", version = 1.0D, info = "Description goes here.")
public class ClassName extends Script {

	/*
	 * Variables
	 */

	private BufferedImage paint;
	private long startTime;

	/*
	 * Inherited Methods
	 */

	// Called at start
	public void onStart() {
		try {
			startTime = System.currentTimeMillis();
			this.paint = ImageIO.read(new URL("IMAGE URL GOES HERE."));
		} catch (Exception e) {
			// Catch
		}
	}

	// Called more than once.
	public int onLoop() {
		try {

		} catch (Exception e) {
			// Catch
		}
		return 1;
	}

	// Called at script stop
	public void onExit() {

	}

	// Called more than once, even during pause.
	public void onPaint(java.awt.Graphics g) {
		if (paint != null)
			g.drawImage(paint, 0, 0, null); //0,0 = X,Y
	}

	/*
	 * Non-Inherited Methods
	 */
	
	//Non-Inherited methods go here.

	/*
	 * Useful Methods
	 */

	//XP for level
	public int getXPForLevel(int level) {
		int points = 0;
		int output = 0;
		for (int lvl = 1; lvl <= level; lvl++) {
			points += Math.floor((double) lvl + 300.0
					* Math.pow(2.0, (double) lvl / 7.0));
			if (lvl >= level)
				return output;
			output = (int) Math.floor(points / 4);
		}
		return 0;
	}

}

onStart is called at the start of script,

onLoop is called over and over.

onExit is called on script stop.

onPaint is for the drawing.

this relogs and stuff then picks up skeleton/mask?

No... It's a basic script for script writers to use. sleep.png

Good for starting Scripters.

I was looking for one of these forever, thank you!

I will begin my epic conquest to bring top notch scripts. tongue.png

Don't forget the throws clause of the InterruptedException method declaration.

Change Exception to InterruptedException, you don't want to be blindly consuming all exceptions at the top level

Edited by n3ss3s

Guest
This topic is now closed to further replies.

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.