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.

AccuXP - [API]

Featured Replies

Meant for new scripters. If you're going to hate go away.

 

Enjoy.

package org.purplekush.api;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

import org.osbot.script.Script;
import org.osbot.script.rs2.skill.Skill;

/**
 * 
 * @author Reid (PurpleKush)
 * @version 0.1
 */

public class AccuXP {
	
	public  static String status;	
	private Script s;
	private static long startTime;
	private static int skillToTrackXP;
	private static Skill skillTracking;

	public AccuXP(Script s) {
		this.s = s;
	}

	/**
	 * Starts Timer
	 */
	public void startTimer() {
		startTime = System.currentTimeMillis();
	}

	/**
	 * What skill you would like to track
	 * @param skill
	 */
	public void trackXPForSkill(Skill skill) {
		skillToTrackXP = s.client.getSkills().getExperience(skill);
		skillTracking = skill;
	}

	/**
	 * Paint data to canvas
	 * @param g
	 */
	public void calculatePaint(Graphics g) {
		int totalXP = s.client.getSkills().getExperience(skillTracking) - skillToTrackXP;
		long millis = System.currentTimeMillis() - startTime;
		int xpPH = (int) (totalXP * 3600000.0D / millis);
		g.setColor(Color.WHITE);
		g.setFont(new Font("Myriad Pro", Font.PLAIN, 16));
		g.drawString("Time Running : "+ getFormattedTime(System.currentTimeMillis()- startTime), 7, 275);
		g.drawString("Status : " + status, 7, 295);
		g.drawString("XP P/H : " + xpPH, 7, 315);
		g.drawString("XP Gained : " + totalXP, 7, 335);
	}

	private String getFormattedTime(final long timeMilliseconds) {
		final StringBuilder b = new StringBuilder();
		final long runtime = timeMilliseconds;
		final long totalSecs = runtime / 1000;
		final long totalMins = totalSecs / 60;
		final long totalHours = totalMins / 60;
		final int seconds = (int) totalSecs % 60;
		final int minutes = (int) totalMins % 60;
		final int hours = (int) totalHours % 60;
		if (hours < 10) {
			b.append("0");
		}
		b.append(hours);
		b.append(":");
		if (minutes < 10) {
			b.append("0");
		}
		b.append(minutes);
		b.append(":");
		if (seconds < 10) {
			b.append("0");
		}
		b.append(seconds);
		return b.toString();
	}
}

Usage:

	AccuXP xp = new AccuXP(this);

        public void onStart(){
		xp.startTimer();
		xp.trackXPForSkill(Skill.COOKING);
	}

        public void onPaint(Graphics g){
		xp.calculatePaint(g);
	}

Edited by PurpleKush

Not to be rude or anything.  But what's so special about this?

  • Author

Not to be rude or anything.  But what's so special about this?

 

Did i say anything is special? I made it for myself to use and decided to post so other people can also use and it can possibly help new scripters.... fkin anjew

Not to be rude or anything.  But what's so special about this?

its isnt really to special, especially for people who know how to code this. This is really meant for those who have trouble with painting graphic on script. They could use this to study, learn, and experiment. 

  • Author

its isnt really to special, especially for people who know how to code this. This is really meant for those who have trouble with painting graphic on script. They could use this to study, learn, and experiment. 

 

+1 which is why i posted.

Not to be rude or anything. But what's so special about this?

It's a timer for experience, it will track the experience so you don't have to.

Nice to see you helping the fellow scripters, nice snippet to have! :)

I understand that this is used to track experience and whatnot, but why not just use OSBot's experienceTracker..?

I understand that this is used to track experience and whatnot, but why not just use OSBot's experienceTracker..?

he probably wasn't aware that it existed or he just wanted to make his own
  • Author

I understand that this is used to track experience and whatnot, but why not just use OSBot's experienceTracker..?

 

Didn't even know this existed :p Thanks for letting me know :D

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.