All pastes #2054815 Raw Edit

Anonymous

public text v1 · immutable
#2054815 ·published 2011-05-07 09:47 UTC
rendered paste body
import org.rsbot.script.*;
import org.rsbot.script.wrappers.*;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.Script;
import java.util.Random;
import java.awt.Point;
import org.rsbot.script.wrappers.RSPlayer;
import java.awt.*;
import javax.imageio.ImageIO;
import java.io.IOException;
import java.net.URL;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import org.rsbot.event.listeners.*;
import java.awt.Color;
import org.rsbot.event.events.MessageEvent;

@ScriptManifest(authors = {"Rachnerd"}, keywords = {""}, name = "RNClaySoftener", description = "Start in Edgeville bank!", version = 1.1)

public class RNClaySoftener extends Script implements MessageListener, PaintListener, MouseListener {
	private int mousemove = 200, mmax = 5, mmin = 3;
	
	Point location = null;
	    RSPlayer[] rsplayers;
	    RSObject[] rsobjects;
	    Random r = new Random();
	    int int1, int2;
	    private int wh, tempint;
	    
 // RSTile = (x,y) coordinates of a Tile in the runescape world (RSBot->View->player position)
	
	RSTile theBank = new RSTile(3094,3494);
	RSTile theBank2 = new RSTile(3096,3497); // Edgeville. 3 Tiles inside the bank 
	RSTile theBank3 = new RSTile(3093,3492);
	
	RSTile well = new RSTile(3085,3500);
	RSTile well2 = new RSTile(3084,3499); // 3 Tiles around the Well in Edgeville
	RSTile well3 = new RSTile(3083,3502);
	
	RSTile step1 = new RSTile(3074,3504);
	RSTile step2 = new RSTile(3088,3513);
	RSTile step3 = new RSTile(3075,3494); // 6 Tiles spread out in Edgeville in case the player will walk outside the
	RSTile step4 = new RSTile(3088,3481); // bank and well tiles range. (Anti-Fail Tiles)
	RSTile step5 = new RSTile(3107,3499);
	RSTile step6 = new RSTile(3104,3509);
	
	RSTile theBankV = new RSTile(3252,3420); //  Varrock. 2 Tiles inside the east-bank
	RSTile theBankV2 = new RSTile(3254,3420);
	
	RSTile fountain = new RSTile(3239,3434);
	RSTile fountainV = new RSTile(3240, 3434);
	RSTile fountainV2 = new RSTile(3238, 3433); // Varrock. 3 Tiles around the Fountain
	RSTile fountainV3 = new RSTile(3240, 3433);
	
	RSTile stepV = new RSTile(3247,3430); // Varrock. Tile between Fountain and Bank
	
 // long contains numbers but is different than int. //  int startTime = System.currentTimeMillis(); doesn't work	
	long startTime;                                  // long startTime = System.currentTimeMillis(); does work
	long logTime;
	
 // int contains numbers	
	int clay = 434;
	int softClay = 1761; // Item ID's and Object ID's 
	int wellId = 26945;
	int FountainId = 24214;
	
 // boolean can only be true or false
	int softClayCheck; // (Anti-fail) explained in loop(){
	int antiBanCheck = 0; // Explained in loop(){
	int Random = 0; //  Contains a Random number explained in: walkToWell(){
	boolean log = false; // checks if log is on or off. When script starts it will be off.
	int updateTime; // this integer contains the every ?? minutes update time. 0 = 5min, 1 = 15min, 2 = 30min, 3 = 60min
	private boolean logVisible = true;
	boolean logTimerStart; // true = starts timer (5,15,30 or 60min) false = off. Explained in logTimer(){
	int Clay; // int that counts the clay that has been done. Explained in messageReceived(MessageEvent e) {
	int left = 0; // int that contains the total clay you still have left (bank+inventory). Explained in loop(){ and messageReceived(MessageEvent e) {
 // String contains letters
	String NAME; // gets the players account name. Used in loop(){
	Point p;Point p2;
	boolean lastRun = false; // checks if this is your last run
	boolean warning = false; // warning = true when you have 200 clays left. Used in loop(){
	boolean wellClick = false; // wellClick check. Explained in clickToWell(){
	boolean town; // Checks if you are in Edgeville or in Varrock
	
	public boolean onStart() {
		startTime = System.currentTimeMillis(); // System.currentTimeMillis() generates the amount of milliseconds that have past 
		log("Current version: 1.1"); // since many years ago till now. So for Example: long A = System.currentTimeMillis();
         																		    // sleep(5000);	(5000 ms = 5s)
		return true; // boolean onStart = true                                         long B = System.currentTimeMillis();
    }                                                                               // (B-A)/1000 = 5
	// loop() is the part of the scripts that keeps repeating itself. 
	public int loop(){
		
		if(log == true){ // if logUpdate is switched on in the paint:
			logUpdate(); // start logUpdate(){
			logTimer();  // start logTimer(){
		}
			NAME = getMyPlayer().getName(); // getMyPlayer() means look at my player .getName() means give me the name of my player
		if(walking.getEnergy()>35){
			walking.setRun(true);
		}
	 // if (the distance between theBank tile and player position is smaller then or the same as 8 AND it is not your last run) OR
	 // (distance between theBankV tile is smaller then or the same as 8 AND it is not your last run)
		if(calc.distanceTo(theBank)<=8 && lastRun == false || calc.distanceTo(theBankV)<=8 && lastRun == false){ // <- Bracket opens what happens inside the bank
		 // if you are at theBank
			if(calc.distanceTo(theBank)<=8){
				town = false; // false = Edgeville
			}if(calc.distanceTo(theBankV)<=8){
				town = true; // true = Varrock
		  // if your inventory equals 28 clay's:	
			}if(inventory.getCount(clay) == 28){
			 // if you are in Edeville:	
				if(town = false){
				walkToWell();
			  // if you are in Varrock:	
				}if(town = true && walking.getEnergy()< 20){
					walking.rest(35);
					walkToWellV();
				}if(town = true && walking.getEnergy()> 20){
					walkToWellV();
				}
			}// if your inventory does not have 28 clay's:
				if(inventory.getCount(clay) != 28){
				bank.open(); // Open the bank
				
			}
					if(bank.isOpen()){
					 // int left will count the clays you have in your bank
						left = bank.getCount(clay);
					 // if your bank has no clays:	
						if(bank.getCount(clay) == 0){
						log(NAME+ " Ran out of clay!");
						stopScript(false);
						}	
					 // if your inventory is not empty and this is not your last run:
						if(inventory.getCount()>0 && lastRun == false){
							bank.depositAll();
						} 
					 // if your bank has more then 28 clays:	
						if(bank.getCount(clay)>28){
							bank.withdraw(clay, 28); // withdraw 28 clay's
						}
					}
  } // <- this bracket is the end of all that happens inside the bank
	 // if your bank is open AND you have less then 28 clays in your bank:
		if(bank.isOpen() && left<28){
		bank.withdraw(clay, 28); // withdraw all clay that is left
		lastRun = true; // this will be your last run. lastRun = true disables normal actions. So it doesn't keep running even when
		sleep(500);     // you ran out of clay
	 // After you withdraw log will warn the player that this is his last run.	
		if(inventory.getCount(clay)< 28){
			log(NAME+": Last run to well!");
		}
		bank.close();
	}

		//Anti-Fail if the player would walk outside theBank and Well range:
		if(calc.distanceTo(step1)<=6 || calc.distanceTo(step2)<=6 || calc.distanceTo(step3)<=6 || calc.distanceTo(step4)<=8 || calc.distanceTo(step5)<=8 || calc.distanceTo(step6)<=8){
			  // if you still have clay to soften:	
			     if(inventory.getCount(softClay)<28){
					walkToWell(); 
			 // if you are done softening:		
				}if(inventory.getCount(softClay)==28){
					walkToWell();
					walkToBank();
				}
			}
	 // if you come near the well (Edgeville) OR the fountain (Varrock) AND this isn't your last run:	
		if(calc.distanceTo(well)<=6 && lastRun == false || calc.distanceTo(fountainV)<=4 && lastRun == false){
		 // if your inventory has 0 softClay AND not 0 clay && you are in Edgeville
			if(inventory.getCount(softClay)==0 && inventory.getCount(clay) !=0 && town == false){
				wellClick = false; // wellClick = false means the player hasn't clicked yet
				clickWell(); // clickWell(){
		 // same as above but in Varrock:		
			}if(inventory.getCount(softClay)==0 && inventory.getCount(clay) !=0 && town == true){
				wellClick = false;
				clickFountain();
			}
		 // if you still have clay in your inventory AND not 28 softClay:	
			if(inventory.getCount(clay) >0 && inventory.getCount(softClay) != 28){
			 // if you are at the Well Edgeville
				if(calc.distanceTo(well)<=4 && town == false){
					softClayCheck = inventory.getCount(softClay); // This will count your inventory soft clay at this moment
					sleep(2000,3000); // then it waits between 2 and 3 seconds
					antiBanCheck++; // int antiBanCheck +1 so every 2-3 seconds it will increase by 1. Repeat
			 // if antiBanCheck is an even number (2,4,6,8,10) AND you have less then 24 softClay:		
				if(antiBanCheck % 2 == 0 && inventory.getCount(softClay)<24){
					antiban(8,-1); // Activate antiban(){
			  // if you still have the same amount of Clay after the 2-3sec sleep as before:	
				}if(inventory.getCount(softClay) == softClayCheck){
				 // So this whole code makes sure you start softening again if inventory.getCount(softClay) hasn't changed
				 // after 2-3 seconds
					wellClick = false;
					clickWell();
				}
			}// Same as above for Varrock
			if(calc.distanceTo(fountainV)<=6 && town == true){
				softClayCheck = inventory.getCount(softClay);
				sleep(2000,3000);
				antiBanCheck++;
				if(antiBanCheck % 2 == 0 && inventory.getCount(softClay)<24){
					antiban(8,-1);
				}if(inventory.getCount(softClay) == softClayCheck){
					//log(NAME+": Anti-Fail, not softening! Resume..");
					wellClick = false;
					clickFountain();
				}
			}
		  // if you are done softening at the Well/Fountain		
			}if(inventory.getCount(softClay) == 28 && town == false){
				walkToBank();
		}if(inventory.getCount(softClay) == 28 && town == true){
				walkToBankV();
		}
	  // if you have 200 clay's left and the warning = false	
		}if(left==200 && warning == false){
			log("Warning: "+NAME+" is running out of Clay! 200 left.");
			warning=true; // warning is set true so it will send the warning 1 time. To prevent a log that keeps spamming.
	  // if this is your last run and the bank is not open and your inventory is not empty:
		}if(lastRun ==true && !bank.isOpen() && inventory.getCount() != 0){
			if(town == false){ // Edgeville
			walkToWell();
			if(calc.distanceTo(well)<=6){
				wellClick = false;
				clickWell();
			}
			if(inventory.getCount(clay)==0){
				walkToBank();
				log(NAME+ " Ran out of clay!");
				
			}if(inventory.getCount(softClay) == softClayCheck){ // same Anti fail
				wellClick = false;
				clickWell();
			}
		}
			if(town == true){
				walkToWellV();
				if(calc.distanceTo(fountainV)<=6){
					wellClick = false;
					clickFountain();
				}
				if(inventory.getCount(clay)==0){
					walkToBankV();
					log(NAME+ " Ran out of clay!");
					
				}if(inventory.getCount(softClay) == softClayCheck){ // same Anti fail
					wellClick = false;
					clickFountain();
				}
			}
	  // if you walk near the tile between Bank and Fountain:		
		}if(calc.distanceTo(stepV) < 4){
			if(inventory.getCount(softClay) == 28){
				walkToBankV();
			}if(inventory.getCount(softClay) != 28){
				walkToWellV();
			}
			camera.setPitch(random(345, 359)); // (in-game arrow up) set camera so it can see the fountain better. (because of the
		}                              // other players around the Fountain)
		return random(500, 800); // Repeat loop(){ every 0,5-0,8 seconds
	}
 // this will only be activated when it says walkToWell in loop(){
    public void walkToWell(){ // Edgeville
    	Random = random(1,6); // generates a number between 1-5
		if(Random == 1 || Random == 2){ // made this so it looks a bit less bot like.
		walking.walkTo(well);
		antiban(8,-1);
		sleep(1000);
		}if(Random == 3 || Random == 4){
		walking.walkTo(well2);
		sleep(1000);
		}if(Random == 5){
		walking.walkTo(well3);
		antiban(8,-1);
		sleep(1000);
		}
    }public void walkToWellV(){ // Same as above except in Varrock
    	Random = random(1,6);
		if(Random == 1 || Random == 2){
		walking.walkTo(fountainV);
		antiban(8,-1);
		sleep(1000);
		}if(Random == 3 || Random == 4){
		walking.walkTo(stepV);
		sleep(800);
		walking.walkTo(fountainV2);
		sleep(1000);
		}if(Random == 5){
		antiban(8,-1);
		sleep(1000);
		}
    }
    public void walkToBank(){ // speaks for itself
    	Random = random(1,6);
		if(Random == 1 || Random == 2){
		walking.walkTo(theBank);
		antiban(8,-1);
		sleep(1000);
		}if(Random == 3 || Random == 4){
		walking.walkTo(theBank2);
		sleep(1000);
		}if(Random == 5){
		walking.walkTo(theBank3);
		antiban(8,-1);
		sleep(1000);
		}
    }
    public void walkToBankV(){ // speaks for itself
    	Random = random(1,5);
		if(Random == 1 || Random == 2){
			walking.walkTo(theBankV);
			antiban(8,-1);
			sleep(1000);
		}if(Random == 3 || Random == 4){
			walking.walkTo(stepV);
			sleep(800);
			walking.walkTo(theBankV2);
			sleep(1000);
		}
    }
    public void clickWell(){ //  Edgeville
    	RSObject wellObject = objects.getNearest(wellId); // gets nearest Fountain ID and calls it wellObject
    	RSComponent makeAll = interfaces.getComponent(905, 14); // searches for the make-all button after using clay on the Well
    	RSItem clayItem = inventory.getItem(clay); // searches for clay ID in your inventory and calls it clayItem
     // if you haven't clicked all ready:
    	if(wellClick == false){
    		inventory.useItem(clayItem, wellObject); // use clay on well
    		sleep(800);  
    		wellClick = true; // you have clicked. Made this boolean so you click once and not all the time
    	}
    		sleep(800); // wait 0,8 sec
    		makeAll.doClick(); // clicks on the Make all button
    		sleep(500);
    		makeAll.doClick();
    		sleep(1500);
    	
    }

    public void clickFountain(){ // same as above but in Varrock
    	
    	RSObject fountainObject = objects.getNearest(FountainId); 
    	RSItem clayItem = inventory.getItem(clay); 
    	
    	if(wellClick == false){
    		clayItem.doClick(true);
    		fountainObject.doClick(false);
    		sleep(300);
    		fountainObject.doAction("Use Clay -> Fountain");
    		sleep(800);  
    		wellClick =true;
    	}if(calc.distanceTo(fountain) < 3 && wellClick == true){
			RSComponent makeAll = interfaces.getComponent(905, 14); 
			makeAll.doClick();
    		sleep(1500);
    	}      
    	
    }
    
	@Override
	public void onFinish() {
		log("Thanks for using RNClaySoftener!");
		log("Check out http://www.powerbot.org/vb/showthread.php?t=680713&highlight= ");
		log("for updates!");
		
	}
	
	private Image getImage(String url) { // This is for importing the images I used in my Paint
        try {
            return ImageIO.read(new URL(url));
        } catch(IOException e) {
            return null;
        }
    }

    private final Image img2 = getImage("http://img846.imageshack.us/img846/7892/hideshow.jpg");
    private final Image img1 = getImage("http://img826.imageshack.us/img826/1563/paintlogon.jpg");
    private final Image img3 = getImage("http://img638.imageshack.us/img638/5632/paintlogoff.jpg"); 
    private final Image img4 = getImage("http://img84.imageshack.us/img84/7673/cursorw.png");
    private final Color color1 = new Color(71, 71, 71); // grey
    private final Font font1 = new Font("SansSerif", 0, 12);
    private final Font font2 = new Font("SansSerif", 0, 14);
    private final Color color2 = new Color(0, 0, 0); // black
    private final Color color3 = new Color(0, 255, 0); // green
    private final Color color4 = new Color(255, 0, 0); // red
    private final Color color5 = new Color(255, 255, 255); // white
    private final BasicStroke stroke1 = new BasicStroke(1);
    private final Color color6 = new Color(0, 0, 0, 128); // transparent 

	    private boolean fullPaint = false;
	 // Creates the paint I made
	    public void onRepaint(Graphics g1) {
	    	long millis = System.currentTimeMillis() - startTime;
	    	long clayHour = Clay * 3600 / (millis / 1000);
	        Graphics2D g = (Graphics2D)g1;
	        g.drawImage(img2, 441, 310, null);
	        g.setFont(font1);
	        g.setColor(color1);
	        Point point = mouse.getLocation();
	        int mousex = point.x;
	        int mousey = point.y;
	        g.drawImage(img4, mousex-25, mousey-25, null);
	     // if the paint isn't hidden and the log is [on]  
	        if (fullPaint && log == true) {
	        	g.drawImage(img1, 6, 346, null);
	        	g.drawString("Run Time: " + runTime(), 21, 395);
	        	g.drawString("Clay done: " + Clay, 21, 415);
	        	g.drawString("Clay/hour: " + clayHour, 21, 435);
	        	g.drawString("Clay left: " + left, 21, 455);
	        }	
	        if(fullPaint && log == true && logVisible == true){  
	            g.setColor(color6);
		        g.fillRect(6, 27, 63, 25);
		        g.setColor(color5);
		        g.setFont(font2);
		        g.drawString(" Log ", 20, 45);
		        g.setColor(color2);
		        g.fillRect(6, 52, 62, 125);
		        g.setStroke(stroke1);
	           	g.drawRect(6, 52, 62, 125);
	           	g.setColor(color1);
	           	g.drawString("Update", 12, 68);
	            g.drawString("every: ", 12, 88);
	        
	        }if(fullPaint && log == true && logVisible == false){
	        	g.setColor(color6);
	        	g.fillRect(6, 27, 63, 25);
	        	g.setColor(color5);
	        	g.setFont(font2);
	        	g.drawString(" Log ", 20, 45);

	        } if(fullPaint && updateTime == 0 && log == true && logVisible == true){
		    	g.setFont(font1);
		    	g.setColor(color3);
	            g.drawString(" [5] min ", 12, 108);
	            g.setColor(color4);
	            g.drawString("[15] min ", 12, 128);
	            g.drawString("[30] min ", 12, 148);
	            g.drawString("[60] min ", 12, 168);
		    	}if(fullPaint && updateTime == 1 && log == true && logVisible == true){
			    	g.setFont(font1);
			    	g.setColor(color4);
		            g.drawString(" [5] min ", 12, 108);
		            g.setColor(color3);
		            g.drawString("[15] min ", 12, 128);
		            g.setColor(color4);
		            g.drawString("[30] min ", 12, 148);
		            g.drawString("[60] min ", 12, 168);
			    	}if(fullPaint && updateTime == 2 && log == true && logVisible == true){
			    		g.setFont(font1);
				    	g.setColor(color4);
			            g.drawString(" [5] min ", 12, 108);  
			            g.drawString("[15] min ", 12, 128);
			            g.setColor(color3);
			            g.drawString("[30] min ", 12, 148);
			            g.setColor(color4);
			            g.drawString("[60] min ", 12, 168);
			    	}if(fullPaint && updateTime == 3 && log == true && logVisible == true){
			    		g.setFont(font1);
				    	g.setColor(color4);
			            g.drawString(" [5] min ", 12, 108);  
			            g.drawString("[15] min ", 12, 128);
			            g.drawString("[30] min ", 12, 148);
			            g.setColor(color3);
			            g.drawString("[60] min ", 12, 168);
			    	}	
	        if (fullPaint && log == false) {
	        	g.drawImage(img3, 6, 346, null);
	        	g.drawString("Run Time: " + runTime(), 21, 395);
	        	g.drawString("Clay done: " + Clay, 21, 415);
	        	g.drawString("Clay/hour: " + clayHour, 21, 435);
	        	g.drawString("Clay left: " + left, 21, 455);
			}
	        if(!fullPaint){
				g.drawImage(img2, 441, 310, null);
			}        
	    }  
	    
	    public void logUpdate(){
	     // if the logTimer is allready started:
	    	if(logTimerStart == false){
	    		logTimer(); 
	    	}
	     // if updateTime = every 5 min and log is turned on and the logTimerStart hasn't started:	
	    	if(updateTime == 0 && log == true && logTimerStart == true){
	    		logTime = System.currentTimeMillis()/1000; // logTime = milliseconds on the moment logUpdate is switched on
	    		logTimerStart = false;  // logTime picked so it doesn't repeat
	    	}if(updateTime == 1 && log == true && logTimerStart == true){
	    		logTime = System.currentTimeMillis()/1000;
			//	log(NAME + " made "+Clay+" soft clay! "+left+" clays to go!("+clayHour+"/hour)");
				logTimerStart = false;
				
	    	}if(updateTime == 2 && log == true && logTimerStart == true){	
	    		logTime = System.currentTimeMillis()/1000;
				//log(NAME + " made "+Clay+" soft clay! "+left+" clays to go!("+clayHour+"/hour)");
				logTimerStart = false;
				
	    	}if(updateTime == 3 && log == true && logTimerStart == true){
	    		
	    		logTime = System.currentTimeMillis()/1000;
			//	log(NAME + " made "+Clay+" soft clay! "+left+" clays to go!("+clayHour+"/hour)");
				logTimerStart = false;
	    	}
	    }
	    public void logTimer(){
	    	long millis = System.currentTimeMillis() - startTime; // exact moment - time we started script
	    	long clayHour = Clay * 3600 / (millis / 1000); 
	    	long TIME = System.currentTimeMillis()/1000; // exact moment
	     // if log updates every 5 min and log is switched on and the timer all ready started:	
	    	if(updateTime == 0 && log == true && logTimerStart == false){
	    	 // if exact moment - time we switched on the log gets bigger then 300sec (5 min) && log is switched on: 	
	    		if((TIME - logTime) >=300 && log == true){

					log(NAME + " made "+Clay+" soft clay! "+left+" clays to go! ("+clayHour+"/hour)");
					logTimerStart = true; // reset logTime, so it will active this part again after 5 min
					
					}
	      // Same as above except this is 15min		
	    	}if(updateTime == 1 && log == true && logTimerStart == false){
	    		if((TIME - logTime) >=900 && log == true){

	
					log(NAME + " made "+Clay+" soft clay! "+left+" clays to go! ("+clayHour+"/hour)");
					logTimerStart = true;
					
					}
	    	  // 30min
	    		}if(updateTime == 2 && log == true && logTimerStart == false){
		    		if((TIME - logTime) >=1800 && log == true){


						log(NAME + " made "+Clay+" soft clay! "+left+" clays to go! ("+clayHour+"/hour)");
						logTimerStart = true;;
					
						}
		     // 60min		
	    		}if(updateTime == 3 && log == true && logTimerStart == false){
		    		if((TIME - logTime) >=3600 && log == true){

		    	
						log(NAME + " made "+Clay+" soft clay! "+left+" clays to go! ("+clayHour+"/hour)");
						logTimerStart = true;;
					
						}
	    		}
	    }
	    
	    public String runTime(){ // this creates the number Run Time in the paint
	    		try { // try means he keeps trying all the time. This way you can get a clock
	    			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;
	    			return ("" + (hours < 10 ? "0" : "") + hours + ":"
	    					+ (minutes < 10 ? "0" : "") + minutes + ":"
	    					+ (seconds < 10 ? "0" : "") + seconds + "");
	    		} catch (Exception e) {
	    			return "";
	    		}
	    	}
	  
	    public void messageReceived(MessageEvent e) { // checks chatlog in-game
			final String m = e.getMessage(); // m = every new line in the ingame chat
			if (m.contains("You mix the clay and water. You now have some soft, workable clay.")) {
				Clay++; // Add 1 to the int Clay. (Clays Done in paint)
				
					left = left -1; // clays left -1
			 // after deposit fail	
			}	if (m.contains("You have no items in your backpack.")){
				sleep(500);
				bank.withdraw(clay, 28);
			}
	    }       
	 // This part runs when you disable the input in RSBot
	    public void mouseClicked(MouseEvent e) {
			p2 = e.getPoint(); // Mouse coordinates (x,y)
		 // if you click and Mouse coordinate x is between 441 and 515 AND y is between 310 and 338:	
			if (p2.x >= 441 && p2.x <= 515 && p2.y >= 310 && p2.y <= 338) { // Hide/show button in paint
			 // if paint is shown	
				if (fullPaint) {
					fullPaint = false; // hide paint
					// if paint is hidden
				} else if (!fullPaint) {
					fullPaint = true; // show paint
				}
			}if (p2.x >= 254 && p2.x <= 283 && p2.y >= 440 && p2.y <= 453) {
				if (fullPaint == true && log == false) {
					log = true;
					logTimerStart = true;
					updateTime = 0;
					log(NAME+": Update log = on. Default every 5 minutes");
				}
			}if (p2.x >= 285 && p2.x <= 313 && p2.y >= 440 && p2.y <= 453) {
				if (fullPaint ==true && log == true) {
					log = false;
					log(NAME+": Update log = off.");
				}
			}
			if (p2.x >= 10 && p2.x <= 60 && p2.y >= 94 && p2.y <= 112 && updateTime!=0) {
					if(log = true){
					updateTime = 0;
						log(NAME+": Log will update every 5 minutes.");
					}else{
						
					}
			}if (p2.x >= 10 && p2.x <= 60 && p2.y >= 115 && p2.y <= 132 && updateTime!=1) {
					if(log = true){
						updateTime = 1;
						log(NAME+": Log will update every 15 minutes.");
					}else{
						
					}
				}if (p2.x >= 10 && p2.x <= 60 && p2.y >= 134 && p2.y <= 152 && updateTime!=2) {
					if(log = true){
						updateTime = 2;
						log(NAME+": Log will update every 30 minutes.");
					}else{
						
					}
				}if (p2.x >= 10 && p2.x <= 60 && p2.y >= 154 && p2.y <= 172 && updateTime!=3) {
					if(log = true){
						updateTime = 3;
						log(NAME+": Log will update every 60 minutes.");
					}else{
						
					}
				}if (p2.x >= 6 && p2.x <= 80 && p2.y >= 27 && p2.y <= 51) {
					int check = 0;
					if(log == true && logVisible == true && check == 0){
						check++;
						logVisible = false;
									
					}if(log == true && logVisible == false && check == 0){
						check++;
						logVisible = true;
					}
				}
	    }
	    
			public void mouseEntered(MouseEvent e) {
			}

			public void mouseExited(MouseEvent e) {
			}

			public void mousePressed(MouseEvent e) {
			}

			public void mouseReleased(MouseEvent e) {
				
			}
			
			public void moveCamera(){
		    	
		    	 if (tempint == 0) {
	                 camera.setAngle(random(0, 359)); // (in-game arrow left <- or arrow right -> in degrees) 
	             } else if (tempint == 1) {
	                 camera.setPitch(random(0, 150)); // (in-game arrow up and arrow down in degrees)
	             } else if (tempint == 2) {
	                 camera.setAngle(random(0, 359));
	                 camera.setPitch(random(100, 150));
	             } else {
	                 camera.setPitch(random(0, 100));
	                 camera.setAngle(random(0, 359));
	             }
		    	
		    } 
			
			public void antiban(int ranmod, int num) {
			// generates a random number and depending on that number it will use a random antiban thingy.
		        if (num == -1) {
		            if ((ranmod > 15 || ranmod < 1)) {
		                wh = -2;
		            } else {
		                wh = r.nextInt(ranmod);
		            }
		        } else if (num < 0 || num > 15) {

		            wh = -2;
		        } else {
		            wh = num;
		        }
		        if (wh == -2) {
		        } else {
		            switch (wh) {
		                case 0:
		                    tempint = r.nextInt(4);
		                    moveCamera();
		                    break;
		                case 1:
		                    sleep(0, 15);
		                    tempint = r.nextInt(3);
		                    if (tempint == 0) {
		                        mouse.moveOffScreen();
		                    } else {
		                        mouse.moveRandomly(mousemove);
		                    }
		                    break;
		                case 2:              
		                    mouse.setSpeed(random(mmin, mmax));
		                    break;
		                case 3:
		                    tempint = r.nextInt(4);
		                    moveCamera();
		                    break;
		                case 4:
		                    sleep(0, 15);
		                    tempint = r.nextInt(2);
		                    if (tempint == 0) {
		                    	mouse.moveOffScreen();
		                    } else {
		                        mouse.moveRandomly(mousemove);
		                    }
		                    break;
		                case 5:
		                	 sleep(0, 15);
			                    tempint = r.nextInt(3);
			                    if (tempint == 0) {
			                        mouse.moveOffScreen();
			                    } else {
			                        mouse.moveRandomly(mousemove);
			                    }break;           
		                case 6:
		                    mouse.click(random(531, 553), random(12, 38), true);
		                    sleep(400, 900);
		                    mouse.moveRandomly(mousemove);
		                    break;
		                case 7:
		                    tempint = r.nextInt(4);
		                   moveCamera();
		                	            }
		        }
		    }

	    

}