Skip 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.

DexAlcher

Featured Replies

Basic Alch script with a small anti ban cheers!

Put the item you'd like to alch at the far right in the first row the script will high light a box for you where to place it if you're lost

If you want low Alchemy just swap the function call on highAlchemy and it will do that instead!

package com.dexalcher;

import java.awt.Color;
import java.awt.Graphics2D;

import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

@ScriptManifest(name = "DexAlcher", version = 1.0, author = "Dextrell", logo = "", info = "")
public class DexAlcher extends Script {

	private String itemToAlch = "Rune arrow";

	public void onStart() throws InterruptedException {
		getExperienceTracker().start(Skill.MAGIC);
	}

	public int onLoop() throws InterruptedException {

		int rand = random(0, 200);

		if (rand == 150) {
			log("moving mouse at random...");
			mouse.move(random(0, 2500), random(0, 2500));
		} else if (rand == 0) {
			log("moving mouse off screen...");
			mouse.moveOutsideScreen();
		}

		if (canAlch()) {
			clickedAlch();
		} else {
			stop();
			log("Out of supplies or dead");
		}
		return 1000;
	}

	public boolean canAlch() {
		return (getEquipment().isWieldingWeaponThatContains(new String[] { "staff" })
				&& getInventory().contains(new String[] { "Nature rune", itemToAlch }));
	}

	public void clickedAlch() {

		if (!getInventory().contains(itemToAlch)) {
			log("We dont have the items stopping...");
			stop();
		}

		if (!(getTabs()).magic.open()) {
			new ConditionalSleep(600, 800) {
				@Override
				public boolean condition() throws InterruptedException {
					return false;
				}
			};
		}

		new ConditionalSleep(600, 1000) {
			@Override
			public boolean condition() throws InterruptedException {
				clickHighSpellAlchemy();
				return false;
			}
		}.sleep();

		new ConditionalSleep(600, 1000) {
			@Override
			public boolean condition() throws InterruptedException {

				// final RS2Widget itemPic = getWidgets().get(149, 3);
				// int clickX = itemPic.getAbsX() + random(0,6);
				int clickX = random(691, 717);
				int clickY = random(216, 235);
				// int clickY = itemPic.getAbsY() + random(0,6);
				// log("src x: " + itemPic.getAbsX() + " src: " + itemPic.getAbsY());
				// log("Click x: " + clickX + " y: " + clickY);
				mouse.click(clickX, clickY, false);

				log("Finished clicking item...");
				return false;
			}

		}.sleep();

	}

	public boolean clickMagicBook() {

		RS2Widget bookIcon = getWidgets().get(548, 76);
		int clickX = bookIcon.getAbsX() + random(10, 20);
		int clikcY = bookIcon.getAbsY() + random(10, 20);

		return mouse.click(clickX, clikcY, false);
	}

	public void clickLowSpellAlchemy() {
		// RS2Widget alchemyIcon = getWidgets().get(218, 21);
		// int clickX = alchemyIcon.getAbsX() + random(0,5);
		// int clickY = alchemyIcon.getAbsY() + random(0,5);
		int clickX = random(714, 728);
		int clickY = random(233, 247);
		// log("src x: " + alchemyIcon.getAbsX() + " src: " + alchemyIcon.getAbsY());
		mouse.click(clickX, clickY, false);
		// log("alch click x: " + clickX + " clickY: " + clickY);
	}
	
	public void clickHighSpellAlchemy() {
		// RS2Widget alchemyIcon = getWidgets().get(218, 21);
		// int clickX = alchemyIcon.getAbsX() + random(0,5);
		// int clickY = alchemyIcon.getAbsY() + random(0,5);
		int clickX = random(710, 730);
		int clickY = random(305, 320);
		// log("src x: " + alchemyIcon.getAbsX() + " src: " + alchemyIcon.getAbsY());
		mouse.click(clickX, clickY, false);
		// log("alch click x: " + clickX + " clickY: " + clickY);
	}

	public void onPaint(Graphics2D g) {
		int mXp = getExperienceTracker().getGainedXP(Skill.MAGIC);
		super.onPaint(g);
		g.drawString("Magic XP: " + mXp, 387, 328);
		
		g.setColor(Color.CYAN);
		
		g.drawOval((int)mouse.getPosition().getX(), (int)mouse.getPosition().getY(), 10, 10);
		
		if(isInventoryOpen()) {
			g.drawRect(690, 210, 32, 32);
		}
		else {
			//g.drawRect(710, 230, 25, 25);
			g.drawRect(710, 300, 25, 25);
		}
	}
	
	private boolean isInventoryOpen() {
		RS2Widget inventoryWidget = getWidgets().get(149, 0, 3);
		return inventoryWidget != null && inventoryWidget.isVisible();
	}
}

 

Edited by Dextrell

  • 2 weeks later...

Definitely would be worth adding the ability to click the alch item wherever it is in the inventory.
I have an open source alch/splasher you can take code from (link in my sig)

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.