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.

Warrior killer

Featured Replies

This is my first ever script this is a work in progress i am using this script to learn more and how to do different things so any help is appreciated.


The purpose of this script is to kill al-kharid warriors .

 

The code. ( I'm still learning so no need to be harsh but any help is appreciated )

package warriorkiller;

import java.awt.Graphics;

import org.osbot.script.Script;
import org.osbot.script.ScriptManifest;
import org.osbot.script.rs2.model.Entity;
import org.osbot.script.rs2.model.Player;
import org.osbot.script.rs2.utility.Area;

@ScriptManifest(author = "Brody", info = "Kills warriors at al-kharid", name = "Basic warrior", version = 0.2)
public class basicwarrior extends Script {
	
	final String WARRIOR = "Al-Kharid warrior";
	final Area PALACE = new Area (3305, 3175, 3280, 3179);
	
	@Override
	public void onStart() {
		//Before the script starts it goes through this method
		log("Go to the palace at al-kharid for this script to work");
	}
	
	
	@Override
	public void onPaint(Graphics g) {
		//Graphics (displaying graphics on screen)
	}
	
	@Override
	public int onLoop() throws InterruptedException	{
		Player player = client.getMyPlayer();
		Entity kharid = closestAttackableNPCForName("WARRIOR");
		
		if (PALACE.contains(player)); {
		if (kharid !=null) {
			if (kharid.isVisible()) {
			if (!client.getMyPlayer().isUnderAttack()) {
			kharid.interact("Attack");
			sleep(random(600, 700));
			} else {
				client.moveCameraToEntity(kharid);
			}
		}
		}
		}
		return 50; //sleep time
	}
	
	@Override
	public void onExit() {
		//when stopped
		log("thanks for using my script I hope you enjoyed it and it benefited you!.");
	}
	
}

What needs to be done

 

Banking

Picking up items

Eating

Will add more in future

Edited by theholyman

Good start, but one thing I've noticed already:

		Entity kharid = closestAttackableNPCForName("WARRIOR");

In this line, you're literally searching for an NPC called "WARRIOR". You need to remove the quotation marks from around WARRIOR so that line of code will reference your WARRIOR variable and search for the string "Al-Kharid warrior" .

Edited by Deffiliate

  • Author

 

Good start, but one thing I've noticed already:

		Entity kharid = closestAttackableNPCForName("WARRIOR");

In this line, you're literally searching for an NPC called "WARRIOR". You need to remove the quotation marks from around WARRIOR so that line of code will reference your WARRIOR variable and search for the string "Al-Kharid warrior" .

 

 

Thanks i didn't realise that ill fix right away

Guest
This topic is now closed to further replies.

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.