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.

Paint. Hows does it work?

Featured Replies

I know some of the API to display paint, but i really don't want JUST text on screen. IS there a way i can put an image i made on screen? (I know it is possible due to it being done on other scripts, i'm just unsure of how.) 

If you any of you know of a thread or section that has a guide or walkthrough of all of it, a link to that would be HIGHLY appreciated. Thanks :)

Welp it's pretty simple acutally. All you need is an Image, which you get from a URL.

 

You need to create 2 instance variables:

Image paintImg;
URL paintUrl;

then in your onStart do the following:


try {
paintUrl = new URL("yourPaint.com");
} catch (MalformedURLException e1) {
log("Problem loading URL.");
e1.printStackTrace();
}
try {
paintImg = ImageIO.read(paintUrl);
} catch (IOException e1) {
log("Problem loading image from URL.");
e1.printStackTrace();
}

Finally, paint it in your onPaint().

g.drawImage(paintImg, x, y, width,height,this);

Edited by Deffiliate

 

Welp it's pretty simple acutally. All you need is an Image, which you get from a URL.

 

You need to create 2 instance variables:

Image paintImg;
URL paintUrl = new URL("yourPaint.com");

then in your onStart do the following:

paintImg = ImageIO.read(url); 

Finally, paint it in your onPaint().

g.drawImage(paintImg, x, y, width,height,this);

 

what would "this" be?

what would "this" be?

"this" refers to your instance of your class. It means your main class will watch over the image.

 

Don't change it just keep it as "this". Also, make sure you add those changes I made to my post.

Edited by Deffiliate

"this" refers to a parameter or a local variable that has the same name or is similar to another variable (I think)

 

// Global Variable

int Vara = 0;

 

public void DoThis(int Vara) {

this.Vara = Vara; // Grabs the parameter and sets it to the global variable

}

 

Welp it's pretty simple acutally. All you need is an Image, which you get from a URL.

 

You need to create 2 instance variables:

Image paintImg;
URL paintUrl;

then in your onStart do the following:


try {
paintUrl = new URL("yourPaint.com");
} catch (MalformedURLException e1) {
log("Problem loading URL.");
e1.printStackTrace();
}
try {
paintImg = ImageIO.read(paintUrl);
} catch (IOException e1) {
log("Problem loading image from URL.");
e1.printStackTrace();
}

Finally, paint it in your onPaint().

g.drawImage(paintImg, x, y, width,height,this);

 

paintIMG and paintURL are both "wrong" according to eclipse. As far as i can tell, there's nothing to import.

paintIMG and paintURL are both "wrong" according to eclipse. As far as i can tell, there's nothing to import.

Because you haven't done this... 

856dS.png

You need to import Image and URL...

import javax.imageio.ImageIO;
import java.net.URL;

 

Because you haven't done this... 

856dS.png

You need to import Image and URL...

import javax.imageio.ImageIO;
import java.net.URL;

Hmmm, I have those imports and i have created the instance variables. Does it matter where i declare them?

Hmmm, I have those imports and i have created the instance variables. Does it matter where i declare them?

You can declare an instance variable anywhere after this:

public class MyScript extends Script {

Edited by Deffiliate

 

You can declare an instance variable anywhere after this:

public class MyScript extends Script {

Mmmkay, thank you for the help. You're practically spoon feeding me and i can't get this to work. I'll figure it out. smile.png

If it helps,

http://gyazo.com/d8b1cbcb019ab0467589d88d9053922c

 

 

EDIT: Solved that issue, Now i'm getting this.

http://gyazo.com/660780ce0d959268249e89b5c1a6d35d

Edited by Bitter

/no problem. remove the URL and Image here: http://puu.sh/85795.png, you've already got it declared about.

Yep that was exactly the problem. tongue.png I just wish i had seen that sooner xD.

 

Now i'm getting this.

http://gyazo.com/660...49e89b5c1a6d35d

Edited by Bitter

uhmm simplest option would be to change "this" to null.

PERFECT. Can i rep you without actually doing a transaction with you? I went to rep and it was making me choose from buyer, or seller or something. :x

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.