• Welcome to ForumKorner!
    Join today and become a part of the community.

All of my scripts [Will be updated]

x04a

Onyx user!
Reputation
0
I am aware that my Chopper and Miner do not have very good logic. I am working on this.
I'm going to post all the scripts that I make on this thread hopefully, and the source will be public of course. If you leech, please put credits.

x04aMiner.java
v0.5 Features
Mines copper & drops it, very simple.

What I hope to accomplish
Banking
Mining iron
World hop on 3+ players
Perfect walking to iron

Not started = Red, Finished = Green, In progress = Blue

Please do not run this, This script is broken as I am working on it. Use for reference only. I didn't save the 0.5 as a separate script. Oops.
Code:
import java.awt.Color;
import java.awt.Graphics;
import java.util.Map;
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.RSObject;
import org.rsbot.script.wrappers.RSTile;

@ScriptManifest(authors =  "x04a" , category = "Mining", name = "x04aMiner", version = 0.5, description = "My first simple powerminer")

public class x04aMiner extends Script implements PaintListener {
	//The start boolean,(below), is what happens when you first open the script. I have it set to writing the paths and time.
	public boolean onStart(Map<String, String> args) { 
		startTime = System.currentTimeMillis();
		ToBank = new RSTile[] {new RSTile(3292, 3374), new RSTile(3292, 3384), new RSTile(3291, 3396), new RSTile(3290, 3408), new RSTile(3284, 3423), new RSTile(3269, 3428), new RSTile(3255, 3420)};
		
		return true;
	}
	//End of start boolean
	
	//Integers and declarations
	RSTile[] ToMine;
	RSTile[] ToBank;
	public int startexp;
	public int[] copperID = {11961,11962};
	public int[] pickID = {1275,1265,1267,1269,1271,1273};
	public long startTime = System.currentTimeMillis();
	//End of ints and decs
	
	//This is the start of the walking booleans, when called, it simply does the actions within the boolean.
	public boolean ToBank() { 
		walking.walkPathMM(ToBank);
		
		return true;
	}
		
	
	//End of walking booleans.
	
	
	//This is the main loop that the script operates off of.
	public int loop() { 
		if(!inventory.isFull()) {
			
		} else if(inventory.isFull()) {
			ToBank();
		}
		return 0;
	}
	//End of main loop
	
	
	/* This is the start of any kind of boolean that does an action, except for walking. 
	 * If you do not understand what any of the script means, send me a PM and I'll explain it to you.
	 */
	public boolean mine() {
		if (getMyPlayer().getAnimation() == -1) {
			final RSObject Ore = objects.getNearest(copperID);
			if (Ore != null) {
				if (calc.distanceTo(Ore) <= 1) {
					Ore.doAction("Mine");
					sleep(random(1250, 1500));
				} else {
					
				}
			}
		}
		return true;
	}
	
	//Below is the script for the paint.
	@Override
	public void onRepaint(Graphics g) {
		int xpGained = 0;
		if ( startexp == 0) {
		     startexp = skills.getCurrentExp(Skills.MINING);
		}
		xpGained = skills.getCurrentExp(Skills.MINING) - startexp;
        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;
        long minutes2 = minutes + (hours * 60);
            g.setColor(Color.white);
            g.drawString("Time running: " + hours + ":" + minutes + ":" + seconds  , 390, 250);
            g.drawString("XP Gained: " + xpGained, 390, 280);
	}
}
	//End paint&Script

x04aChopper
v0.5 Features
Walks to yews, cuts them, banks
Broken until I fix it. Will be after banking is implemented into the mining script.
I cannot think of more features to add to it. Lol.
Code:
import java.util.Map;
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.wrappers.RSNPC;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.wrappers.RSTile;

@ScriptManifest(authors =  "x04a" , category = "Woodcutting", name = "x04aChopper", version = 0.5, description = "My first simple chopper, Credits to Zurkei for helping me with that NullPointerException")

public class x04aChopper extends Script {
	
	public long startTime = System.currentTimeMillis();
	public int startexp;
	public int[] trees = {1309};
	public int[] hatchet = {1359, 6739};
	public int[] bankID = {6533, 6535};
	RSTile[] PathToBank;
	RSTile[] BankToPath;
	RSTile[] PathToTrees;
	RSTile[] ToTreeSet1;
	RSTile[] ToTreeSet2;
	
	public boolean onStart(Map<String, String> args) { 
		PathToBank = new RSTile[] { new RSTile(3205, 3502),  new RSTile(3195, 3494), new RSTile(3180, 3489), new RSTile(3167, 3489) };
		PathToTrees = new RSTile[] { new RSTile(3180, 3489), new RSTile(3191, 3490), new RSTile(3198, 3499), new RSTile(3207, 3501) };
		ToTreeSet1 = new RSTile [] { new RSTile(3220, 3502) };
		ToTreeSet2 = new RSTile [] { new RSTile (3207, 3501)};
		return true;
	}
	
    public boolean PathToBank(){
		
        walking.walkPathMM(PathToBank);
        useBank();
        return true;
    }

    public boolean useBank() {
            RSNPC banker = npcs.getNearest(bankID);
            if (banker != null) {
        		banker.doAction("Bank Banker");	
        		}
            if (bank.isOpen())
                ;
            bank.depositAllExcept(hatchet);
            bank.close();
            	toTrees();
            return true;

        }
      public boolean toTrees() {
    	  		 walking.walkPathMM(PathToTrees);
    	  		 chop();
    	  		 return true;
      }

      public boolean walktree() {
    	  walking.walkPathMM(ToTreeSet1);
    	  chop2();
    	  return true;
      }
      public boolean walktree2() {
    	  walking.walkPathMM(ToTreeSet2);
    	  chop();
    	  return true;
      }
      
	public int loop() { 
		if(!inventory.isFull()) {
			toTrees();
		} else if(inventory.isFull()) {
			PathToBank();
		}
		return 0;
		}
	public boolean chop() {
		if (getMyPlayer().getAnimation() == -1) {
			final RSObject Tree = objects.getNearest(trees);
			if (Tree != null) {
				if (calc.distanceTo(Tree) <= 75) {
					Tree.doAction("Chop down");
					sleep(random(1250, 1500));
					
				} else {
					if (getMyPlayer().getAnimation() == -1 && Tree == null)
					walktree();
				
				}
			}
		}
		return true;
	}
			
				public boolean chop2() {
					if (getMyPlayer().getAnimation() == -1) {
						final RSObject Tree = objects.getNearest(trees);
						if (Tree != null) {
							if (calc.distanceTo(Tree) <= 75) {
								Tree.doAction("Chop down");
								sleep(random(1250, 1500));
							} else {
								if (getMyPlayer().getAnimation() == -1 && Tree == null)
								walktree2();
						}
				}
		}
	
	return true;
}	
}


x04aBurner
x0.5 Features
Not being worked on yet! Woohoo!
All I have made is the skeleton and a few walkpaths.
Code:
Not worth sharing atm


x04aFletcher
v1.0 Features
Will get you 1-99 fletching, and all you have to do is buy the logs.
Features:
It gets your level, checks if inventory is full, if yes, gets level and fletches. if no, gets level and withdraws. then deposits.
Code:
Not providing yet.

x04aFisher
v0.5 Features
Will fish shrimp/anchovy at Draynor, and eventually Herring/Trout.
Not started yet
Code:
None


More are to come!
 

FAGeX

Onyx user!
Reputation
0
Nice, my man. It looks wonderful.
 

x04a

Onyx user!
Reputation
0
If you knew anything about scripts, theyre rather bad ^_^

Not to say I'm not improving them, but the miner was piss easy.
 

x04a

Onyx user!
Reputation
0
Shablo5 said:
Can chopper do all? Can it do ivy?

Please read the descriptions. It cuts yews at the GE, and is currently broken. I am going to fix it after I implement banking into the miner.
 

Shablo5

Member
Reputation
0
I read the description. You called it a chopper, not a yew chopper, AND you said you couldn't think of any other features to implement. I assumed you had all possible features rather than being braindead and couldn't think of adding, oh say, another tree. So I just made sure you had the most sought after feature for any chopper. But hey, what do I know.
 

x04a

Onyx user!
Reputation
0
Shablo5 said:
I read the description. You called it a chopper, not a yew chopper, AND you said you couldn't think of any other features to implement. I assumed you had all possible features rather than being braindead and couldn't think of adding, oh say, another tree. So I just made sure you had the most sought after feature for any chopper. But hey, what do I know.

I didn't want to rename it x04aYewChopper, and I specifically said it chops yews. It is designed to chop yews. It does not need any more features. If I decide to make it a universal chopper, I will.
 

Shablo5

Member
Reputation
0
x04a said:
I didn't want to rename it x04aYewChopper, and I specifically said it chops yews. It is designed to chop yews. It does not need any more features. If I decide to make it a universal chopper, I will.

You said "It chops yews" not "it only chops yews". That added with the universal name of CHOPPER can only make one think "hey, it must do more than just chop yews due to the fact it's got the SAME NAME as every other AIO chopper out there, PLUS he didnt classify it to only ONE tree by saying 'only'"

Your wordplay is terrible and then getting angry over your own shortcomings is laughable.
 

x04a

Onyx user!
Reputation
0
Shablo5 said:
You said "It chops yews" not "it only chops yews". That added with the universal name of CHOPPER can only make one think "hey, it must do more than just chop yews due to the fact it's got the SAME NAME as every other AIO chopper out there, PLUS he didnt classify it to only ONE tree by saying 'only'"

Your wordplay is terrible and then getting angry over your own shortcomings is laughable.

It isn't called AIO. If you have a problem with the scripts, you are free to not view the thread. I'm also not angry, but you are becoming an annoyance. I stated what it does, and it does explicitly that.
 

Saged

Onyx user!
Reputation
0
Enough, both of you. You can argue the menial differences via PM.
 

Pink Floyd

Active Member
Reputation
0
Damm, Saged stole the words right out of my fingers.

x04a- looking good.
 

x04a

Onyx user!
Reputation
0
Pink Floyd said:
Damm, Saged stole the words right out of my fingers.

x04a- looking good.

Thanks, and Lol @ "right out of my fingers"
 
Top