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.

Get type of damage?

Featured Replies

Is there a way to determine what kind of damage you're taking? For example, one monster I'm fighting might use melee while another one might use ranged. Is there a way to determine how you're getting attacked so I can put on the correct prayer? Thanks!

Nope, you'd have to use the monsters animation ID to determine what attack it is using

  • Author
1 hour ago, Night said:

Nope, you'd have to use the monsters animation ID to determine what attack it is using

Would it be possible to use projectiles? Of course it wouldn't differentiate ranged/mage, but at least ranged/mage and melee?

  • Author
19 minutes ago, Chris said:

try projectiles

Would there be a more efficient way than doing this? Or is there a way to use a filter with projectiles (doubt it, took a quick look).

LinkedList<Projectile> allProj = api.projectiles.getAll();
	for (Projectile temp : allProj) {
    	if (temp.getTargetEntity().equals(api.myPlayer()) && Variables.usePrayer && !api.getPrayer().isActivated(PrayerButton.PROTECT_FROM_MISSILES)) {
            return true;
        }
   	}

My thinking is it checks if any projectile is targeted at me, if it is return true (go to the execution method).

Edited by DrizzyBot

what npcs/players are you planning on using this one maby we can give a more accurate help

ad hoc

api.projectiles.getAll()
	.stream()
	.filter(this::isProjectileTargetingMe)
	.filter(this::isProjectileARangedAttack)
	.collect(Collectors.toList());
	
private boolean isProjectileTargetingMe(Projectile p) {
	return api.myPlayer().equals(p.getTargetEntity());
}

private boolean isProjectileARangedAttack(Projectile p) {
	return p.getId() == -1; // TODO
}
  1. get projectiles
  2. get only projectiles targeting us
  3. get only projectiles with certain ID

Then you can mess about figuring out whether you're praying the right prayer. Look into Lambda expressions for Java.

  • Author
20 hours ago, TheMcPker said:

what npcs/players are you planning on using this one maby we can give a more accurate help

It's going to be an AIO fighter, but some areas have multiple monsters with multiple attack types (mountain trolls for example also has thrower trolls that use ranged).

20 hours ago, liverare said:

ad hoc


api.projectiles.getAll()
	.stream()
	.filter(this::isProjectileTargetingMe)
	.filter(this::isProjectileARangedAttack)
	.collect(Collectors.toList());
	
private boolean isProjectileTargetingMe(Projectile p) {
	return api.myPlayer().equals(p.getTargetEntity());
}

private boolean isProjectileARangedAttack(Projectile p) {
	return p.getId() == -1; // TODO
}
  1. get projectiles
  2. get only projectiles targeting us
  3. get only projectiles with certain ID

Then you can mess about figuring out whether you're praying the right prayer. Look into Lambda expressions for Java.

Perfect, thank you.

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.