Post your Favorite Bot here

Posts 113 of 13 · Page 1 of 1
Post your Favorite Bot here
Post yor fav bot here Heres my Favorite Mining bot.
Save as GoldPowerMiner.java

import org.rsbot.script.ScriptManifest;
import org.rsbot.script.Script;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.event.events.MessageEvent;
import java.awt.*;
import javax.imageio.ImageIO;
import java.io.IOException;
import java.net.URL;
import org.rsbot.script.methods.Skills;


@sCripTManifest(authors = {"SdcDice2"}, name = "Gold Power Miner", description = "Power Mines Gold in Crafting Guild", version = 1.1)
public class GoldPowerMiner extends Script implements PaintListener {

public int[] rocksID = {11183,11184,11185} ;
public int[] pickaxe = {1265, 1267, 1269, 1271, 1273, 1275, 14099, 14107, 15259};
public String Status = "Loading...";
public long startTime = System.currentTimeMillis();
public boolean onStart(){
log("My Lovely Script!");
mouse.setSpeed(9);
return true;
}


private void AntiBanPro() {
int randomProd = random(1, 60);
if (randomProd == 1) {
int randomMore = random(1, 5);
if (randomMore == 1) {
if (game.getCurrentTab() != 1) {
game.openTab(1);
sleep(350, 500);
mouse.move(random(678, 728), random(213, 232));
sleep(2000, 3500);
} else {
mouse.move(random(678, 728), random(213, 232));
sleep(2000, 3500);
}
} else {
sleep(1200, 2500);
}
}
if (randomProd == 2 || randomProd == 3 || randomProd == 4) {
sleep(1000, 2500);
}
if (randomProd >= 52) {
mouse.moveRandomly(65, 350);
} else {
sleep(10, 30);
}
}

private void AntiBanCamera() {
int randomNum = random(1, 35);
if (randomNum == 1 || randomNum == 2 || randomNum == 3) {
Status = "Moving Camara";
camera.moveRandomly(random(2000, 5500));
}
if (randomNum == 4 || randomNum == 5) {
camera.setAngle(random(10, 40));
}
if (randomNum == 6 || randomNum == 7) {
Status = "Moving Camara";
camera.setPitch(random(40, 68));
}
if (randomNum == 8) {
Status = "Moving Camara";
camera.setPitch(random(20, 45));

}
if (randomNum == 9 || randomNum == 10) {
Status = "Moving Camara";
camera.setPitch(random(68, 90));

} else {
sleep(50, 100);
}
}

public void messageReceived(MessageEvent e) {
String txt = e.getMessage();
if (txt.contains("manage to mine")) {


}
}


//START: Code generated using Enfilade's Easel
private Image getImage(String url) {
try {
return ImageIO.read(new URL(url));
} catch(IOException e) {
return null;
}
}

private final Color color1 = new Color(0, 0, 0);
private final Color color2 = new Color(228, 228, 0);
private final Color color3 = new Color(255, 255, 0);
private final Color color4 = new Color(204, 0, 0);

private final BasicStroke stroke1 = new BasicStroke(1);

private final Font font1 = new Font("Monotype Corsiva", 3, 16);
private final Font font2 = new Font("Monotype Corsiva", 3, 22);
private final Font font3 = new Font("Monotype Corsiva", 3, 20);

private final Image img1 = getImage("http://www.global-rs.com/img/gold_ore.gif");

public void onRepaint(Graphics g1) {

long millis = System.currentTimeMillis() - startTime;
long hours = millis / (1000 * 60 * 60);
millis -= hours * (1000 * 60 * 60);
long minutes = millis / (1000 * 60);
millis -= minutes * (1000 * 60);
long seconds = millis / 1000;

Graphics2D g = (Graphics2D)g1;
g.setColor(color1);
g.fillRect(7, 347, 219, 125);
g.setStroke(stroke1);
g.drawRect(7, 347, 219, 125);
g.setFont(font1);
g.setColor(color2);
g.drawString("Status:" + Status, 5, 419);
g.setFont(font2);
g.setColor(color3);
g.drawString("Gold Power Miner", 6, 364);
g.drawImage(img1, 168, 348, null);
g.drawImage(img1, 194, 353, null);
g.drawImage(img1, 171, 376, null);
g.setFont(font1);
g.drawString("Time Running:" + hours + ": " + minutes + ": " + seconds , 5, 406);
g.setFont(font3);
g.setColor(Color.green);
g.drawString("By SdcDice2", 8, 388);
final int percent = skills.getPercentToNextLevel(Skills.MINING); //change the MINING to the stat u want
g.setFont(font1);
g.setColor(Color.red);
g.drawString("Percent TNL: ", 5, 435);
g.setColor(Color.red);
g.fillRoundRect(10, 459, 100, 10, 15, 15); //these must be on same cordinates
g.setColor(Color.yellow);
g.fillRoundRect(10, 459, percent, 10, 15, 15); //these must be on same cordinates
g.setFont(font3);
g.setColor(Color.red);
g.drawString("" + percent +"%", 10, 455); //this must be on the center of the bar
g.drawRoundRect(10, 459, 100, 10, 15, 15);
g.drawRoundRect(10, 459, percent, 10, 15, 15);

g.drawLine(mouse.getLocation().x - 6, mouse.getLocation().y,
mouse.getLocation().x + 6, mouse.getLocation().y);
g.drawLine(mouse.getLocation

().x, mouse.getLocation().y - 6,


mouse.getLocation().x, mouse.getLocation().y + 6);
}
//END: Code generated using Enfilade's Easel


public int loop() {
mouse.setSpeed(random(4, 6));
AntiBanCamera();
if (!inventory.isFull()){
AntiBanPro();
mouse.setSpeed(random(3, 8));
if (players.getMyPlayer().getAnimation() == -1) {
RSObject rock = objects.getNearest(rocksID);
if (rock != null) {
rock.doAction("Mine");
AntiBanPro();
Status = "Mining Gold ore";
sleep(600, 800);
AntiBanCamera();

}
}
}
if (inventory.isFull()){
AntiBanPro();
Status = "Dropping Gold ore";
inventory.dropAllExcept(pickaxe);
AntiBanCamera();
}
return random(250,750);
}

public void onFinish() {
log("OMFG it Freacking works.");
}
}
how about putting it between this BB-code next time?

{code}{/code}.

Mine are Garret's air crafter and the godless fisher.

Save it as GarretsAirRunecrafter.java
Code:
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.awt.geom.Rectangle2D;
import java.text.DecimalFormat;
import java.text.NumberFormat;

import javax.swing.JOptionPane;

import org.rsbot.event.listeners.PaintListener;
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.methods.Skills;
import org.rsbot.script.wrappers.RSArea;
import org.rsbot.script.wrappers.RSTile;

@sCripTManifest(authors = { "Garrett" }, name = "Garrett's Air Runecrafter", version = 1.02, description = "Just one of those awesome air runecrafters!")

public class GarrettsAirRunecrafter extends Script implements PaintListener, MouseMotionListener {

	final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
	final GarrettsPaint thePainter = new GarrettsPaint();

	//OTHER
	boolean mode_rest = true;
	boolean setAltitude = false;
	int failCount = 0;
	int energyCheck = random(30, 50);
	int runEnergy = random(30, 50);
	int airValue = 0;
	int airsMade = 0;
	Point p = new Point(0, 0);

	//ITEMS
	final int item_tiara = 5527;
	final int item_essence = 1436;
	final int item_airRune = 556;

	//OBJECTS
	final int obj_airAltar = 2478;
	final int obj_airMystRuins = 2452;
	final int obj_airPortal = 7389;
	final int obj_bankBooth = 11402;

	//NPCS
	final int npc_musician = 8699;

	//AREAS
	final RSArea area_airAltar = new RSArea(2835, 4825, 2855, 4845);

	//TILES
	final RSTile tile_varrockBank = new RSTile(3183, 3435);
	final RSTile tile_airMystRuins = new RSTile(3183, 3435);
	final RSTile tile_musician = new RSTile(3153, 3422);
	final RSTile tile_airAltar = new RSTile(2843, 4832);

	//PATHS
	final RSTile path_airRuins[] = {new RSTile(3182, 3436), new RSTile(3182, 3429), new RSTile(3174, 3427), new RSTile(3168, 3428), new RSTile(3164, 3424), new RSTile(3160, 3420), new RSTile(3154, 3416), new RSTile(3147, 3416), new RSTile(3141, 3413), new RSTile(3135, 3408), new RSTile(3129, 3405)};

	public enum State { leaveAltar, craftRunes, walkToRuins, banking };

	public boolean onStart() {
		mode_rest = (JOptionPane.showConfirmDialog(null, "Would you like to rest at the Musician?", "Garrett's Air Runecrafter", JOptionPane.YES_NO_OPTION) == 0) ? true : false;
		airValue = grandExchange.getMarketPrice(item_airRune);
		return true;
	}

	public State getState() {
		if (area_airAltar.contains(getMyPlayer().getLocation())) {
			if (inventory.contains(item_essence))
				return State.craftRunes;
			else
				return State.leaveAltar;
		}
		if (inventory.contains(item_essence))
			return State.walkToRuins;
		else
			return State.banking;
	}

	public int loop() {

		try {
			if (!game.isLoggedIn())
				return random(1000, 2000);

			if(!setAltitude) {
				camera.setPitch(true);
				sleep(random(250, 500));
				setAltitude = true;
				return random(50, 100);
			}

			if (walking.getEnergy() > runEnergy && !walking.isRunEnabled()) {
				runEnergy = random(30, 50);
				walking.setRun(true);
				return random(500, 750);
			}

			thePainter.scriptRunning = true;
			if (!thePainter.savedStats)
				thePainter.saveStats();

			antiBan();
		} catch(Exception e) { }

		switch(getState()) {
		case banking:
			try {
				if (calc.distanceTo(tile_varrockBank) > 10) {
					if (!getMyPlayer().isMoving() || calc.distanceTo(walking.getDestination()) <= random(5, 7))
						walking.walkPathMM(walking.reversePath(walking.randomizePath(path_airRuins, 2, 2)));
					return random(200, 400);
				} else {
					if (bank.isOpen()) {
						if (inventory.contains(item_airRune)) {
							airsMade += inventory.getCount(true, item_airRune);
							bank.depositAll();
							failCount = 0;
							while(inventory.contains(item_airRune) && failCount < 30) {
								sleep(random(90, 100));
								failCount++;
							}
						} else {
							bank.withdraw(item_essence, 0);
							failCount = 0;
							while(!inventory.contains(item_essence) && failCount < 30) {
								sleep(random(90, 100));
								failCount++;
							}
						}
					} else {
						if (objects.getNearest(obj_bankBooth) != null && objects.getNearest(obj_bankBooth).isOnScreen()) {
							if (objects.getNearest(obj_bankBooth).doAction("Use-quickly")) {
								sleep(random(500, 750));
								failCount = 0;
								while(!bank.isOpen() && failCount < 50) {
									if (getMyPlayer().isMoving())
										failCount = 0;
									sleep(random(90, 100));
									failCount++;
								}
							}
						} else {
							if (getMyPlayer().isMoving())
								return random(200, 400);
							walking.walkTileMM(objects.getNearest(obj_bankBooth).getLocation());
							sleep(random(500, 750));
						}
					}
				}
			} catch(Exception e) { }
			return random(50, 150);
		case leaveAltar:
			try {
				if (objects.getNearest(obj_airPortal) != null && objects.getNearest(obj_airPortal).isOnScreen()) {
					if (objects.getNearest(obj_airPortal).doAction("Enter")) {
						failCount = 0;
						while(area_airAltar.contains(getMyPlayer().getLocation()) && failCount < 5) {
							if (getMyPlayer().isMoving())
								failCount = 0;
							sleep(random(90, 100));
							failCount++;
						}
					}
				} else {
					if (getMyPlayer().isMoving())
						return random(200, 400);
					if (objects.getNearest(obj_airPortal) != null)
						walking.walkTileMM(objects.getNearest(obj_airPortal).getLocation());
					sleep(random(500, 750));
				}
			} catch(Exception e) { }
			return random(50, 150);
		case craftRunes:
			try {
				if (objects.getNearest(obj_airAltar) != null && objects.getNearest(obj_airAltar).isOnScreen()) {
					if (objects.getNearest(obj_airAltar).doAction("Craft-rune")) {
						sleep(random(500, 750));
						failCount = 0;
						while(getMyPlayer().getAnimation() != -1 && failCount < 50) {
							if (getMyPlayer().isMoving())
								failCount = 0;
							sleep(random(90, 100));
							failCount++;
						}
					}
				} else {
					if (getMyPlayer().isMoving())
						return random(200, 400);
					walking.walkTileMM(tile_airAltar);
					sleep(random(500, 750));
				}
			} catch(Exception e) { }
			return random(50, 150);
		case walkToRuins:
			try {
				if (objects.getNearest(obj_airMystRuins) != null) {
					if (objects.getNearest(obj_airMystRuins).isOnScreen()) {
						if (objects.getNearest(obj_airMystRuins).doAction("Enter")) {
							failCount = 0;
							while(!area_airAltar.contains(getMyPlayer().getLocation()) && failCount < 7) {
								if (getMyPlayer().isMoving())
									failCount = 0;
								sleep(random(90, 100));
								failCount++;
							}
						}
						return random(50, 150);
					}
				}
				if (getMyPlayer().isMoving() && calc.distanceTo(walking.getDestination()) >= random(5, 7))
					return random(50, 150);
				if (mode_rest && walking.getEnergy() < energyCheck && calc.distanceTo(tile_musician) <= 12) {
					energyCheck = random(10, 40);
					if (!getMyPlayer().isMoving() || calc.distanceTo(walking.getDestination()) <= random(5, 7))
						walking.walkTo(tile_musician);
					sleep(random(750, 1000));
					failCount = 0;
					while(getMyPlayer().isMoving() && failCount < 80) {
						try {
							if (npcs.getNearest(npc_musician).isOnScreen())
								break;
						} catch(Exception e) { }
						sleep(random(90, 100));
						failCount++;
					}
					if (npcs.getNearest(npc_musician) != null && npcs.getNearest(npc_musician).isOnScreen()) {
						for (int i = 0; i <= 5; i++) {
							if (npcs.getNearest(npc_musician).doAction("Listen-to")) {
								failCount = 0;
								while(failCount < 50) {
									int anim = getMyPlayer().getAnimation();
									if (anim == 12108 || anim == 2033 || anim == 2716 || anim == 11786 || anim == 5713) {
										failCount = 0;
										if (walking.getEnergy() >= 100)
											return random(50, 150);
									}
									if (getMyPlayer().isMoving())
										failCount = 0;
									sleep(random(90, 100));
									failCount++;
								}
							}
						}
					}
					return random(50, 150);
				}
				if (!getMyPlayer().isMoving() || calc.distanceTo(walking.getDestination()) <= random(5, 7))
					walking.walkPathMM(walking.randomizePath(path_airRuins, 2, 2));
			} catch(Exception e) { }
			return random(50, 150);
		}

		return random(50, 150);
	}

	public void antiBan() {
		int random = random(1, 24);
		switch (random) {
		case 1:
			if (random(1, 10) != 1)
				break;
			mouse.move(random(10, 750), random(10, 495));
			break;
		case 2:
			if (random(1, 40) != 1)
				break;
			int angle = camera.getAngle() + random(-90, 90);
			if (angle < 0) {
				angle = random(0, 10);
			}
			if (angle > 359) {
				angle = random(0, 10);
			}
			camera.setAngle(angle);
			break;
		case 3:
			if (random(1, 3) != 1)
				break;
			mouse.moveSlightly();
			break;
		default:
			break;
		}
	}

	public void onFinish() {

	}

	public void onRepaint(Graphics g) {
		thePainter.paint(g);
	}

	//If you use my paint please give credit.
	public class GarrettsPaint {

		final Rectangle r = new Rectangle(7, 345, 408, 114);
		final Rectangle r1 = new Rectangle(420, 345, 77, 25);
		final Rectangle r2 = new Rectangle(420, 374, 77, 26);
		final Rectangle r3 = new Rectangle(420, 404, 77, 26);
		final Rectangle r4 = new Rectangle(420, 434, 77, 25);
		final Rectangle r2c = new Rectangle(415, 374, 5, 26);
		final Rectangle r3c = new Rectangle(415, 404, 5, 26);
		final Rectangle r4c = new Rectangle(415, 434, 5, 25);
		final Rectangle sb1 = new Rectangle(12, 350, 398, 12);
		final Rectangle sb2 = new Rectangle(12, 363, 398, 12);
		final Rectangle sb3 = new Rectangle(12, 376, 398, 12);
		final Rectangle sb4 = new Rectangle(12, 389, 398, 12);
		final Rectangle sb5 = new Rectangle(12, 402, 398, 12);
		final Rectangle sb6 = new Rectangle(12, 415, 398, 12);
		final Rectangle sb7 = new Rectangle(12, 428, 398, 12);
		final Rectangle sb8 = new Rectangle(12, 441, 398, 12);
		final Rectangle sb1s = new Rectangle(12, 350, 196, 12);
		final Rectangle sb2s = new Rectangle(12, 363, 196, 12);
		final Rectangle sb3s = new Rectangle(12, 376, 196, 12);
		final Rectangle sb4s = new Rectangle(12, 389, 196, 12);
		final Rectangle sb5s = new Rectangle(12, 402, 196, 12);
		final Rectangle sb6s = new Rectangle(12, 415, 196, 12);
		final Rectangle sb7s = new Rectangle(12, 428, 196, 12);
		final Rectangle sb8s = new Rectangle(12, 441, 196, 12);
		final Rectangle sb9s = new Rectangle(213, 350, 196, 12);
		final Rectangle sb10s = new Rectangle(213, 363, 196, 12);
		final Rectangle sb11s = new Rectangle(213, 376, 196, 12);
		final Rectangle sb12s = new Rectangle(213, 389, 196, 12);
		final Rectangle sb13s = new Rectangle(213, 402, 196, 12);
		final Rectangle sb14s = new Rectangle(213, 415, 196, 12);
		final Rectangle sb15s = new Rectangle(213, 428, 196, 12);
		final Rectangle sb16s = new Rectangle(213, 441, 196, 12);
		Rectangle[] skillBars = new Rectangle[] {sb1, sb2, sb3, sb4, sb5, sb6, sb7, sb8};
		boolean savedStats = false;
		boolean scriptRunning = false;
		boolean checkedCount = false;
		int currentTab = 0;
		int lastTab = 0;
		int[] barIndex = new int[16];
		int[] start_exp = null;
		int[] start_lvl = null;
		int[] gained_exp = null;
		int[] gained_lvl = null;

		Thread mouseWatcher = new Thread();
		final NumberFormat nf = NumberFormat.getInstance();

		final long time_ScriptStart = System.currentTimeMillis();
		long runTime = System.currentTimeMillis() - time_ScriptStart;

		int sine = 0;
		int sineM = 1;
		public void paint(final Graphics g) {
			if (!scriptRunning)
				return;

			//credits to Jacmob for the pulsing
			if (sine >= 84) {
				sine = 84;
				sineM *= -1;
			} else if (sine <= 1) {
				sine = 1;
				sineM *= -1;
			}
			sine += sineM;

			runTime = System.currentTimeMillis() - time_ScriptStart;
			final String formattedTime = formatTime((int) runTime);

			currentTab = paintTab();

			switch(currentTab) {
			case -1: //PAINT OFF
				g.setColor(new Color(0, 0, 0, 150));
				g.fillRect(r1.x, r1.y, r1.width, r1.height);
				g.setColor(Color.WHITE);
				drawString(g, "Show Paint", r1, 5);
				break;
			case 0: //DEFAULT TAB - MAIN
				NumberFormat fm = new DecimalFormat("#,###,###");
				DecimalFormat df = new DecimalFormat("#.#");
				drawPaint(g, r2c);
				g.setColor(new Color(100, 100, 100, 200));
				g.drawLine(r.x + 204, r.y + 22, r.x + 204, r.y + 109);
				g.setColor(Color.WHITE);
				g.setFont(new Font("sansserif", Font.BOLD, 14));
				drawString(g, properties.name(), r, -40);
				g.setFont(new Font("sansserif", Font.PLAIN, 12));
				drawStringMain(g, "Runtime: ", formattedTime, r, 20, 35, 0, true);
				int essUsedPerHour = 0;
				int airsPerHour = 0;
				int moneyPerHour = 0;
				double airsPerEss = 0;
				int gainedEXP = skills.getCurrentExp(Skills****NECRAFTING) - start_exp[Skills****NECRAFTING];
				final int essUsed = (gainedEXP / 5);
				final int totalMoney = airsMade * airValue;
				if (essUsed > 0)
					airsPerEss = airsMade / essUsed;
				if ((runTime / 1000) > 0) {
					essUsedPerHour = (int) ((3600000.0 / (double) runTime) * essUsed);
					airsPerHour = (int) ((3600000.0 / (double) runTime) * airsMade);
					moneyPerHour = (int) ((3600000.0 / (double) runTime) * totalMoney);
				}
				drawStringMain(g, "Airs Created: ", fm.format((long)airsMade), r, 20, 35, 2, true);
				drawStringMain(g, "Airs / Hour: ", fm.format((long)airsPerHour), r, 20, 35, 3, true);
				drawStringMain(g, "Airs / Essence: ", df.format(airsPerEss), r, 20, 35, 4, true);
				drawStringMain(g, "Essence Used: ", fm.format((long)essUsed), r, 20, 35, 1, false);
				drawStringMain(g, "Essence / Hour: ", fm.format((long)essUsedPerHour), r, 20, 35, 2, false);
				drawStringMain(g, "Money Gained: $", fm.format((long)totalMoney), r, 20, 35, 3, false);
				drawStringMain(g, "Money / Hour: $", fm.format((long)moneyPerHour), r, 20, 35, 4, false);
				break;
			case 1: //INFO
				drawPaint(g, r3c);
				g.setColor(new Color(100, 100, 100, 200));
				g.drawLine(r.x + 204, r.y + 22, r.x + 204, r.y + 109);
				g.setColor(Color.WHITE);
				g.setFont(new Font("sansserif", Font.BOLD, 14));
				drawString(g, properties.name(), r, -40);
				g.setFont(new Font("sansserif", Font.PLAIN, 12));
				drawStringMain(g, "Version: ", Double.toString(properties.version()), r, 20, 35, 0, true);
				break;
			case 2: //STATS
				drawPaint(g, r4c);
				drawStats(g);
				hoverMenu(g);
				break;
			}
		}

		public void saveStats() {
			nf.setMinimumIntegerDigits(2);
			final String[] stats = Skills.SKILL_NAMES;
			start_exp = new int[stats.length];
			start_lvl = new int[stats.length];
			for (int i = 0; i < 25; i++) {
				start_exp[i] = skills.getCurrentExp(i);
				start_lvl[i] = skills.getCurrentLevel(i);
			}
			for (int i = 0; i < barIndex.length; i++) {
				barIndex[i] = -1;
			}
			savedStats = true;
		}

		public int paintTab() {
			final Point mouse = new Point(p);
			if (mouseWatcher.isAlive())
				return currentTab;
			if (r1.contains(mouse)) {
				mouseWatcher = new Thread(new MouseWatcher(r1));
				mouseWatcher.start();
				if (currentTab == -1) {
					return lastTab;
				} else {
					lastTab = currentTab;
					return -1;
				}
			}
			if (currentTab == -1)
				return currentTab;
			if (r2.contains(mouse))
				return 0;
			if (r3.contains(mouse))
				return 1;
			if (r4.contains(mouse))
				return 2;
			return currentTab;
		}

		public void drawPaint(final Graphics g, final Rectangle rect) {
			g.setColor(new Color(0, 0, 0, 230));
			g.fillRect(r1.x, r1.y, r1.width, r1.height);
			g.fillRect(r2.x, r2.y, r2.width, r2.height);
			g.fillRect(r3.x, r3.y, r3.width, r3.height);
			g.fillRect(r4.x, r4.y, r4.width, r4.height);
			g.fillRect(rect.x, rect.y, rect.width, rect.height);
			g.fillRect(r.x, r.y, r.width, r.height);
			g.setColor(Color.WHITE);
			drawString(g, "Hide Paint", r1, 5);
			drawString(g, "MAIN", r2, 5);
			drawString(g, "INFO", r3, 5);
			drawString(g, "STATS", r4, 5);
			g.setColor(new Color(0, 0, 0, 230));
		}

		public void drawStat(final Graphics g, final int index, final int count) {
			if (count >= skillBars.length && !checkedCount) {
				skillBars = new Rectangle[] {sb1s, sb2s, sb3s, sb4s, sb5s, sb6s, sb7s, sb8s, sb9s, sb10s, sb11s, sb12s, sb13s, sb14s, sb15s, sb16s};
				checkedCount = true;
			}
			if (count >= skillBars.length)
				return;
			g.setFont(new Font("serif", Font.PLAIN, 11));
			g.setColor(new Color(100, 100, 100, 150));
			g.fillRect(skillBars[count].x, skillBars[count].y, skillBars[count].width, skillBars[count].height);
			final int percent = skills.getPercentToNextLevel(index);
			g.setColor(new Color(255 - 2 * percent, (int) (1.7 * percent + sine), 0, 150));
			g.fillRect(skillBars[count].x, skillBars[count].y, (int) (((double) skillBars[count].width / 100.0) * (double) percent), skillBars[count].height);
			g.setColor(Color.WHITE);
			final String name = Skills.SKILL_NAMES[index];
			final String capitalized = name.substring(0, 1).toUpperCase() + name.substring(1);
			g.drawString(capitalized, skillBars[count].x + 2, skillBars[count].y + 10);
			drawStringEnd(g, percent + "%", skillBars[count], -2, 4);
			barIndex[count] = index;
		}

		public void drawStats(final Graphics g) {
			final String[] stats = Skills.SKILL_NAMES;
			int count = 0;
			gained_exp = new int[stats.length];
			gained_lvl = new int[stats.length];
			for (int i = 0; i < 25; i++) {
				gained_exp[i] = skills.getCurrentExp(i) - start_exp[i];
				gained_lvl[i] = skills.getCurrentLevel(i) - start_lvl[i];
				if (gained_exp[i] > 0) {
					drawStat(g, i, count);
					count++;
				}
			}
		}

		public void hoverMenu(final Graphics g) {
			final Point mouse = new Point(p);
			final Rectangle r_main = new Rectangle(mouse.x, mouse.y - 150, 300, 150);
			for (int i = 0; i < barIndex.length; i++) {
				if (barIndex[i] > -1) {
					if (skillBars[i].contains(mouse)) {
						final int xpTL = skills.getExpToNextLevel(barIndex[i]);
						final int xpHour = ((int) ((3600000.0 / (double) runTime) * gained_exp[barIndex[i]]));
						final int TTL = (int) (((double) xpTL / (double) xpHour) * 3600000);
						g.setColor(new Color(50, 50, 50, 240));
						g.fillRect(r_main.x, r_main.y, r_main.width, r_main.height);
						g.setColor(Color.WHITE);
						g.setFont(new Font("sansserif", Font.BOLD, 15));
						drawString(g, Skills.SKILL_NAMES[barIndex[i]].toUpperCase(), r_main, -58);
						g.setFont(new Font("sansserif", Font.PLAIN, 12));
						hoverDrawString(g, "Current Level: ", skills.getCurrentLevel(barIndex[i]) + "", r_main, 40, 0);
						hoverDrawString(g, "XP Gained: ", gained_exp[barIndex[i]] + "xp", r_main, 40, 1);
						hoverDrawString(g, "XP / Hour: ", xpHour + "xp", r_main, 40, 2);
						hoverDrawString(g, "LVL Gained: ", gained_lvl[barIndex[i]] + " lvls", r_main, 40, 3);
						hoverDrawString(g, "XPTL: ", xpTL + "xp", r_main, 40, 4);
						hoverDrawString(g, "TTL: ", formatTime(TTL), r_main, 40, 5);
					}
				}
			}
		}

		public void hoverDrawString(final Graphics g, final String str, final String val, final Rectangle rect, final int offset, final int index) {
			g.setColor(Color.WHITE);
			final FontMetrics font = g.getFontMetrics();
			final Rectangle2D bounds = font.getStringBounds(val, g);
			final int width = (int) bounds.getWidth();
			final int y = rect.y + offset + (20 * index);
			g.drawString(str, rect.x + 5, y);
			g.drawString(val, (rect.x + rect.width) - width - 5, y);
			if (index < 5) {
				g.setColor(new Color(100, 100, 100, 200));
				g.drawLine(rect.x + 5, y + 5, rect.x + rect.width - 5, y + 5);
			}
		}

		public void drawString(final Graphics g, final String str, final Rectangle rect, final int offset) {
			final FontMetrics font = g.getFontMetrics();
			final Rectangle2D bounds = font.getStringBounds(str, g);
			final int width = (int) bounds.getWidth();
			g.drawString(str, rect.x + ((rect.width - width) / 2), rect.y + ((rect.height / 2) + offset));
		}

		public void drawStringEnd(final Graphics g, final String str, final Rectangle rect, final int xOffset, final int yOffset) {
			final FontMetrics font = g.getFontMetrics();
			final Rectangle2D bounds = font.getStringBounds(str, g);
			final int width = (int) bounds.getWidth();
			g.drawString(str, (rect.x + rect.width) - width + xOffset, rect.y + ((rect.height / 2) + yOffset));
		}

		public void drawStringMain(final Graphics g, final String str, final String val, final Rectangle rect, final int xOffset, final int yOffset, final int index, final boolean leftSide) {
			final FontMetrics font = g.getFontMetrics();
			final Rectangle2D bounds = font.getStringBounds(val, g);
			final int indexMult = 17;
			final int width = (int) bounds.getWidth();
			if (leftSide) {
				g.drawString(str, rect.x + xOffset, rect.y + yOffset + (index * indexMult));
				g.drawString(val, rect.x + (rect.width / 2) - width - xOffset, rect.y + yOffset + (index * indexMult));
			} else {
				g.drawString(str, rect.x + (rect.width / 2) + xOffset, rect.y + yOffset + (index * indexMult));
				g.drawString(val, rect.x + rect.width - width - xOffset, rect.y + yOffset + (index * indexMult));
			}
		}

		public String formatTime(final int milliseconds) {
			final long t_seconds = milliseconds / 1000;
			final long t_minutes = t_seconds / 60;
			final long t_hours = t_minutes / 60;
			final int seconds = (int) (t_seconds % 60);
			final int minutes = (int) (t_minutes % 60);
			final int hours = (int) (t_hours % 60);
			return (nf.format(hours) + ":" + nf.format(minutes) + ":" + nf.format(seconds));
		}

		public class MouseWatcher implements Runnable {

			Rectangle rect = null;

			MouseWatcher(final Rectangle rect) {
				this.rect = rect;
			}

			public void run() {
				Point mouse = new Point(p);
				while (rect.contains(mouse)) {
					try {
						mouse = new Point(p);
						Thread.sleep(50);
					} catch(Exception e) { }
				}
			}

		}

	}

	public void mouseMoved(MouseEvent e) {
		p = e.getPoint();
	}

	public void mouseDragged(MouseEvent e) {

	}

}
All credits to Garret!
yes sorry i diden't know how to do dat
Quote Originally Posted by yoda23456 View Post
yes sorry i diden't know how to do dat
Wouldn't be the name of the Bot sufficient?
I don't need the code
LOL Ravallo is right, will be a fucking mess.
Well I'm using Lumber Jack to cut Willow and soon Yew, is good to make money and level up.
Quote Originally Posted by Jigsaw View Post
LOL Ravallo is right, will be a fucking mess.
Well I'm using Lumber Jack to cut Willow and soon Yew, is good to make money and level up.
No, it's not gonna be a big mess. Just look how I posted it. Looks good.
Quote Originally Posted by Superpunt View Post
No, it's not gonna be a big mess. Just look how I posted it. Looks good.
It's not needed either
I think it's better attach the .java files.
Quote Originally Posted by Jigsaw View Post
I think it's better attach the .java files.
In that case we'd need to go to MPGH's standard protocol. Which means 2 virusscans and a screenshot
Quote Originally Posted by Superpunt View Post
In that case we'd need to go to MPGH's standard protocol. Which means 2 virusscans and a screenshot
Yes, would be better and have more organization, at least for me.
Epicbot is my personal favorite. Its way better than other ones. It has a bunch of free ones and a bunch of beta ones. No paid ones unless you upgrade your bottin client to pro. Pretty sweet.
Quote Originally Posted by yoda23456 View Post
Code:
Post yor fav bot here Heres my Favorite Mining bot.
Save as GoldPowerMiner.java

import org.rsbot.script.ScriptManifest;
import org.rsbot.script.Script;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.event.events.MessageEvent;
import java.awt.*;
import javax.imageio.ImageIO;
import java.io.IOException;
import java.net.URL;
import org.rsbot.script.methods.Skills;


@sCripTManifest(authors = {"SdcDice2"}, name = "Gold Power Miner", description = "Power Mines Gold in Crafting Guild", version = 1.1)
public class GoldPowerMiner extends Script implements PaintListener {
 
public int[] rocksID = {11183,11184,11185} ;
public int[] pickaxe = {1265, 1267, 1269, 1271, 1273, 1275, 14099, 14107, 15259};
public String Status = "Loading...";
public long startTime = System.currentTimeMillis();
    public boolean onStart(){
		log("My Lovely Script!");
		mouse.setSpeed(9);
		return true;
    }
   
    
 private void AntiBanPro() {
        int randomProd = random(1, 60);
        if (randomProd == 1) {
            int randomMore = random(1, 5);
            if (randomMore == 1) {
                if (game.getCurrentTab() != 1) {
                    game.openTab(1);
                    sleep(350, 500);
                    mouse.move(random(678, 728), random(213, 232));
                    sleep(2000, 3500);
                } else {
                    mouse.move(random(678, 728), random(213, 232));
                    sleep(2000, 3500);
                }
            } else {
                sleep(1200, 2500);
            }
        }
        if (randomProd == 2 || randomProd == 3 || randomProd == 4) {
            sleep(1000, 2500);
        }
        if (randomProd >= 52) {
            mouse.moveRandomly(65, 350);
        } else {
            sleep(10, 30);
        }
    }

    private void AntiBanCamera() {
        int randomNum = random(1, 35);
        if (randomNum == 1 || randomNum == 2 || randomNum == 3) {
        	Status = "Moving Camara";
            camera.moveRandomly(random(2000, 5500));
        }
        if (randomNum == 4 || randomNum == 5) {
            camera.setAngle(random(10, 40));
        }
        if (randomNum == 6 || randomNum == 7) {
        	Status = "Moving Camara";
            camera.setPitch(random(40, 68));
        }
        if (randomNum == 8) {
        	Status = "Moving Camara";
            camera.setPitch(random(20, 45));

        }
        if (randomNum == 9 || randomNum == 10) {
        	Status = "Moving Camara";
            camera.setPitch(random(68, 90));

        } else {
            sleep(50, 100);
        }
    }

    public void messageReceived(MessageEvent e) {
        String txt = e.getMessage();
        if (txt.contains("manage to mine")) {
           
            
        }
    }

		
    //START: Code generated using Enfilade's Easel
    private Image getImage(String url) {
        try {
            return ImageIO.read(new URL(url));
        } catch(IOException e) {
            return null;
        }
    }

    private final Color color1 = new Color(0, 0, 0);
    private final Color color2 = new Color(228, 228, 0);
    private final Color color3 = new Color(255, 255, 0);
    private final Color color4 = new Color(204, 0, 0);

    private final BasicStroke stroke1 = new BasicStroke(1);

    private final Font font1 = new Font("Monotype Corsiva", 3, 16);
    private final Font font2 = new Font("Monotype Corsiva", 3, 22);
    private final Font font3 = new Font("Monotype Corsiva", 3, 20);

    private final Image img1 = getImage("http://www.global-rs.com/img/gold_ore.gif");

    public void onRepaint(Graphics g1) {
    	
    	long millis = System.currentTimeMillis() - startTime;
        long hours = millis / (1000 * 60 * 60);
        millis -= hours * (1000 * 60 * 60);
        long minutes = millis / (1000 * 60);
        millis -= minutes * (1000 * 60);
        long seconds = millis / 1000;
    	
        Graphics2D g = (Graphics2D)g1;
        g.setColor(color1);
        g.fillRect(7, 347, 219, 125);
        g.setStroke(stroke1);
        g.drawRect(7, 347, 219, 125);
        g.setFont(font1);
        g.setColor(color2);
        g.drawString("Status:" + Status, 5, 419);
        g.setFont(font2);
        g.setColor(color3);
        g.drawString("Gold Power Miner", 6, 364);
        g.drawImage(img1, 168, 348, null);
        g.drawImage(img1, 194, 353, null);
        g.drawImage(img1, 171, 376, null);
        g.setFont(font1);
        g.drawString("Time Running:" + hours + ": " + minutes + ": " + seconds , 5, 406);
        g.setFont(font3);
        g.setColor(Color.green);
        g.drawString("By SdcDice2", 8, 388);
    	final int percent = skills.getPercentToNextLevel(Skills.MINING); //change the MINING to the stat u want
            g.setFont(font1);
            g.setColor(Color.red);
      	    g.drawString("Percent TNL: ", 5, 435);
            g.setColor(Color.red);
            g.fillRoundRect(10, 459, 100, 10, 15, 15); //these must be on same cordinates
            g.setColor(Color.yellow);
            g.fillRoundRect(10, 459, percent, 10, 15, 15); //these must be on same cordinates
            g.setFont(font3);
            g.setColor(Color.red);
            g.drawString("" + percent +"%", 10, 455); //this must be on the center of the bar
            g.drawRoundRect(10, 459, 100, 10, 15, 15);
            g.drawRoundRect(10, 459, percent, 10, 15, 15);
       
	 g.drawLine(mouse.getLocation().x - 6, mouse.getLocation().y,
        		mouse.getLocation().x + 6, mouse.getLocation().y);
        		g.drawLine(mouse.getLocation

        		().x, mouse.getLocation().y - 6,
        						

        		mouse.getLocation().x, mouse.getLocation().y + 6);
    }
    //END: Code generated using Enfilade's Easel		


    public int loop() {
        mouse.setSpeed(random(4, 6));
        AntiBanCamera();
        if (!inventory.isFull()){ 
            AntiBanPro();
            mouse.setSpeed(random(3, 8));
      if (players.getMyPlayer().getAnimation() == -1) {
          RSObject rock = objects.getNearest(rocksID);
          if (rock != null) {
           rock.doAction("Mine");
	   AntiBanPro();
           Status = "Mining Gold ore";
    	   sleep(600, 800);
           AntiBanCamera();

         	 }
      }
        }
        if (inventory.isFull()){
            AntiBanPro();
     	Status = "Dropping Gold ore";
         inventory.dropAllExcept(pickaxe);
            AntiBanCamera();
      }
        return random(250,750);
    }
   
    public void onFinish() {
		log("OMFG it Freacking works.");
    }
}
fixed .
ty
Quote Originally Posted by Thunder View Post


fixed .
thnx Man :=3
Posts 113 of 13 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?