I am using RSbot since the new update (2.25), but how do i insert a script.
Code:
//Imports
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.methods.GrandExchange.GEItem;
import org.rsbot.script.wrappers.RSGroundItem;
import org.rsbot.script.wrappers.RSTile;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import javax.imageio.ImageIO;
@ScriptManifest(authors = { "Nunnsy" }, name = "AshesToGold", version = 1.43, keywords = {"Ashes", "Gold", "To", "AshesToGold", "Nunnsy", "Money Making"}, description = "Picks up and banks ashes! (GE)")
public class AshesToGold extends Script implements PaintListener, MouseMotionListener {
//Variables
// - Integers
int Ashes = 592;
int ashes_gained = 0;
int ashes_price = 0;
int money_gained = 0;
int ashes_in_bank = 0;
int cache = 0;
int ashes_hr = 0;
int money_hr = 0;
int m_x;
int m_y;
// - Strings, GEItems, RSTiles, Booleans
String antiban_status = "N/A";
String location = "GE";
String player = "N/A";
GEItem ashes_ge;
RSTile GETile_b = new RSTile (3168, 3487);
RSTile GETile;
boolean transparent = false;
// - Images for cursor paint
BufferedImage normal = null;
BufferedImage clicked = null;
// - Anti-Ban
int ar_1 = 1;
int ar_2 = 1;
// - Time
public long startTime = 0;
public long millis = 0;
public long hours = 0;
public long minutes = 0;
public long seconds = 0;
public long last = 0;
//Startup program
public boolean onStart() {
startTime = System.currentTimeMillis();
//Get the cursor images
try {
final URL cursorURL = new URL("http://i48.tinypic.com/313623n.png"); //Normal
final URL cursor80URL = new URL("http://i54.tinypic.com/20as1ld.png"); //Clicked
normal = ImageIO.read(cursorURL);
clicked = ImageIO.read(cursor80URL);
} catch (MalformedURLException e) {
log.severe("Unable to buffer cursor.");
} catch (IOException e) {
log.severe("Unable to open cursor image.");
}
log("Looking up ash price...");
ashes_ge = grandExchange.lookup(Ashes);
ashes_price = ashes_ge.getMarketPrice();
log("Ash price: " + ashes_price);
GETile = GETile_b;
mouse.setSpeed(random(4, 7));
player = getMyPlayer().getName();
camera.setPitch(true);
log("AshesToGold Started: " + player);
return true;
}
//Finishing Program
public void onFinish(){
log("Ashes Gained: " + ashes_gained);
log("Money Gained: " + money_gained);
log("AshesToGold Stopped: " + player);
log("Thanks for using AshesToGold!");
}
//The all mighty loop
@Override
public int loop() {
//Start the Anti-Ban
antiban();
//Change GETile
change_tile();
//Sets camera pitch
if (camera.getPitch() < 1851) {
camera.setPitch(true);
}
//Check if player is running
if (!walking.isRunEnabled() && walking.getEnergy() > random(50, 90)) {
walking.setRun(true);
}
//Get ashes or go to bank
if (!inventory.isFull()) {
takeashes();
sleep(random(400, 600));
} else {
inventory.dropAllExcept(Ashes);
if (inventory.isFull()){
if (calc.distanceTo(GETile) > 1 ) {
walktoge();
}
sleep(random(1000, 2000));
bankashes();
}
}
ash_count();
return random(300, 500);
}
public void change_tile() {
if (random(1, 30) == 17) {
GETile = GETile_b.randomize(1, 1);
}
}
//Anti-Ban Program
public void antiban() {
//1/40 chance of running an anti-ban
ar_1 = random(1, 40);
if (ar_1 == 27) {
ar_2 = random(1, 8);
if (ar_2 == 1){
antiban_status = "Mouse";
mouse.moveOffScreen();
sleep(random(200, 1000));
}
else if (ar_2 == 2) {
antiban_status = "Mouse";
mouse.moveSlightly();
mouse.moveSlightly();
mouse.moveSlightly();
}
else if (ar_2 == 3) {
antiban_status = "Mouse";
mouse.setSpeed(random(4, 8));
}
else if (ar_2 == 4) {
antiban_status = "Mouse";
mouse.moveSlightly();
mouse.moveSlightly();
}
else if (ar_2 == 5) {
antiban_status = "Mouse";
mouse.moveOffScreen();
sleep(random(3000, 6000));
}
else if (ar_2 == 6) {
antiban_status = "Camera";
if(random(1, 3) == 2) {
int r = random(1,2);
camera.setAngle(random(1,359));
if(r!=1)
camera.setPitch(random(1,99));
}
}
else if (ar_2 == 7) {
antiban_status = "Camera";
if(random(1, 3) == 2) {
int r = random(1,2);
camera.setAngle(random(1,359));
if(r!=1)
camera.setPitch(random(1,99));
}
}
else if (ar_2 == 8) {
antiban_status = "Camera";
if(random(1, 3) == 2) {
int r = random(1,2);
camera.setAngle(random(1,359));
if(r!=1)
camera.setPitch(random(1,99));
}
}
else if (ar_2 == 9) {
antiban_status = "XP";
mouse.move(random(527, 540), random(58, 65),0,0);
sleep(random(800,1000));
mouse.click(true);
mouse.moveRandomly(20,50);
sleep(random(3000,4000));
}
else {
antiban_status = "Running";
}
sleep(2000);
}
antiban_status = "Running";
}
//Take ashes action
public void takeashes() {
RSGroundItem ashes = groundItems.getNearest(Ashes);
if (!getMyPlayer().isMoving()) {
if ((groundItems.getNearest(Ashes) != null) && (calc.tileOnScreen(ashes.getLocation())) && getMyPlayer().isIdle()) {
ashes.doAction("Take");
cursor_move();
}
else if ((groundItems.getNearest(Ashes) != null) && (!calc.tileOnScreen(ashes.getLocation()))) {
if (calc.tileOnScreen(ashes.getLocation())) {
walking.walkTileOnScreen(groundItems.getNearest(Ashes).getLocation());
cursor_move();
} else {
walking.walkTileMM(groundItems.getNearest(Ashes).getLocation());
cursor_move();
}
} else {
walktoge();
cursor_move();
sleep(random(2000, 5000));
}
}
}
//Check ashes
public void ash_count() {
ashes_gained = inventory.getCount(Ashes) + ashes_in_bank;
money_gained = ashes_gained * ashes_price;
}
//Cursor move
public void cursor_move() {
if (random(1, 4) == 2) {
mouse.moveSlightly();
mouse.moveSlightly();
}
}
//Walk to GE program
public void walktoge() {
if (!getMyPlayer().isMoving()) {
if (calc.tileOnScreen(GETile) == true) {
walking.walkTileOnScreen(GETile);
} else {
walking.walkTo(GETile);
}
}
}
//Bank ashes program
public void bankashes() {
if (!getMyPlayer().isMoving()) {
bank.open();
mouse.setSpeed(8);
sleep(random(1500, 2000));
cache = inventory.getCount(Ashes);
sleep(random(200, 300));
bank.depositAll();
sleep(random(2000, 2500));
bank.close();
if (inventory.getCount(Ashes) == 0) {
ashes_in_bank += cache;
}
cache = 0;
sleep(random(200, 500));
mouse.setSpeed(random(4, 8));
}
}
@Override
public void mouseMoved(MouseEvent e) {
m_x = e.getX();
m_y = e.getY();
}
//Variables for paint
// - Colours
private final Color color1 = new Color(255, 255, 255);
private final Color color2 = new Color(0, 0, 0);
private final Color color1_t = new Color(255, 255, 255, 100);
private final Color color2_t = new Color(0, 0, 0, 100);
// - Fonts
private final Font font1 = new Font("Arial", 0, 12);
private final Font font2 = new Font("Arial", 0, 9);
// - Other
private final BasicStroke stroke1 = new BasicStroke(3);
public void onRepaint(Graphics g1) {
Graphics2D g = (Graphics2D)g1;
if (m_x >= 334 && m_x < 334 + 180 && m_y >= 244 && m_y < 244 + 91) {
transparent = true;
} else {
transparent = false;
}
//Cursor paint
if (normal != null) {
final int mouse_x = mouse.getLocation().x;
final int mouse_y = mouse.getLocation().y;
final int mouse_x2 = mouse.getPressLocation().x;
final int mouse_y2 = mouse.getPressLocation().y;
final long mpt = System.currentTimeMillis()
- mouse.getPressTime();
if (mouse.getPressTime() == -1 || mpt >= 1000) {
g.drawImage(normal, mouse_x - 8, mouse_y - 8, null);
}
if (mpt < 1000) {
g.drawImage(clicked, mouse_x2 - 8, mouse_y2 - 8, null);
g.drawImage(normal, mouse_x - 8, mouse_y - 8, null);
}
}
ashes_hr = (int) ((ashes_gained) * 3600000D / (System.currentTimeMillis() - startTime));
money_hr = ashes_hr * ashes_price;
millis = System.currentTimeMillis() - startTime;
hours = millis / (1000 * 60 * 60);
millis -= hours * (1000 * 60 * 60);
minutes = millis / (1000 * 60);
millis -= minutes * (1000 * 60);
seconds = millis / 1000;
if (transparent == true) {
g.setColor(color2_t);
} else {
g.setColor(color2);
}
g.fillRect(334, 244, 180, 91);
if (transparent == true) {
g.setColor(color1_t);
} else {
g.setColor(color1);
}
g.setStroke(stroke1);
g.drawRect(334, 244, 180, 91);
if (transparent == true) {
g.setColor(color1_t);
} else {
g.setColor(color1);
}
g.setFont(font1);
g.drawString("AshesToGold - Nunnsy", 362, 265);
g.setFont(font2);
g.drawString("Runtime: " + hours +":"+ minutes + ":" + seconds, 346, 281);
g.drawString("Ashes: " + ashes_gained, 347, 295);
g.drawString("Money: " + money_gained, 346, 311);
g.drawString("Money/Hr: " + money_hr, 425, 311);
g.drawString("Ashes/Hr: " + ashes_hr, 425, 295);
g.drawString("Anti-Ban: " + antiban_status, 425, 280);
g.drawString("Ash Price: " + ashes_price, 346, 327);
g.drawString("Location: " + location, 424, 327);
}
@Override
public void mouseDragged(MouseEvent arg0) {
}
}
Now i got the following: Some errors, but none of the ash script and all my other files in scripts are removed, except the .java files.....