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.

Explv's Dank Paint Tutorial

Featured Replies

How do I use the string in onPaint?

right now I have

g.drawString("Elapsed Time: "  + startTime, 20, 265);                but it isn't working so well lol

I'm still on the fence as far as trying to learn scripting, but if I do, I will definitely make use of this tutorial. Thanks!

How do I use the string in onPaint?

right now I have

g.drawString("Elapsed Time: "  + startTime, 20, 265);                but it isn't working so well lol

Add this method:

public final String formatTime(final long ms){
    long s = ms / 1000, m = s / 60, h = m / 60;
    s %= 60; m %= 60; h %= 24;
    return String.format("%02d:%02d:%02d", h, m, s);
}

Taken from the OP.

 

now in place of startTime, put

formatTime(startTime)

And it should work well.

Add this method:

public final String formatTime(final long ms){
    long s = ms / 1000, m = s / 60, h = m / 60;
    s %= 60; m %= 60; h %= 24;
    return String.format("%02d:%02d:%02d", h, m, s);
}

Taken from the OP.

 

now in place of startTime, put

formatTime(startTime)

And it should work well.

At the login screen it says; Elapsed Time - 00:00:00 and when it actually starts ingame it just says 12:25:06 and stays like that.

 

 

So I've added

private long startTime;

 
final long runTime = System.currentTimeMillis() - startTime;
 
public final String formatTime(final long ms){
   long s = ms / 1000, m = s / 60, h = m / 60;
   s %= 60; m %= 60; h %= 24;
   return String.format("%02d:%02d:%02d", h, m, s);}
 
 
then to onStart I've added
 
startTime = System.currentTimeMillis();
 
and onPaint:
 
g.drawString("Elapsed Time: "  + formatTime(startTime), 10, 332);

 

At the login screen it says; Elapsed Time - 00:00:00 and when it actually starts ingame it just says 12:25:06 and stays like that.

 

 

So I've added

private long startTime;

 
final long runTime = System.currentTimeMillis() - startTime;
 
public final String formatTime(final long ms){
   long s = ms / 1000, m = s / 60, h = m / 60;
   s %= 60; m %= 60; h %= 24;
   return String.format("%02d:%02d:%02d", h, m, s);}
 
 
then to onStart I've added
 
startTime = System.currentTimeMillis();
 
and onPaint:
 
g.drawString("Elapsed Time: "  + formatTime(startTime), 10, 332);

 

Oh should have been

formatTime(runTime)

Sorry was my bad or something.

Oh should have been

formatTime(runTime)

Sorry was my bad or something.

Now it just says 12:45:43 from login screen and aswell when it runs unsure.png

 

EDIT: It works now.

 

Changed -> final long runTime = System.currentTimeMillis() - startTime;

To ->                long runTime = System.currentTimeMillis() - startTime;

 

and moved it to onPaint smile.png

Edited by Hafdellaren

Now it just says 12:45:43 from login screen and aswell when it runs unsure.png

 

EDIT: It works now.

 

Changed -> final long runTime = System.currentTimeMillis() - startTime;

To ->                long runTime = System.currentTimeMillis() - startTime;

 

and moved it to onPaint smile.png

Oh i didn't know u didn't have it in onPaint() anywayz good job :)

  • 2 months later...
  • 2 weeks later...
  • 1 month later...

could u please add a preset for a rgb mouse? 

  • 2 weeks later...
On 12/2/2015 at 3:54 AM, Explv said:

private Optional<Integer> getPrice(int id){ Optional<Integer> price = Optional.empty(); try { URL url = new URL("http://api.rsbuddy.com/grandExchange?a=guidePrice&i=" + id); URLConnection con = url.openConnection(); con.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"); con.setUseCaches(true); BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream())); String[] data = br.readLine().replace("{", "").replace("}", "").split(","); br.close(); price = Optional.of(Integer.parseInt(data[0].split(":")[1])); } catch(Exception e){ e.printStackTrace(); } return price; }

Hey i simply dont understand how to implement this code. What imports do i need for it?

3 hours ago, CanCo said:

Hey i simply dont understand how to implement this code. What imports do i need for it?

Just input the price manually if you can't figure this out.

3 hours ago, HeyImJamie said:

Just input the price manually if you can't figure this out.

How much cpu would you say having something that calculates gp/hr and runtime use? or would it be negligible? 

18 minutes ago, Antonio Kala said:

How much cpu would you say having something that calculates gp/hr and runtime use? or would it be negligible? 

runtime would be near negligible but calculating GP/h depends on whether your getting prices from GE constantly and what other calculation your doing. if its a simple calculation also near negligible 

11 minutes ago, IDontEvenBot said:

runtime would be near negligible but calculating GP/h depends on whether your getting prices from GE constantly and what other calculation your doing. if its a simple calculation also near negligible 

Someone told me paint runs on a separate thread regardless of what it is, and thus it's better if avoided?

Create an account or sign in to comment

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.