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.

GoblinKiller [First Script/Open Source]

Featured Replies

Just skimmed over the code, here are a few suggestions
 
- Use filters for NPCs (both goblins and randoms), yes what you have is fine, but the goblin npc getter could be slightly optimized
 

	public Filter<NPC> goblin = new Filter<NPC>() {
		@Override
		public boolean match(NPC n) {
			if (!n.getName().equalsIgnoreCase("Goblin")) {
				return false;
			}
			if (n.getHealth() == 0) {
				return false;
			}
			if (!getMap().canReach(n)) {
				return false;
			}
			return true;
		}
	};

 
In this case, it will only attack goblins with health above 0 (alive) that it can currently reach.
 
- Use getNpcs().closest(goblin) or ("Goblin", "Chicken", "Lesser demon") to get the nearest npc, instead of sorting them by distance manually
- You can use npc.interact("Attack"), or simply hover and mouse click, however make sure you are not redundantly hovering over the npc, so 
 
if (hover) { //
//blahblah
} else {
mouse.hover(..);
}

 

- Avoid sleep(Long.MAX_VALUE), instead, (assuming you want to stop the script) just call stop(); and it will logout automatically and terminate the script

 

 

 
Overall, your code displays background knowledge with java however, a lack of understanding of the OSBot API, you can find it here
 
So, take some time to familiarize yourself with the OSBot API and you should be just fine :D

Edited by Czar

  • Author

Thank You for your suggestions.

I've updated my script. 

  • 2 weeks later...

Hi, i want to ask what is this u.* in your code? examples from your code:

if (u.ins == null){
      u.initUtils(this);

//or

if (selectedGoblin == null || selectedGoblin.getHealth() == 0 || 
				u.isAttackedByOtherPlayer(selectedGoblin) || !selectedGoblin.exists())

//or

u.antiBan();

Its just im learning stuff from open sources and i got confused what is this u.* used everywhere.

 

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.