rendered paste body/*** Class VezWillows* Version 1.0 BETA* Author: v3n0m96* 22 July 2010* Last tested at : 29 July 2010*/import java.applet.*; import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.util.ArrayList;import java.util.Arrays;import java.util.Map;import org.rsbot.util.*;import org.rsbot.accessors.Model;import org.rsbot.accessors.Node;import org.rsbot.accessors.RSAnimable;import org.rsbot.accessors.RSNPCNode;import org.rsbot.bot.Bot;import org.rsbot.event.events.ServerMessageEvent;import org.rsbot.event.listeners.PaintListener;import org.rsbot.event.listeners.ServerMessageListener;import org.rsbot.script.Bank;import org.rsbot.script.Calculations;import org.rsbot.script.Constants;import org.rsbot.script.Methods;import org.rsbot.script.MouseHandler;import org.rsbot.script.Script;import org.rsbot.script.ScriptManifest;import org.rsbot.script.wrappers.RSInterface;import org.rsbot.script.wrappers.RSItemTile;import org.rsbot.script.wrappers.RSNPC;import org.rsbot.script.wrappers.RSObject;import org.rsbot.script.wrappers.RSTile;import org.rsbot.script.wrappers.RSCharacter;@ScriptManifest(authors = { "v3n0m96" }, category = "Woodcutting", name = "VenzWillows", version = 1.0, description = "Start This By Any willows w/ axe in inv or slot! version 1.0 last updated Auguest 16 2010")public class VenzWillows extends Script implements PaintListener, ServerMessageListener {/*** Variables*/ private int[] hatchet = { 1351, 1349, 14108, 1353, 1361, 1355, 1357, 1359,4031, 6739, 13470, 13661, 14069 };private int logs = 1517;int lastTreeIndex;//Paintprivate int chopped = 0;public long startTime;public int expGained;public int levelsGained;private String status = "";private int startexp;/*** Cutting logs*/public boolean chopLogs() {if (!isIdle()) {return true;}final RSObject Tree = getNearestObjectByID(1308, 5551, 5552, 5553, 8481, 8482, 8483, 8484, 8485, 8486, 8487, 8488 );if (Tree == null) {return false;}if (Tree != null){clickObjectTree(Tree, "Chop");wait(random(1000, 5000));return true;}return false;}/*** Start Script**/public boolean onStart(final Map<String, String> args) {startTime = System.currentTimeMillis();log("Starting AnyTime Willows by Yomamadang");return true;}/*** Finished Script**/public void onFinish() {ScreenshotUtil.takeScreenshot(true);Bot.getEventManager().removeListener(PaintListener .class, this);}boolean clickObjectTree(RSObject willowTree, String action) {if (!(willowTree.getObject() instanceof RSAnimable)) {return atTree(willowTree, action);} else {moveMouse(getModelPoint(willowTree), 3, 3);return atMenu(action);}}private Point getModelPoint(RSObject willowTree) {Model model = willowTree.getModel();RSAnimable animable = (RSAnimable) willowTree.getObject();Point[] screenCoords = new Point[model.getXPoints().length];for (int i = 0; i < screenCoords.length; i++) {int x = model.getXPoints()[i] + animable.getX();int z = model.getZPoints()[i] + animable.getY();int y = model.getYPoints()[i]+ Calculations.tileHeight(animable.getX(), animable.getY());screenCoords[i] = Calculations.w2s(x, y, z);}return screenCoords[random(0, screenCoords.length)];}/*** Anti Ban*/private int antiBan(){final int random = random(1,20);switch (random) {case 1:if(random(1, 35) == 4){openTab(Constants.TAB_STATS);moveMouse(random(665, 395), random(709, 412));}return random(1500, 7500);case 2:if(random(1, 23) == 8){moveMouseRandomly(600);}return random(750, 1000);case 3:if(random(1, 29) == 6){setCameraRotation(189);}return random(2100, 5550);}return 1500;}/*** Main loop**/@Overridepublic int loop() {if (isInventoryFull()){dropAllExcept(true, hatchet);wait(1000);} else {antiBan();chopLogs();}return 0;}/*** Paint**/public void serverMessageRecieved(ServerMessageEvent e) {String word = e.getMessage().toLowerCase();if (word.contains("get")) {chopped++;}}public void onRepaint(Graphics g) {((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASIN G, RenderingHints.VALUE_ANTIALIAS_ON);if (isLoggedIn()) {long runTime = 0;long seconds = 0;long minutes = 0;long hours = 0;runTime = System.currentTimeMillis() - startTime;if (startexp == 0) {startexp = skills.getCurrentSkillExp(Constants.STAT_WOODCUTTI NG);}expGained = skills.getCurrentSkillExp(Constants.STAT_WOODCUTTI NG) - startexp;seconds = runTime / 1000;if ( seconds >= 60 ) {minutes = seconds / 60;seconds -= (minutes * 60);}if ( minutes >= 60 ) {hours = minutes / 60;minutes -= (hours * 60);} g.setColor(new Color(0, 0, 0, 140));g.fillRect(572, 165, 186, 256);g.setColor(new Color(47, 47, 89, 200));g.setColor(Color.ORANGE);g.setFont(new Font("GEORGE", Font.PLAIN, 22));g.drawString("Venz Willows", 581, 195);g.setFont(new Font("Palatino Linotype", Font.BOLD, 13));g.drawString("Script by Venom96" , 580, 211);g.drawString("Based onYomamadang's" , 580,244);g.drawString("''anywillows'" , 580,258);g.drawString("Gained : " + levelsGained+" Level(s)" , 580, 230);g.setFont(new Font("Trajan Pro", Font.PLAIN, 16));g.drawString("Run Time: " + hours + ":" + minutes + ":" + seconds , 580, 278);g.drawString("EXP Gained:"+expGained , 580, 307);g.drawString("Logs Cut: "+ (chopped) , 580, 401);g.setFont(new Font("Palatino Linotype", Font.PLAIN, 13));g.setColor(Color.RED); g.fill3DRect(580, 350, 150, 11, true); g.setColor(Color.GREEN); g.fill3DRect(580, 350, skills.getPercentToNextLevel(Constants.STAT_WOODCU TTING), 11, true); g.setColor(Color.BLACK); g.drawString(skills.getPercentToNextLevel(Constant s.STAT_WOODCUTTING) + "% to " + (skills.getCurrentSkillLevel(Constants.STAT_WOODCU TTING) + 1), 625, 360); }}}