Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.util.*;
- import com.speljohan.rsbot.script.*;
- import com.speljohan.rsbot.bot.*;
- import com.speljohan.rsbot.script.wrappers.*;
- import com.speljohan.rsbot.event.listeners.*;
- import com.speljohan.rsbot.event.events.*;
- import com.sun.org.apache.bcel.internal.generic.IfInstruction;
- public class Druidkiller extends Script{
- public int druidID = 181;
- public int agility = 11844;
- public int booth = 11758;
- public int ladderup = 32015;
- public int ladderdown = 20987;
- public int marrentillID = 201;
- public int harralanderID = 205;
- public int ranarrID = 207;
- public int tarrominID = 203;
- public int guamID = 199;
- public int lantadymeID = 2485;
- public int iritID = 209;
- public int cadantineID = 215;
- public int dwarfWeedID = 217;
- public int kwuarmID = 213;
- public int avantoeID = 211;
- public int snapeID = 231;
- RSTile banktoagility = new RSTile(2936, 3355);
- RSTile[] agilitytoladder = { new RSTile(2919, 3366) , new RSTile(2904, 3377),
- new RSTile(2893, 3388) , new RSTile(2886, 3397 )};
- RSTile[] laddertodruids = { new RSTile(2885, 9812) , new RSTile(2884, 9826),
- new RSTile(2884, 9840) , new RSTile(2897, 9849) , new RSTile(2914, 9850) , new RSTile(2930, 9848)};
- RSTile[] druidstoladder = { new RSTile(2917, 9850) , new RSTile(2901, 9848),
- new RSTile(2887, 9844) , new RSTile(2884, 9833) , new RSTile(2884, 9818 ) , new RSTile(2885, 9803)};
- RSTile[] laddertoagility = { new RSTile(2898, 3389) , new RSTile(2907, 3375),
- new RSTile(2919, 3362) , new RSTile(2928, 3355) , new RSTile(2934, 3354)};
- RSTile agilitytobank = new RSTile(2946, 3369);
- public String getName(){
- return "Druid Killer";
- }
- public String getAuthor(){
- return "Eric & Tmoe";
- }
- public String getScriptCategory(){
- return "Combat";
- }
- public double getVersion(){
- return 1.0;
- }
- public boolean onStart(Map<String, String> args) {
- return true;
- }
- public void onFinish(){
- return;
- }
- public boolean needToBank(){
- return isInventoryFull();
- }
- public boolean atBank() {
- RSObject bank = getNearestObjectByID(booth);
- if(bank == null) return false;
- return tileOnScreen(bank.getLocation());
- }
- public boolean handleBank(){
- RSObject bankBooth = getNearestObjectByID(booth);
- if(bank == null)
- return false; //We cannot find a bank booth.
- if(bank.isOpen()){
- bank.depositAll();
- }else{
- atObject(bankBooth, "uickly");
- }
- return true;
- }
- public boolean druidstoladder(){
- RSTile[] randomizedPath = randomizePath(druidstoladder, 2, 2);
- RSTilePath path = new RSTilePath(randomizedPath, this);
- try {
- return path.walkToEnd();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return false;
- }
- public boolean laddertoagility(){
- RSTile[] randomizedPath = randomizePath(laddertoagility, 2, 2);
- RSTilePath path = new RSTilePath(randomizedPath, this);
- try {
- return path.walkToEnd();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return false;
- }
- public boolean agilitytobank(){
- RSTile[] randomizedPath = randomizePath(agilitytobank, 2, 2);
- RSTilePath path = new RSTilePath(randomizedPath, this);
- try {
- return path.walkToEnd();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return false;
- }
- public boolean banktoagility(){
- RSTile[] randomizedPath = randomizePath(banktoagility, 2, 2);
- RSTilePath path = new RSTilePath(randomizedPath, this);
- try {
- return path.walkToEnd();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return false;
- }
- public boolean agilitytoladder(){
- RSTile[] randomizedPath = randomizePath(agilitytoladder, 2, 2);
- RSTilePath path = new RSTilePath(randomizedPath, this);
- try {
- return path.walkToEnd();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return false;
- }
- public boolean laddertodruids(){
- RSTile[] randomizedPath = randomizePath(laddertodruids, 2, 2);
- RSTilePath path = new RSTilePath(randomizedPath, this);
- try {
- return path.walkToEnd();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return false;
- }
- private boolean ATTACKNPC(final RSNPC npc, final String action) { // edited
- // ruskis
- // a lil
- final RSTile tile = npc.getLocation();
- tile.randomizeTile(1, 1);
- try {
- final int hoverRand = random(8, 13);
- for (int i = 0; i < hoverRand; i++) {
- final Point screenLoc = npc.getScreenLocation();
- if (!pointOnScreen(screenLoc)) {
- setCameraRotation(getCameraAngle() + random(-35, 150));
- return true;
- }
- moveMouse(screenLoc, 15, 15);
- final List<String> menuItems = getMenuItems();
- if (menuItems.isEmpty() || menuItems.size() <= 1) {
- continue;
- }
- if (menuItems.get(0).toLowerCase().contains(
- npc.getName().toLowerCase())
- && getMyPlayer().getInteracting() == null) {
- clickMouse(true);
- return true;
- } else {
- for (int a = 1; a < menuItems.size(); a++) {
- if (menuItems.get(a).toLowerCase().contains(
- npc.getName().toLowerCase())
- && getMyPlayer().getInteracting() == null) {
- clickMouse(false);
- return atMenu(action);
- }
- }
- }
- }
- } catch (final Exception e) {
- log.warning("ATTACKNPC(RSNPC, String) error: " + e);
- return false;
- }
- return false;
- }
- public boolean isInArea(int[] points) {
- // maxX minY minX maxY
- int x = getMyPlayer().getLocation().getX();
- int y = getMyPlayer().getLocation().getY();
- if (x <= points[0] && y >= points[1] && x >= points[2] && y <= points[3]) {
- return true;
- }
- return false;
- }
- public int loop() {
- if(needToBank()){
- RSObject bankBooth = getNearestObjectByID(booth);
- if(bank.isOpen()){
- depositHerbs();
- return 800;
- }
- if(!bank.isOpen() && bankBooth != null){
- openBank();
- return 800;
- }else{
- if(druidstoladder()){
- return 800;
- }else{
- RSObject LadderUp = getNearestObjectByID( 32015 );
- if(LadderUp != null){
- atObject(LadderUp, "Climb Up");
- return 800;
- }else{
- if(laddertoagility()){
- return 900;
- }else{
- RSObject wall = getNearestObjectByID( 11844 );
- if(agility != null){
- atObject(LadderUp, "Climb over");
- return 800;
- }else{
- if(agilitytobank()){
- return 700;
- }
- }
- }
- }
- }
- }
- } else if (in druid area) {
- //attack npc
- }
- } else {
- banktoagility()){
- return 900;
- }else{
- RSObject agility = getNearestObjectByID( 11844 );
- if(agility != null){
- atObject(Wall, "Climb Over");
- return 800;
- }
- }else{
- agilitytoladder()){
- return 700;
- }else{
- RSObject ladderdown = getNearestObjectByID( 11844 );
- if(ladderdown != null){
- atObject(Ladder, "Climb Down");
- return 800;
- }else{
- laddertodruids()){
- return 800;
- }
- }
Add Comment
Please, Sign In to add comment