Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.awt.event.*;
- import java.io.*;
- import java.net.*;
- import java.util.*;
- import com.speljohan.rsbot.event.events.*;
- import com.speljohan.rsbot.event.listeners.*;
- import com.speljohan.rsbot.event.listeners.PaintListener;
- import com.speljohan.rsbot.accessors.*;
- import com.speljohan.rsbot.account.*;
- import com.speljohan.rsbot.bot.*;
- import com.speljohan.rsbot.script.wrappers.*;
- import com.speljohan.rsbot.script.*;
- import com.speljohan.rsbot.event.listeners.ServerMessageListener;
- import com.speljohan.rsbot.event.events.ServerMessageEvent;
- public class SmokinLizards extends Script implements ServerMessageListener, PaintListener {
- int Caught = 19659;
- int whatEXP = 272;
- int Lizard = 10147;
- int caught = 0;
- int Net = 303;
- int NormalTree = 19662;
- int Rope = 954;
- int startExp = 0;
- public long startTime = System.currentTimeMillis();
- public long time = System.currentTimeMillis();
- int Trapped = 19678;
- int GambleInt;
- private final RSTile HunterTile = new RSTile(2474, 3237);
- public static final int[] ReleaseSalamander = new int[] { 10147 };
- public String getAuthor( ) { //Sets the Authors name
- return "SmokeHaze";
- }
- public String getName( ) {
- return "SmokinLizards";
- }
- public double getVersion( ) {
- return 1.0;
- }
- public String getScriptCategory() { //Sets the category that the script fit's into
- return "SmokeHaze Series/Hunter";
- }
- public String getScriptDescription( ) {
- String html="<html>";
- html += "<body>";
- html += "<center><font size=6><b>Smokin Lizards v1.0</b></font><font size=3><br><br><li>Before you start change the numbers in bold to your position you will be using <br> *private final RSTile HunterTile = new RSTile<b>(2449, 3225)</b>* </li> <br> <li>preferably set the tiles to the middle of where you will be around</li> <br> <li>Make sure camera is angled so you can see all trees you wish to use</li> <br> <li>It helps to check with objects seen, make sure the red object dot is lined up nicely with the tree</li> <br> <li>I recommend using the tiles I set it uses 3 trees flawlessy</li> <br> <li>Make sure to turn off <b><u>Break Handler</b></u> or else you will lose traps</li> <br> <li>There is <b>no</b> antiban so I hold no responsibility if you get banned</li> <br> <li>feel free to add your own anti ban</li> <br> <li>should work great if you follow my instructions ~ I use it myself</li><br> -- Credit goes to my girlfriend Koneko for making my paint -- </font></center>";
- html += "</body>";
- html += "</html>";
- return html;
- }
- public boolean onStart( Map<String, String> args ) {
- Bot.getEventManager().addListener(PaintListener.class, this);
- return true;
- }
- public void onFinish( ) {
- Bot.getEventManager().addListener(PaintListener.class, this);
- }
- public void serverMessageRecieved(ServerMessageEvent e) {
- String word = e.getMessage().toLowerCase();
- if (word.contains("caught a red")) {
- caught++;
- }
- }
- public void turnCamera() {
- char[] LR = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT };
- char[] UD = new char[] { KeyEvent.VK_DOWN, KeyEvent.VK_UP };
- char[] LRUD = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT,
- KeyEvent.VK_UP, KeyEvent.VK_UP };
- int random2 = random(0,2);
- int random1 = random(0,2);
- int random4 = random(0,4);
- if(random(0,3) == 0 && getMyPlayer().getAnimation() != -1) {
- Bot.getInputManager().pressKey(LR[random1]);
- try { Thread.sleep(random(50, 100)); } catch (Exception e) {}
- Bot.getInputManager().pressKey(UD[random2]);
- try { Thread.sleep(random(50, 100)); } catch (Exception e) {}
- Bot.getInputManager().releaseKey(UD[random2]);
- try { Thread.sleep(random(50, 100)); } catch (Exception e) {}
- Bot.getInputManager().releaseKey(LR[random1]);
- } else {
- Bot.getInputManager().pressKey(LRUD[random4]);
- if(random4>1) {
- try { Thread.sleep(random(5, 10)); } catch (Exception e) {}
- } else {
- try { Thread.sleep(random(5, 10)); } catch (Exception e) {}
- }
- Bot.getInputManager().releaseKey(LRUD[random4]);
- }
- }
- public void onRepaint(Graphics g) {
- if (isLoggedIn()) {
- int exp = 0;
- int perNextLvl = 100 - skills.getPercentToNextLevel(STAT_HUNTER);
- int nextLvl = skills.getCurrentSkillLevel(STAT_HUNTER) + 1;
- 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);
- int seconds1 = (int) seconds % 60;
- int minutes1 = (int) minutes % 60;
- int hours1 = (int) hours % 60;
- float fished = caught/(minutes1 + hours1*60 + seconds1/60f) * 60f;
- if ( startExp == 0) {
- startExp = skills.getCurrentSkillExp(STAT_HUNTER);
- }
- int amt;
- amt = skills.getXPToNextLevel(STAT_HUNTER) / whatEXP;
- exp = skills.getCurrentSkillExp(STAT_HUNTER) - startExp;
- g.setColor(new Color(0, 0, 0, 0));
- g.fill3DRect(5, 25, 245, 100, true);
- g.setColor(Color.BLUE);
- g.drawString(getName() + " v" + getVersion(), 10, 40);
- g.setColor(Color.WHITE);
- g.drawString("Time you could've done this legitly: " + hours + ":" + minutes + ":"
- + seconds + "." , 10, 55);
- g.drawString("Smokin Lizards Caught " + Integer.toString(caught), 10, 70);
- g.drawString("XP Gained: " + exp + " XP. " ,10, 85);
- g.drawString("Smokin Lizards till Lvl: " + amt , 10, 100);
- g.drawString("Catching " + fished + "Smokin Lizards Per Hour." , 10, 115);
- }
- }
- public boolean atTileTake(RSTile tile, String action) {
- int TempCounter = 0;
- while (true) {
- if (!getMyPlayer().isMoving()) break;
- wait(random(5, 10));
- }
- try {
- Point location = Calculations.tileToScreen(tile);
- if (location.x == -1 || location.y == -1) return false;
- moveMouse(location, 8,8);
- wait(random(5, 10));
- while(!getMenuItems().get(0).toLowerCase().contains(action.toLowerCase()) && TempCounter < 5){
- location = Calculations.tileToScreen(tile);
- moveMouse(location, 8,8);
- TempCounter++;
- }
- if(getMenuItems().get(0).toLowerCase().contains(action.toLowerCase())) {
- clickMouse(true);
- }
- else {
- clickMouse(false);
- atMenu(action);
- }
- wait(random(5, 10));
- return true;
- } catch (Exception e) {
- return false;
- }
- }
- public void Release() {
- boolean release = false;
- for (int i = 0; i < 27; i++) {
- for (int element : ReleaseSalamander) {
- if (element == getInventoryItems()[i].getID()) {
- release = true;
- }
- }
- if (release) {
- atInventoryItem(getInventoryItems()[i].getID(), "Release Re");
- wait(random(5, 10));
- if(!inventoryContains(10147)) {
- release = false;
- }
- }
- }
- }
- public int loop( ) {
- if (!isRunning() && getEnergy() > random(5, 10)) {
- setRun(true);
- }
- if(inventoryContains(10147)) {
- atInventoryItem(10147, "Release");
- }
- RSItemTile rope=getGroundItemByID(Rope);
- if(rope != null && !isInventoryFull()) {
- atTileTake(rope,"Take");
- wait(random(5,10));
- }
- RSItemTile net=getGroundItemByID(Net);
- if(net != null && !isInventoryFull()) {
- atTileTake(net,"Take");
- wait(random(5,10));
- ;
- }
- if(distanceTo(HunterTile) >= 5) {
- walkTileMM(HunterTile);
- wait(random(5,10));
- }
- if (getMyPlayer().getAnimation() == 5215) {
- ;
- }
- if (getMyPlayer().isMoving()) { return 800; }
- if (isInventoryFull()) {
- Release();
- }
- RSObject CaughtSalamander = findObject(19659);
- if (CaughtSalamander != null && distanceTo(CaughtSalamander.getLocation()) <= 6) {
- wait(random(5,10));
- atObject(CaughtSalamander, "Check Net");
- wait(random(5,10));
- }
- RSObject YoungTree = findObject(19663);
- if (YoungTree != null && distanceTo(YoungTree.getLocation()) <= 6) {
- wait(random(5,10));
- atObject(YoungTree, "Set-trap You");
- wait(random(5,10));
- }
- return random(5,10);
- }
- }
Add Comment
Please, Sign In to add comment