Might code a script...

Maxie

Onyx user!
Reputation
0
I might code a script for RSBuddy as I want to learn Java. I think this way would be pretty easy as everything is already described in the Development Doc. (http://rsbuddy.com/doc/)

Any suggestions on an easy script I can start with?
 
A single place, no GUI, no paint miner/fisher.

The best one to start with unless you already have java/other programming language knowledge.

Code:
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.wrappers.RSObject;

@ScriptManifest(
		authors = {"Automatic Coding"},
		version = 0.01,
		keywords = {""},
		description = "Granite miner",
		name = "Granite miner"
)

public class AutoGranite extends Script {

	int oreID = 10947;
	int miningAnimation = 624;
	
	public boolean onStart() {
		return true;
	}
	
	
	@Override
	public int loop() {
		antiBan();
		if(inventory.containsOneOf(1825, 1823, 1827, 1829)) {
		if(inventory.isFull()){
			inventory.dropAllExcept(1823, 1825, 1827, 1829);
		} else {
		mineOres();
		}
		
		} else {
			stopScript(true);
		}
		return random(300,500);
	}

	public void onFinish() {
		log("Thank you for using my script!");
	}
	
	private void mineOres() {
		
		if(getMyPlayer().getAnimation() != miningAnimation){
		RSObject rock = objects.getNearest(oreID);
		rock.doAction("Mine");
		sleep(1000,1800);
		}
	}
	
	
	private void antiBan() {
		
		int r = random (0,100);
		
		switch(r) {
		
			case 3:
				mouse.moveSlightly();
				sleep(200,800);
				break;
				
			case 74:
				mouse.moveOffScreen();
				sleep (1000,3000);
				break;
				
			case 54:
				camera.moveRandomly(random(750,1250));
				break;
		}	
	}
}

That was my first ever script, it's for powerbot though.
 
Back
Top