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.

.86 Errors & Bug reports

Featured Replies

  • Author

Well, I'm thoroughly confused now, so, what's the actual bug o.O

 

Alright let me give you my example, maybe we clear out this fog

 

My script interacts with the NPC via "Attack", all is well. Whilst the NPC is dead there's a small timeframe where the NPC is visible but I'm NOT sure whether is null or not, the bot however always right click attacks when it's falling to the ground.

 

Like I said the fix to this is very simple, only attack is the HP is not equal to 0

Why don't you guys just use closestAttackableNPCForName()....

 

Works fine for me tongue.png

 

Ah alright, wasn't aware of that method.. I should really just read through the whole API lol

  • Administrator

Why don't you guys just use closestAttackableNPCForName()....

 

Works fine for me tongue.png

Because some people like attacking the second closest, etc. so it's more random than attacking the nearest thing (imagine multi-combat zones with people floating towards the same NPCs).

Because some people like attacking the second closest, etc. so it's more random than attacking the nearest thing (imagine multi-combat zones with people floating towards the same NPCs).

Oh, I should have paid more attention to the List word in the methods they were using ohmy.png

public List<NPC> listAttackableNPCsForName(String name) {
	List<NPC> attackableList = null;
	NPC[] localNPCs = new NPC[client.getLocalNPCs().size()];
	for (int i = 0; i < client.getLocalNPCs().size(); i++) {
		if (localNPCs[i].getName().equalsIgnoreCase(name) && localNPCs[i].canAttack())
			attackableList.add(localNPCs[i]);
	}
	return attackableList;
}

Would work fine?

Edited by Swizzbeat

these happens to me all the time hope it's fixed

  • Author
public List<NPC> listAttackableNPCsForName(String name) {
	List<NPC> attackableList = null;
	NPC[] localNPCs = new NPC[client.getLocalNPCs().size()];
	for (int i = 0; i < client.getLocalNPCs().size(); i++) {
		if (localNPCs[i].getName().equalsIgnoreCase(name) && localNPCs[i].canAttack())
			attackableList.add(localNPCs[i]);
	}
	return attackableList;
}

Would work fine?

 

That theoretically would work just fine

 

  • Administrator

Oh, I should have paid more attention to the List word in the methods they were using ohmy.png

public List<NPC> listAttackableNPCsForName(String name) {
	List<NPC> attackableList = null;
	NPC[] localNPCs = new NPC[client.getLocalNPCs().size()];
	for (int i = 0; i < client.getLocalNPCs().size(); i++) {
		if (localNPCs[i].getName().equalsIgnoreCase(name) && localNPCs[i].canAttack())
			attackableList.add(localNPCs[i]);
	}
	return attackableList;
}

Would work fine?

 

Just a note, canAttack() won't work in multi-combat areas. The isAttackable() added in OSBot 2 will work fine though.

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.