Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Animated Armour (Warriors Guild)

Featured Replies

Hello

Made a little script for farming the tokens at the warriors guild for getting my dragon defender.  

It's currently hardcoded to lobster and mithril armour but you can edit source...:)

Setup:

  • Have lobster in inventory
  • Have mithril platelegs, body and full helm in inventory

Jar file here

import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import javax.swing.*;
import java.awt.*;

@ScriptManifest(name = "Animator by RickyD", author = "RickyD", version = 1.0, info = "Animates your armour to farm warrior guild tokens", logo = "")

public class Animated extends Script {

    String[] foodName = {"Lobster"};
    NPC anim;
    GroundItem lootables;
    String [] lootNames = {"Mithril platebody", "Warrior guild token", "Mithril full helm", "Mithril platelegs"};

    @Override

    public void onStart() {}


    @Override

    public void onExit() {}

    public boolean hasArmour(){
        if(getInventory().contains("Mithril platebody")){
            if(getInventory().contains("Mithril platelegs")){
                if(getInventory().contains("Mithril full helm")){
                    return true;
                }else{
                    return false;
                }
            }else{
                return false;
            }
        }else{
            return false;
        }
    }


    @Override

    public int onLoop() throws InterruptedException{

        anim = getNpcs().closest(2454);
        lootables = getGroundItems().closest(lootNames);

        if(getInventory().contains(foodName) && getInventory().getAmount("Warrior guild token") < 1000){
            if(anim != null && anim.isInteracting(myPlayer())){
                if(myPlayer().getHealthPercent() < 50){

                    getInventory().interact("Eat", foodName);
                    //DTiming.waitCondition(() -> myPlayer().getAnimation() == 829, 2000);
                    new ConditionalSleep(2000){
                        @ Override
                        public boolean condition() throws InterruptedException
                        {
                            return myPlayer().getAnimation() == 829;
                        }
                    }.sleep();
                }else{
                    if(myPlayer().getInteracting() == null){
                        anim.interact("Attack");
                    }
                }
            }else{
                if(lootables != null){
                    lootables.interact("Take");
                }else{
                    if(hasArmour()){
                        getObjects().closest("Magical Animator").interact("Animate armour");
                    }
                }
            }
        }else{
            JOptionPane.showMessageDialog(null,
                    "NO FOOD or 1k Tokens",
                    "Alert",
                    JOptionPane.WARNING_MESSAGE);

            stop(false);
        }


        return 100; //The amount of time in milliseconds before the loop starts over

    }

    @Override

    public void onPaint(Graphics2D g) {}

}

 

Edited by RickyD

good stuff.

just in case you didn't know, you don't need so many if statements

    public boolean hasArmour(){
        if(getInventory().contains("Mithril platebody")){
            if(getInventory().contains("Mithril platelegs")){
                if(getInventory().contains("Mithril full helm")){
                    return true;
                }else{
                    return false;
                }
            }else{
                return false;
            }
        }else{
            return false;
        }
    }
    public boolean hasArmour(){
        if(getInventory().contains("Mithril platebody") && getInventory().contains("Mithril platelegs") && getInventory().contains("Mithril full helm"))
            return true;
    }

the client sees these as the same

  • Author
11 minutes ago, superuser said:

good stuff.

just in case you didn't know, you don't need so many if statements

the client sees these as the same

For sure, I agree :)

  • 2 weeks later...
On 8/30/2017 at 11:59 PM, superuser said:

good stuff.

just in case you didn't know, you don't need so many if statements


    public boolean hasArmour(){
        if(getInventory().contains("Mithril platebody")){
            if(getInventory().contains("Mithril platelegs")){
                if(getInventory().contains("Mithril full helm")){
                    return true;
                }else{
                    return false;
                }
            }else{
                return false;
            }
        }else{
            return false;
        }
    }

    public boolean hasArmour(){
        if(getInventory().contains("Mithril platebody") && getInventory().contains("Mithril platelegs") && getInventory().contains("Mithril full helm"))
            return true;
    }

the client sees these as the same

Also redundant code, though. It comes down to preference really. Thanks for contribution, OP.

public boolean hasArmour() {
	return getInventory().contains("x");
	}

Edited by Pseudo

46 minutes ago, Pseudo said:

Also redundant code, though. It comes down to preference really. Thanks for contribution, OP.


public boolean hasArmour() {
	return getInventory().contains("x");
	}

:???::???::???:

  • 3 weeks later...

You shouldn't have return 100; at the end. That's a really low return time (1/10th of a second) that speed will get you banned quickly. You should do return random(400, 700); Or something similar, but those return times have always worked for me. It's good to see you're learning though. Good luck :)

Edited by TTScripts

how do I get this onto my sdn? I've been waiting for something like this 

Can't open the Jar file says premium users only 

 

would deffff like to try and test / use this script 

The free hosting period for this file has now expired, only premium users can download it.

8 hours ago, TTScripts said:

You shouldn't have return 100; at the end. That's a really low return time (1/10th of a second) that speed will get you banned quickly. You should do return random(400, 700); Or something similar, but those return times have always worked for me. It's good to see you're learning though. Good luck :)

so what part would you change? or do

On 10/1/2017 at 9:29 PM, iroll said:

so what part would you change? or do

import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import javax.swing.*;
import java.awt.*;

@ScriptManifest(name = "Animator by RickyD", author = "RickyD", version = 1.0, info = "Animates your armour to farm warrior guild tokens", logo = "")

public class Animated extends Script {

    String[] foodName = {"Lobster"};
    NPC anim;
    GroundItem lootables;
  	private String armorType = "Mithril"
    String[] lootNames;

    @Override

    public void onStart() {
    startTime = System.currentTimeMillis();
      lootNames = {armortType & "platebody", "Warrior guild token", armorType & " full helm", armorType & " platelegs"};
    }


    @Override

    public void onExit() {
    log("Script has exited successfully");
    }
  	private long startTime;

    public boolean hasArmour(){
        if(getInventory().contains(armorType & " platebody") && getInventory().contains(armortType & " platelegs") && getInventory().contains(armorType & " full helm")){
              return true;
        }
        return false;
    }


    @Override

    public int onLoop() throws InterruptedException{

        anim = getNpcs().closest(2454);//you should change this to a static method that gets the animated armor npc id
      //maybe anim = getNpcs().closest("Animated " & armorType & " armour");
      //or something like that
        lootables = getGroundItems().closest(lootNames);

        if(getInventory().contains(foodName) && getInventory().getAmount("Warrior guild token") < 1000){
            if(anim != null && anim.isInteracting(myPlayer())){
                if(myPlayer().getHealthPercent() < 50){

                    getInventory().interact("Eat", foodName);
                    //DTiming.waitCondition(() -> myPlayer().getAnimation() == 829, 2000);
                    new ConditionalSleep(2000){
                        @ Override
                        public boolean condition() throws InterruptedException
                        {
                            return myPlayer().getAnimation() == 829;
                        }
                    }.sleep();
                  sleep(random(400, 650);
                }else{
                    if(myPlayer().getInteracting() == null){
                        anim.interact("Attack");
                      sleep(random(800, 1100);
                    }
                }
            }else{
                if(lootables != null){
                    if (lootables.interact("Take")) {
                 		 sleep(random(1200, 1500);
                    }
                }else{
                    if(hasArmour()){
                        if (getObjects().closest("Magical Animator").interact("Animate armour")) {
                      		sleep(random(1200, 2000);
                        }
                    }
                }
            }
        }else{
                      stop(false);
            JOptionPane.showMessageDialog(null,
                    "NO FOOD or 1k Tokens",
                    "Alert",
                    JOptionPane.WARNING_MESSAGE);

        }


        return random(400, 700); //The amount of time in milliseconds before the loop starts over

    }

    @Override

    public void onPaint(Graphics2D g) {
      long millis = System.currentTimeMillis() - startTime;
      		String timeStr = String.format("%02d min, %02d sec", 
				TimeUnit.MILLISECONDS.toMinutes(millis),
				TimeUnit.MILLISECONDS.toSeconds(millis) - 
				TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))
				);
      
    	g.setFont(new Font("Trebuchet MS", Font.PLAIN, 14);
                  g.setColor(Color.WHITE);
                  g.drawString("Time running: " + timeStr, 10, 250);
    }

}

why not 

public boolean hasArmour(){
    return getInventory().contains(armorType + " platebody") && getInventory().contains(armorType + " platelegs") && getInventory().contains(armorType + " full helm");
}

@TTScripts:)

55 minutes ago, 3qTQlBnsOsyfetvA said:

why not 


public boolean hasArmour(){
    return getInventory().contains(armorType + " platebody") && getInventory().contains(armorType + " platelegs") && getInventory().contains(armorType + " full helm");
}

@TTScripts:)

you caught me.  lol :D

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.