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.

[Snippet] Prayers Compatibility

Featured Replies

Examples:

 

1)

PrayerCompatibility.areCompatible(PrayerButton.BURST_OF_STRENGTH, PrayerButton.MYSTIC_LORE); // -> false

2)

 

0a74794d1b14dd8b81e6da22a9469518.gif

 

Code:

package org.botre.prayer;

import org.osbot.rs07.api.ui.PrayerButton;

public class PrayerCompatibility {

	private enum Wrapper {

		THICK_SKIN(PrayerButton.THICK_SKIN, (byte)0b00000001), 
		BURST_OF_STRENGTH(PrayerButton.BURST_OF_STRENGTH, (byte)0b00001010),
		CLARITY_OF_THOUGHT(PrayerButton.CLARITY_OF_THOUGHT, (byte)0b00010100),
		SHARP_EYE(PrayerButton.SHARP_EYE, (byte)0b00011110),
		MYSTIC_WILL(PrayerButton.MYSTIC_WILL, (byte)0b00011110),
		ROCK_SKIN(PrayerButton.ROCK_SKIN, (byte)0b00000001),
		SUPERHUMAN_STRENGTH(PrayerButton.SUPERHUMAN_STRENGTH, (byte)0b00001010),
		IMPROVED_REFLEXES(PrayerButton.IMPROVED_REFLEXES, (byte)0b00010100),
		RAPID_RESTORE(PrayerButton.RAPID_RESTORE, (byte)0b00000000),
		RAPID_HEAL(PrayerButton.RAPID_HEAL, (byte)0b00000000), 
		PROTECT_ITEM(PrayerButton.PROTECT_ITEM, (byte)0b00000000),
		HAWK_EYE(PrayerButton.HAWK_EYE, (byte)0b00011110),
		MYSTIC_LORE(PrayerButton.MYSTIC_LORE, (byte)0b00011110), 
		STEEL_SKIN(PrayerButton.STEEL_SKIN, (byte)0b00000001), 
		ULTIMATE_STRENGTH(PrayerButton.ULTIMATE_STRENGTH, (byte)0b00001010),
		INCREDIBLE_REFLEXES(PrayerButton.INCREDIBLE_REFLEXES, (byte)0b00010100),
		PROTECT_FROM_MAGIC(PrayerButton.PROTECT_FROM_MAGIC, (byte)0b00100000), 
		PROTECT_FROM_MISSILES(PrayerButton.PROTECT_FROM_MISSILES, (byte)0b00100000),
		PROTECT_FROM_MELEE(PrayerButton.PROTECT_FROM_MELEE, (byte)0b00100000),
		EAGLE_EYE(PrayerButton.EAGLE_EYE, (byte)0b00011110),
		MYSTIC_MIGHT(PrayerButton.MYSTIC_MIGHT, (byte)0b00011110), 
		RETRIBUTION(PrayerButton.RETRIBUTION, (byte)0b00100000),
		REDEMPTION(PrayerButton.REDEMPTION, (byte)0b00100000), 
		SMITE(PrayerButton.SMITE, (byte)0b00100000),
		CHIVALRY(PrayerButton.CHIVALRY, (byte)0b00011111),
		PIETY(PrayerButton.PIETY, (byte)0b00011111);

		private PrayerButton prayer;
		private byte types;

		private Wrapper(PrayerButton prayer, byte types) {
			this.prayer = prayer;
			this.types = types;
		}

	}

	public static byte forPrayer(PrayerButton prayer) {
		for (Wrapper value : Wrapper.values()) {
			if(value.prayer == prayer) return value.types;
		}
		throw new UnsupportedOperationException("Unable to determine types for: " + prayer);
	}

	public static PrayerButton[] findIncompatible(PrayerButton... prayers) {
		for (PrayerButton prayer : prayers) {
			byte b = forPrayer(prayer);
			for (PrayerButton other : prayers) {
				if(prayer == other) continue;
				byte o = forPrayer(other);
				if((b & o)!= 0) return new PrayerButton[]{prayer, other};
			}
		}
		return null;
	}

	public static boolean areCompatible(PrayerButton... prayers) {
		return findIncompatible(prayers) != null;
	}

}

Edited by Botre

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.