http://www.runescape-autobot.com
Free Runescape Bot!
Free Runescape Bot!
//Version 1.0 Release
//Version 1.1 Fixed bugs, added deathwalk, and spiffied antiBan.
import java.awt.*;
import java.awt.event.KeyEvent;
import java.util.Map;
import com.speljohan.rsbot.bot.Bot;
import com.speljohan.rsbot.event.events.ServerMessageEvent;
import com.speljohan.rsbot.event.listeners.PaintListener;
import com.speljohan.rsbot.event.listeners.ServerMessageListener;
import com.speljohan.rsbot.script.*;
import com.speljohan.rsbot.script.wrappers.*;
public class DraynorWillowCut extends Script implements ServerMessageListener,PaintListener{
public double getVersion( ) {
return( 1.00 );
}
public String getName( ) {
return( "DraynorWillowCut" );
}
public String getAuthor( ) {
return( "Megaalgos" );
}
public String getScriptCategory() {
return( "Woodcutting" );
}
public String getScriptDescription( ) {
String html = "";
html += "<html>\n";
html += "<head>";
html += "<style type=\"text/css\"> hr {color: white} p {margin-left: 21px} body {background-image: url(\"http://i263.photobucket.com/albums/ii140/megaalgos/willow.jpg\")}</style>";
html += "<body>\n";
html += "<h2>" + getName( ) + " v" + getVersion( ) + "</h2><br>\n";
html += "Author: " + getAuthor( ) + "<br><br>\n";
html += "Just start by the willows with an axe.";
html += "Any questions add my msn- [email protected]";
html += "</center>\n";
html += "</body>\n";
html += "</html\n";
return( html );
}
//Varibles
int startwcxp=0;
int curwcxp=0;
int wcxpgained=0;
int capital;
long startTime = 0;
public int logs = 0;
RSNPC ent;
int[] Axes = {1351,1349,1353,1355,1361,1357,1359,6739};
int ENT = 0;
int x = random(0, 750);
int y = random(0, 500);
int xx = random(710,554);
int yy = random(444,230);
int screenx = random(1,510);
int screeny = random(1,450);
int[] trees = {5553, 5551, 5552};
int bankBooth = 2213;
RSTile[] bankWalk1 = new RSTile[] {
new RSTile(3087,3233),new RSTile(3086,3241), new RSTile(3093,3242)};
RSTilePath bankWalk = new RSTilePath(bankWalk1,this);
RSTile[] deathWalk = new RSTile[] {
new RSTile(3233,3222),new RSTile(3228,3234),new RSTile(3219,3246),
new RSTile(3203,3246),new RSTile(3187,3245),new RSTile(3173,3240),
new RSTile(3158,3234),new RSTile(3143,3229),new RSTile(3126,3225),
new RSTile(3112,3222),new RSTile(3099,3227),new RSTile(3088,3233)
};
RSTilePath DEATHWALK = new RSTilePath(deathWalk,this);
//End
//Methods
public void turnCamera() {
char[] LR = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_UP };
char[] UD = new char[] { KeyEvent.VK_UP, KeyEvent.VK_LEFT };
char[] LRUD = new char[] { KeyEvent.VK_LEFT,KeyEvent.VK_RIGHT,
KeyEvent.VK_UP, KeyEvent.VK_LEFT};
int random2 = random(0,2);
int random1 = random(0,2);
int random4 = random(0,4);
if(random(0,3) == 0) {
Bot.getInputManager().pressKey(LR[random1]);
try { Thread.sleep(random(100, 400)); } catch (Exception e) {}
Bot.getInputManager().pressKey(UD[random2]);
try { Thread.sleep(random(300, 600)); } catch (Exception e) {}
Bot.getInputManager().releaseKey(UD[random2]);
try { Thread.sleep(random(100, 400)); } catch (Exception e) {}
Bot.getInputManager().releaseKey(LR[random1]);
} else {
Bot.getInputManager().pressKey(LRUD[random4]);
if(random4>1) {
try { Thread.sleep(random(300, 600)); } catch (Exception e) {}
} else {
try { Thread.sleep(random(500, 900)); } catch (Exception e) {}
}
Bot.getInputManager().releaseKey(LRUD[random4]);
}
}
public boolean attackedByEnt() {
ent = null;
ent = getNearestNPCByName("Willow");
if(ent == null || getMyPlayer().getInteracting() == null) {
return false;
}
return getMyPlayer().getInteracting().equals(ent);
}
public void checkEnt() {
ent = null;
ent = getNearestNPCByName("Willow");
if(getMyPlayer().getInteracting().equals(ent)){
atTile(getMyPlayer().getLocation(), "walk here");
}
}
public int randomTab(){
int random1 = random(1,23);
switch(random1){
case 1:
openTab(TAB_STATS);
return random(100,500);
case 2:
openTab(TAB_ATTACK);
return random(100,500);
case 3:
openTab(TAB_QUESTS);
return random(100,500);
case 4:
openTab(TAB_EQUIPMENT);
return random(100,500);
case 5:
openTab(TAB_INVENTORY);
return random(100,500);
case 6:
openTab(TAB_PRAYER);
return random(100,500);
case 7:
openTab(TAB_MAGIC);
return random(100,500);
case 8:
openTab(TAB_SUMMONING);
return random(100,500);
case 9:
openTab(TAB_FRIENDS);
return random(100,500);
case 10:
openTab(TAB_IGNORE);
return random(100,500);
case 11:
openTab(TAB_CLAN);
return random(100,500);
case 12:
openTab(TAB_CONTROLS);
return random(100,500);
case 13:
openTab(TAB_MUSIC);
return random(100,500);
case 14:
openTab(TAB_LOGOUT);
return random(100,500);
}
return random(100,300);
}
public int antiBan() {
int gamble = random(1, 15);
switch (gamble) {
case 1:
wait(random(1000,2500));
return random(500, 750);
case 2:
moveMouse(x,y);
wait(random(1000,2500));
return random(500, 750);
case 3:
openTab(TAB_INVENTORY);
wait(random(1000,2500));
return random(690, 400);
case 4:
if (getMyPlayer().isMoving()) {
wait(random(1000,2500));
return random(750, 1000);
}
case 5:
moveMouse(x,y);
int checkTime = 0;
long lastCheck = 0;
wait(random(1000,2500));
if (System.currentTimeMillis() - lastCheck >= checkTime) {
lastCheck = System.currentTimeMillis();
checkTime = random(60000, 180000);
return random(500, 800);
}
case 6:
if (getCurrentTab() != TAB_STATS) {
openTab(TAB_STATS);
moveMouse (xx,yy);
wait(random(2000,3500));
return random(500, 800);
}
case 7:
if (random(1, 8) == 2) {
int angle = getCameraAngle() + random(1, 90);
if (angle < 0) {
angle = 0;
}
if (angle > 359) {
angle = 0;
}
setCameraRotation(angle);
}
wait(random(1000,2500));
return random(500, 750);
case 8:
moveMouse(screenx,screeny);
wait(random(3000,7000));
return random(100,320);
case 9:
moveMouse(screenx,screeny);
wait(random(3000,7000));
return random(100,320);
case 10:
randomTab();
wait(random(1000,2000));
return random(120,250);
}
return random(500, 750);
}
public boolean walkToBank(){
try{
bankWalk.walkToEnd();
}catch(Exception e){
e.printStackTrace();
}
return false;
}
public int deposit(){
try{
if(isInventoryFull()){
wait(random(500,1000));
RSObject bankbooth = findObject(bankBooth);
if(bankbooth != null){
atObject(bankbooth,"Use-quickly");
if (bank.getInterface().isValid()) {
bank.depositAllExcept(Axes);
}
wait(random(700,1100));
bank.close();
}
}
}catch(Exception e){
e.printStackTrace();
}
return random(100,300);
}
//From DraynorMaxChopper
public boolean rectangle(int x1, int x2, int y1, int y2)
{
int posX = getMyPlayer().getLocation().getX();
int posY = getMyPlayer().getLocation().getY();
if(posX>=x1 && posX<=x2 && posY>=y1 && posY<=y2 )
{
return true;
}
else
{
return false;
}
}
public boolean atLumby()
{
if(rectangle(3217,3225,3213,3224))
{
return true;
}
else
{
return false;
}
}
public boolean inBank()
{
if(rectangle(3087,3098,3240,3246))
{
return true;
}
else
{
return false;
}
}
public int chopTree(RSObject tree) {
int X, Y;
X = (int) Calculations.tileToScreen(tree.getLocation()).getX();
Y = (int) Calculations.tileToScreen(tree.getLocation()).getY();
X += random(4, 10);
Y -= random(3, 9);
Point newtree = new Point(X, Y);
moveMouse(newtree);
clickMouse(true);
return random(200,500);
}
//End
public boolean onStart(Map<String, String> args) {
Bot.getEventManager().addListener(PaintListener.class, this);
Bot.getEventManager().addListener(ServerMessageListener.class, this);
startTime = System.currentTimeMillis();
return( true );
}
public void onRepaint(Graphics g) {
long runTime = System.currentTimeMillis() - startTime;
long TotalSecs = runTime / 1000;
long TotalMins = TotalSecs / 60;
long TotalHours = TotalMins / 60;
int seconds = (int) TotalSecs % 60;
int minutes = (int) TotalMins % 60;
int hours = (int) TotalHours % 60;
StringBuilder b = new StringBuilder();
if (hours < 10) b.append('0');
b.append(hours);
b.append(':');
if (minutes < 10) b.append('0');
b.append(minutes);
b.append(':');
if (seconds < 10) b.append('0');
b.append(seconds);
if(isLoggedIn()){
int x = 30;
int y = 200;
g.setColor(Color.GREEN);
g.drawString("Ran for: " + b.toString(), x, y += 25);
g.drawString("Cut: " + logs/2 + " logs", x, y += 20);
g.drawString("Found and advoided: " + ENT + " ents.", x, y +=20);
}
}
public void onFinish( ) {
long runTime = System.currentTimeMillis() - startTime;
long TotalSecs = runTime / 1000;
long TotalMins = TotalSecs / 60;
long TotalHours = TotalMins / 60;
int seconds = (int) TotalSecs % 60;
int minutes = (int) TotalMins % 60;
int hours = (int) TotalHours % 60;
StringBuilder b = new StringBuilder();
if (hours < 10) b.append('0');
b.append(hours);
b.append(':');
if (minutes < 10) b.append('0');
b.append(minutes);
b.append(':');
if (seconds < 10) b.append('0');
b.append(seconds);
log("Found and detected: " + ENT + "ents");
log("Cut: " + logs/2 + " logs");
log("Ran for: " + b.toString());
Bot.getEventManager( ).removeListener(ServerMessageListener.class, this);
Bot.getEventManager( ).removeListener(PaintListener.class, this);
}
public int loop( ) {
RSObject tree = findObject(trees);
try{
switch(capital){
case 0:
setRun(true);
if(inBank()){
log("In bank going to trees.");
bankWalk.walkToStart();
}
if(atLumby()){
setRun(false);
DEATHWALK.walkToEnd();
return 1;
}
if(attackedByEnt()) {
ENT++;
log("Ent found");
checkEnt();
return random(100,200);
}
if(getMyPlayer().isInCombat()){
return capital = 2;
}
if(getMyPlayer().getAnimation() != -1){
return antiBan();
}
if(isInventoryFull()){
return capital++;
}
if(getMyPlayer().isMoving()){
return random(100,200);
}
if(tree == null){
bankWalk.walkToStart();
}
if(tree != null){
chopTree(tree);
wait(random(200,800));
turnCamera();
}
break;
case 1:
if(isInventoryFull()){
setRun(false);
walkToBank();
wait(random(3000,5000));
}
if(isInventoryFull()){
deposit();
setRun(true);
capital = 0;
return random(100,250);
}
break;
case 2:
if(getMyPlayer().isInCombat()){
walkToBank();
wait(random(3000,5000));
antiBan();
return capital = 0;
}
break;
}
}catch(Exception e){
e.printStackTrace();
}
return( random(500, 1000) );
}
public void serverMessageRecieved(ServerMessageEvent arg0)
{
String serverString = arg0.getMessage();
if (serverString.equals("You get some willow logs."))
{
logs++;
}














