Jump to content

Mage tower lesser killer (1st script)


combat_acc

Recommended Posts

Kills lesser demon in mage tower

package lesser;

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


import java.awt.*;


@ScriptManifest(name = "lesser demon", author = "combat", version = 1.0, info = "", logo = "") 
public class main extends Script {


    @[member=Override]
    public void onStart() {
        //Code here will execute before the loop is started


    }
    
    @[member=Override]
    public void onExit() {
        //Code here will execute after the script ends


    }


    @[member=Override]
    public int onLoop() throws InterruptedException {
		//Script on loop
		NPC lesser = npcs.closest("Lesser demon");
		 {
			if(lesser != null) {
			if (lesser.isVisible()) {
				lesser.interact("Attack");
				sleep(random(3000, 6000));
			} else {
				camera.toEntity(lesser);
			}
		  }
		
			sleep(random(3000, 6000));
		}
		
		
	


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


    @[member=Override]
    public void onPaint(Graphics2D g) {
        //This is where you will put your code for paint(s)




    }


}
  • Like 2
Link to comment
Share on other sites

he tried feels.png

 

True :boge:

 

Kills lesser demon in mage tower

package lesser;

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


import java.awt.*;


@ScriptManifest(name = "lesser demon", author = "combat", version = 1.0, info = "", logo = "") 
public class main extends Script {


    @[member='Override']
    public void onStart() {
        //Code here will execute before the loop is started


    }
    
    @[member='Override']
    public void onExit() {
        //Code here will execute after the script ends


    }


    @[member='Override']
    public int onLoop() throws InterruptedException {
		//Script on loop
		NPC lesser = npcs.closest("Lesser demon");
		 {
			if(lesser != null) {
			if (lesser.isVisible()) {
				lesser.interact("Attack");
				sleep(random(3000, 6000));
			} else {
				camera.toEntity(lesser);
			}
		  }
		
			sleep(random(3000, 6000));
		}
		
		
	


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


    @[member='Override']
    public void onPaint(Graphics2D g) {
        //This is where you will put your code for paint(s)




    }


}

 

Try to check if your player is not allready fighting / in combat.

Also check if the current health of the demon is > 0 --> meaning the demon isn't death. Otherwise the script will try to attack the demon even though it's doing the death animation.

 

  • Like 1
Link to comment
Share on other sites

 

Kills lesser demon in mage tower

package lesser;

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


import java.awt.*;


@ScriptManifest(name = "lesser demon", author = "combat", version = 1.0, info = "", logo = "") 
public class main extends Script {


    @[member='Override']
    public void onStart() {
        //Code here will execute before the loop is started


    }
    
    @[member='Override']
    public void onExit() {
        //Code here will execute after the script ends


    }


    @[member='Override']
    public int onLoop() throws InterruptedException {
		//Script on loop
		NPC lesser = npcs.closest("Lesser demon");
		 {
			if(lesser != null) {
			if (lesser.isVisible()) {
				lesser.interact("Attack");
				sleep(random(3000, 6000));
			} else {
				camera.toEntity(lesser);
			}
		  }
		
			sleep(random(3000, 6000));
		}
		
		
	


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


    @[member='Override']
    public void onPaint(Graphics2D g) {
        //This is where you will put your code for paint(s)




    }


}

 omfg was looking for exactly this, can you make it into a .jar?

should add a sleep condition to check if you're attacking instead of a sleep(3000,6000); because that will cause it to click every 3-6 seconds

Also, i don't think you need to spin the camera to it as the client handles that when you attack it 

 

Overall not a bad start 

 

how come the AIO fighter cant attack NPCs behind bars?:(

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...