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.

Trying to make a splasher

Featured Replies

I'm trying to make a splasher for spells like curse etc which can't be autocasted. But how do i only attack the npc that is currently attacking me? Because in the script i'm making that doesn't work correctly.

 

Spoiler

import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.ui.MagicSpell;
import org.osbot.rs07.script.MethodProvider;
import org.osbot.rs07.utility.ConditionalSleep;

public class Attacker {

	public Attacker(MethodProvider mp, MagicSpell spellToCast) throws InterruptedException {

		NPC npc = mp.getNpcs().closest(n -> n.getName().equals("Rat") && n.getInteracting() == null && !n.isUnderAttack());
		
		if(mp.myPlayer().isUnderAttack()) {
			NPC rat = mp.getNpcs().closest("Rat");
			if(rat != null) {
				if(rat.isInteracting(mp.myPlayer())) {
					if(!mp.getMagic().isSpellSelected()) {
						if(mp.getMagic().castSpell(spellToCast)) new ConditionalSleep(1000) {
							
							@Override
							public boolean condition() throws InterruptedException {
								return mp.getMagic().isSpellSelected();
							}
						}.sleep();
					} else {
						if(!mp.myPlayer().isAnimating()) {
							if(rat.interact("Cast")) new ConditionalSleep(2000) {
								
								@Override
								public boolean condition() throws InterruptedException {
									return !mp.getMagic().isSpellSelected();
								}
							}.sleep();
						}
					}
				}
			}
			
		} else {
			if(npc != null) {
				if(!mp.myPlayer().isMoving() && !mp.myPlayer().isAnimating()) {
				if(!mp.getMagic().isSpellSelected()) {
					if(mp.getMagic().castSpell(spellToCast)) new ConditionalSleep(1000) {
						
						@Override
						public boolean condition() throws InterruptedException {
							return mp.getMagic().isSpellSelected();
						}
					}.sleep();
				} else {
					if(npc.interact("Cast")) new ConditionalSleep(2000) {
						
						@Override
						public boolean condition() throws InterruptedException {
							return !mp.getMagic().isSpellSelected();
						}
					}.sleep();
				}
				}
			}
		}
		
		
	}
	
}

 

 

And also what is a good way to make it stop spamming the spells?

 

Dont know how to code but cant u just go to the lesser demon in the wizard tower/chaos druid in varrock where there is only 1 npc?

Probably have to use" if in combat" for it to stop clicki g the spell more than once per cast, or if there is a "if animation" in the api.

 

Im not a scripter, just from what ive seen in other threads in the past.

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.