Jump to content







ProGranite by Angus----The most flawless Granite Powermining script


  • Please log in to reply
38 replies to this topic

#1
angusckf96

angusckf96
  • Members
  • 95 posts
  • Joined 24-July 10

ProGranite v1.3   (Supports v.2.5)

Please support me by joining my forum!
http://angusscripts.allcx.com/
It has all my updated scripts and helpful tips:)


I found the lack of granite script.LOL

Yesterday night when i was trying to find a working granite script that supports water tiara i couldn't find one(dont scream at me if you have a working granite script lol)
This script supports both waterskin and enchanted water tiara
A lot of credits to Robert_G, as he helped me to fix many bugs.


FEATURES ::
-SUPPORT WATERSKINS AND ENCHANTED WATER TIARA!!
-FAST DROPPING
-MY FIRST SEXY PAINT(ACTUALLY THE FIRST PAINT I FEEL COMFORTABLE WITH LOL)
-AND MY SEXY MOUSE(AGAIN IF YOU USE MY OTHER SCRIPTS YOU KNOW WHAT MOUSE IM GONNA USE LOL)
-ANTIBAN
-NO NEED TO BANK BECAUSE WHEN WATERSKINS(4) RAN OUT THE SCRIPT WILL NOT DROP THE WATERSKIN IT SIMPLY GOES TO THE CACTUS AND GET WATER, THIS METHOD IS SO EFFECTIVE FOR POWERMINING BECAUSE IT REQUIRES LESS INVENTORY SPACE AND IT ALSO SAVES TIME FOR BANKING.

HOW TO SET UP ::
IF USING WATERSKIN YOUR INVENTORY SHOULD BE:
Posted Image
AND YOUR EQUIPMENT TAB SHOULD SOMEWHAT LOOK LIKE THIS IN ORDER TO HAVE THE BEST EFFECT: (IGNORE THE SCARF AND SKILLCAPE, BUT THE DESERT EQUIPMENT IS ESSENSIAL FOR THE BOT TO WORK EFFECTIVELY)
Posted Image
IF USING ENCHANTED WATER TIARA YOU SHOULD HAVE NOTHING IN INVENTORY TAB AND YOUR EQUIPMENT TAB SHOULD SOMEWHAT LOOK LIKE THIS:
Posted Image


UPDATE LOG ::

[SIZE=2][COLOR=blue][FONT=Comic Sans MS][COLOR=sienna][COLOR=darkred][FONT=Arial][COLOR=black]v1.0 Initial Release
v1.1 Fix a bit spam clicking
v1.2 Added antiban
v1.3 Added waterskin support, and hiding paint function
[/COLOR][/FONT][/COLOR][/COLOR][/FONT][/COLOR][/SIZE]


WORKING ON ::
[SIZE=2]A lot of things lol
-GUI
AND A LOT MORE...
[/SIZE]

CODE (Save as ProGranite.java)::
//*Update Log~~//
//v1.0 initial release//
//v1.1 fixed a bit spam clicking//
//v1.2 added antiban//
//v1.3 added waterskins support!Also added hide paint function!//
//Script belongs to Angus. If i see this script in anywhere else and my name is taken off, i will report stolen//
//Working on:
//GUI
//Autuupdate option
//And more soon in future updates....
//Thanks for using my script

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import javax.imageio.ImageIO;
import org.rsbot.event.events.MessageEvent;
import org.rsbot.event.listeners.MessageListener;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.script.Random;
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.methods.Game.Tab;
import org.rsbot.script.methods.Skills;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.wrappers.RSTile;
import java.awt.event.MouseListener;


@ScriptManifest(authors = { "Angus" }, keywords = { "Mining" }, name = "ProGranite", description = "Powermines Granite in Quarry", version = 1.3)
public class ProGranite extends Script implements PaintListener,	MessageListener, MouseListener {


	int[] granite = { 10947 };
	int[] pickaxe = { 1265, 1267, 1269, 1271, 1273, 1275, 14099, 14107, 15259, 1831, 1829, 1827, 1825, 1823, 946 };
	public int tiara = 11969;
	public int cactus = 2670;
	public int waterskin0 = 1831;
	public int waterskin1 = 1829;
	public int waterskin2 = 1827;
	public int waterskin3 = 1825;
	public int waterskin4 = 1823;
	public int[] items_keep = { 1823, 1825, 1827, 1829, 1831, 946, 995, 1265,
			1267, 1269, 1271, 1273, 1275, 14099, 14107, 15259 };
	public boolean useTiara = false;
	public boolean useSkin = false;
	public String Status;
	BufferedImage normal = null;
	BufferedImage clicked = null;
	@SuppressWarnings("unused")
	private Random randomGenerator;
	int startExp;
	int xpGained = 0;
	int granitesMined = 0;
	public int EstMine;
	public int startLevel;
	public int lvlsGained;
	public int expPerMine = 50;
	public int granitesTNL;
	private int percentTNL;
	public int expHour = 0;
	public int currLevel;
	public long startTime = 0;
	public long millis = 0;
	public long hours = 0;
	public long minutes = 0;
	public long seconds = 0;
	public long last = 0;
	RSTile cactusTile = new RSTile(3191, 2906, 0);
	RSTile mineTile = new RSTile(3167, 2910, 0);
	Rectangle close = new Rectangle(5, 6, 145, 16);//this is the point on screen you click in to turn pain on and off.
	  Point p;
	  boolean hide = false;
		

	@Override
	public boolean onStart() {
		if (equipment.containsAll(tiara)) {
			useTiara = true;
			Status = "Checking";
			log("Good. You have tiara equipped");
		}
		if (!inventory.contains(waterskin4) && !equipment.containsAll(tiara)) {
			log("You do not have anything to start with, please either have tiara equipped or waterskin(4) in inventory.");
			stopScript();
		}
		if (inventory.containsOneOf(waterskin0, waterskin1, waterskin2,
				waterskin3, waterskin4)) {
			useSkin = true;
			Status = "Checking";
			log("Good. You have waterskin in inventory.");
		}
		try {
			final URL cursorURL = new URL("http://i48.tinypic.com/313623n.png");
			final URL cursor80URL = new URL("http://i46.tinypic.com/9prjnt.png");
			normal = ImageIO.read(cursorURL);
			clicked = ImageIO.read(cursor80URL);
		} catch (MalformedURLException e) {
			log("Unable to buffer cursor.");
		} catch (IOException e) {
			log("Unable to open cursor image.");
		}
		startExp = skills.getCurrentExp(Skills.MINING);
		startLevel = skills.getCurrentLevel(Skills.MINING);
		startTime = System.currentTimeMillis();
		mouse.setSpeed(random(5, 6));
		log("Thanks for using my script:)");
		return true;
	}

	@Override
	public void mouseClicked(MouseEvent e) {//this is the mouse listener, it listen's for the click.
		p = e.getPoint();
		if(close.contains(p) && !hide){
			hide = true;
			} else if(close.contains(p) && hide){
			hide = false;
			}
		
	}
		
		
	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
		
		
	private boolean needWater() {
		return inventory.contains(waterskin0);
	}
	
	private boolean skinCheck() {
		return inventory.contains(waterskin0) || inventory.contains(waterskin1) || inventory.contains(waterskin2);
	}


	@Override
	public int loop() {
		if (useSkin) {
			if (needWater()) {
				Status = "Cutting cactus";
				if (!atCactus()) {
					toCactus();
				}
			}
			if (atCactus()) {
				while (skinCheck())
				cutCactus();


			}
			if (!needWater()) {
				if (atMine()) {
					doMine();
					sleep(1800);
				}
			}
			if (!atMine() && !needWater()) {
				toMine();


			}
		}
		antiBan();
		if (!useSkin && useTiara) {
			if (gotSpace()) {
				Status = "Mining";
				doMine();
				sleep(random(1200, 1400));
			}
		}
		if (inventory.isFull()) {
			Status = "Dropping";
			inventory.dropAllExcept(pickaxe);
		}
		return random(500, 1000);
	}


	public void toCactus() {
		RSObject i = objects.getNearest(cactus);
		walking.walkTileMM(i.getLocation());
	}


	private void toMine() {
		RSObject i = objects.getNearest(granite);
		walking.walkTileMM(i.getLocation());
	}


	private boolean atCactus() {
		RSObject c = objects.getNearest(cactus);
		return c != null && c.isOnScreen();


	}


	private boolean gotSpace() {
		return !inventory.isFull();
	}


	private boolean isIdle() {
		return getMyPlayer().getAnimation() == -1;
	}


	private void cutCactus() {
		RSObject Cactus = objects.getNearest(cactus);
		if (Cactus != null && Cactus.isOnScreen() && isIdle()) {
			Cactus.interact("Cut");
			sleep(random(1000, 1200));
		}
	}


	private boolean atMine() {
		RSObject rock = objects.getNearest(granite);
		return rock != null && rock.isOnScreen();
	}


	private boolean doMine() {
		RSObject rock = objects.getNearest(granite);
		return rock != null && rock.isOnScreen() && isIdle()
				&& rock.interact("Mine");
	}


	@Override
	public void messageReceived(MessageEvent e) {
		String message = e.getMessage();
		if (message.contains("some granite")) {
			granitesMined++;
		}
	}


	public void antiBan() {
		Status = "Doing Antiban...";
		int x = random(0, 10);
		switch (x) {
		case 1:
			if (random(3, 7) == 5) {
				mouse.moveSlightly();
				sleep(200, 600);
				mouse.moveRandomly(150, 350);
			}
			break;
		case 2:
			if (random(5, 8) == 7) {
				camera.setAngle(random(60, 140));
				sleep(400, 1200);


			}
			break;
		case 3:
			if (random(4, 10) == 6) {
				camera.moveRandomly(1100);
				sleep(random(600, random(1200, 2000)));
			}
			break;
		case 6:
			if ((random(1, 10) == 7)) {
				game.openTab(Tab.MAGIC);
				skills.doHover(Skills.INTERFACE_MAGIC);
				sleep(random(2000, 3150));
			}
			break;
		case 8:
			if ((random(1, 10) == 9)) {
				game.openTab(Tab.STATS);
				skills.doHover(Skills.INTERFACE_MINING);
				sleep(random(2000, 3150));
			}
			break;
		case 10:
			if ((random(2, 6) == 4)) {
				camera.moveRandomly(1000);
				sleep(random(500, 800));
			}
			break;
		default:
			break;
		}
	}


	@Override
	public void onFinish() {
		log("Thanks For using my script once again!");
	}


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


	// Paint Colors//
	private final Color color1 = new Color(196, 179, 140);
	private final Color color2 = new Color(0, 0, 0);
	private final Color color3 = new Color(255, 0, 0);
	private final Color color4 = new Color(62, 58, 58);
	private final Color color5 = new Color(51, 57, 59);
	private final Color color6 = new Color(255, 255, 255);
		private final Color color7 = new Color(51, 51, 255);

		
	private final BasicStroke stroke1 = new BasicStroke(3);


	private final Font font1 = new Font("Ashby Medium", 0, 20);
	private final Font font2 = new Font("Ashby Medium", 0, 14);
	private final Font font3 = new Font("Ashby Medium", 0, 12);
	private final Font font4 = new Font("Arial", 0, 9);
	private final Font font5 = new Font("Ashby Medium", 1, 16);
		private final Font font6 = new Font("Comic Sans MS", 0, 9);


		

	private final Image img1 = getImage("http://i879.photobucket.com/albums/ab353/acka090215/miningcape-1.png");


	// End of Paint Variables---------//


	@Override
	public void onRepaint(Graphics g1) {
		Graphics2D g = (Graphics2D) g1;
		granitesTNL = skills.getExpToNextLevel(Skills.MINING) / expPerMine;
		currLevel = skills.getCurrentLevel(Skills.MINING);
		lvlsGained = currLevel - startLevel;
		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;
		EstMine = skills.getExpToNextLevel(Skills.MINING) / 50;
		expHour = (int) ((xpGained) * 3600000D / (System.currentTimeMillis() - startTime));
		percentTNL = skills.getPercentToNextLevel(Skills.MINING);
		xpGained = skills.getCurrentExp(Skills.MINING) - startExp;
		final int percentBar = (int) (skills.getPercentToNextLevel(Skills.MINING) * 5.1);
				if(hide) {
				g.setFont(font6);
				g.setColor(color6);			   
				g.drawString("Show Paint", 96, 33);
				g.setColor(color2);
				g.fillRect(5, 6, 145, 16);
				g.setColor(color7);
				g.fillRect(76, 7, 72, 13);
		g.setColor(color1);
		g.fillRect(7, 345, 489, 113);
		g.setColor(color2);
		g.fillRect(4, 318, 511, 18);
		g.setColor(color3);
		g.setStroke(stroke1);
		g.drawRect(4, 318, 511, 18);
		g.setColor(color4);
		g.fillRect(5, 318, percentBar, 18);
		g.setColor(color3);
		g.drawRect(5, 318, percentBar, 18);
		g.setFont(font1);
		g.setColor(color5);
		g.drawString("ProGranite v1.3", 8, 364);
		g.setFont(font2);
		g.drawString("Time Running:" + hours + ":" + minutes + ":" + seconds,
				10, 388);
		g.drawString("XP Gained:" + xpGained, 10, 404);
		g.drawString("Levels Gained:" + lvlsGained, 10, 420);
		g.drawString("XP/HR:" + expHour, 10, 436);
		g.drawString("XP TNL:" + skills.getExpToNextLevel(Skills.MINING), 10,
				452);
		g.drawString("Granites mined:" + granitesMined, 170, 388);
		g.drawString("Percent TNL:" + percentTNL, 170, 404);
		g.drawString("Status:" + Status, 170, 436);
		g.setColor(color5);
		g.drawString("Approx.Granites TNL:" + granitesTNL, 170, 420);
		g.setFont(font3);
		g.setColor(color6);
		g.drawString("Percent TNL:" + percentTNL, 9, 333);
		g.setFont(font4);
		g.drawString("", 202, 415);
		g.drawImage(img1, 398, 193, null);
		g.setFont(font5);
		g.drawString("Script by Angus:)", 170, 453);				
				}
				if(!hide){				
				g.setFont(font6);
				g.setColor(color6);			   
				g.drawString("Hide Paint", 8, 33);
				g.setColor(color2);
				g.fillRect(5, 6, 145, 16);
				g.setColor(color7);
				g.fillRect(76, 7, 72, 13);
				}				
		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);																		 
			}
		}
	}
	// END: Code generated using Enfilade's Easel

}
or pastebin: http://pastebin.com/Q3Dy1rGa

  
PROGGIES ::

Andorakaton said:

Gyruth said:

Here is a progress report for you:
http://img849.images...sprogranite.png

Nice work on the script so far, there is definitely room for improvement but, this is a great start!

Edited by angusckf96, 19 June 2011 - 07:02 PM.


#2
Andorakaton

Andorakaton
  • Members
  • 14 posts
  • Joined 30-April 11
Pastebin link please? (Using v2.48)

#3
angusckf96

angusckf96
  • Members
  • 95 posts
  • Joined 24-July 10
ok ill put it in pastebin wait a sec

#4
AJ28

AJ28
  • Restricted
  • 708 posts
  • Joined 02-April 11
Is it Safe?

#5
angusckf96

angusckf96
  • Members
  • 95 posts
  • Joined 24-July 10
EDIT: OK i just put it to pastebin

@AJ28
Yes is safe as long as you dont bot 24/7
i tried 7 hours yesterday night and it works perfectly fine

#6
Andorakaton

Andorakaton
  • Members
  • 14 posts
  • Joined 30-April 11
Works great !

Major problems:

1. Antiban (please do this first!)

2. Waterskins.

Minor problems:

1. The bot doesn't drop granite flawlessly.

Edited by Andorakaton, 07 June 2011 - 11:45 PM.


#7
angusckf96

angusckf96
  • Members
  • 95 posts
  • Joined 24-July 10
Thanks if you don't mind please post proggies:)
and btw i just update the script so now it clicks better:)

#8
Andorakaton

Andorakaton
  • Members
  • 14 posts
  • Joined 30-April 11
Here you go :)

Posted Image

#9
angusckf96

angusckf96
  • Members
  • 95 posts
  • Joined 24-July 10

Andorakaton said:


Thanks a lot:)

#10
Gyruth

Gyruth
  • Members
  • 20 posts
  • Joined 09-June 11
It might be a good idea to have it choose one set of granite, maybe the one closest when you login as opposed to running around the quarry since that is not what normal players do. The script worked great for the most part, it may also enhance XP per hour to drop the granite immediately after it is mined instead of waiting until you have a full inventory. Hope this information helps, I'll post a proggie tomorrow or the day after.

#11
Andorakaton

Andorakaton
  • Members
  • 14 posts
  • Joined 30-April 11
Please update/fix your script, it doesn't drop granite anymore :/

Edited by Andorakaton, 09 June 2011 - 01:07 PM.


#12
Gyruth

Gyruth
  • Members
  • 20 posts
  • Joined 09-June 11

Andorakaton said:

Please update/fix your script, it doesn't drop granite anymore :/

Thats a bot problem not a script problem --  also one thing I forgot to mention before Angus, a way to hide the paint would be amazing.

#13
angusckf96

angusckf96
  • Members
  • 95 posts
  • Joined 24-July 10
ok ill try to add hiding in next update:)

@andorakation
wait for 2.49 update

#14
angusckf96

angusckf96
  • Members
  • 95 posts
  • Joined 24-July 10
Good. But how do you update to 2.49
mind telling me the link to download the client?

#15
Andorakaton

Andorakaton
  • Members
  • 14 posts
  • Joined 30-April 11
I deleted my previous post for a reason. I downloaded "v2.49" from another site, and I figured out that it was a scam. So I had to do some
virus scanning on my computer, changed password, information etc..

Still waiting eagerly like you for the new update :/

EDIT

You can now download it from this site.

Edited by Andorakaton, 10 June 2011 - 12:27 AM.


#16
angusckf96

angusckf96
  • Members
  • 95 posts
  • Joined 24-July 10
lol rsbot 2.49 is out and i still cant see the dropping function working

#17
Andorakaton

Andorakaton
  • Members
  • 14 posts
  • Joined 30-April 11
Yep, it's annoying..

#18
angusckf96

angusckf96
  • Members
  • 95 posts
  • Joined 24-July 10
i hate when i want to update my script but i can't

#19
Gyruth

Gyruth
  • Members
  • 20 posts
  • Joined 09-June 11
http://www.powerbot....ad.php?t=813278 will fix your bot so you can start scripting again. Enjoy!

#20
angusckf96

angusckf96
  • Members
  • 95 posts
  • Joined 24-July 10
thanks ill try tomorrow afternoon since is pretty late rite now