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.

Storing NPC I attack for luring to safespot

Featured Replies

Hi all

I'm writing a script which requires the player to attack an NPC and lure it to a safespot.  Doing so involves my player leaving the safespot to find the monster, attacking it, running to a certain place then running to the safespot.

There are several of this NPC in my general fight area, and I am trying to ensure that once I attack it it becomes my NPC (rather than just a NPC) which I lure and attack.  This is to avoid attacking an NPC, running to my first spot then attempting to fight another one.

Is there a way I can segregate an NPC which I attack, but am then subsequently not fighting (or necessarily being attacked by as I run away) so that my script keeps focus on that NPC? 

Thanks in advance

Chris

4 hours ago, Criboo said:

Hi all

I'm writing a script which requires the player to attack an NPC and lure it to a safespot.  Doing so involves my player leaving the safespot to find the monster, attacking it, running to a certain place then running to the safespot.

There are several of this NPC in my general fight area, and I am trying to ensure that once I attack it it becomes my NPC (rather than just a NPC) which I lure and attack.  This is to avoid attacking an NPC, running to my first spot then attempting to fight another one.

Is there a way I can segregate an NPC which I attack, but am then subsequently not fighting (or necessarily being attacked by as I run away) so that my script keeps focus on that NPC? 

Thanks in advance

Chris


Just store the NPC as a global variable so you can access it later.

When you select your npc just save it in a variable like Explv said then interact with it after you move to the safe spot

 

NPC npcToSafeSpot = getNpcs().closest("NPC NAME");
getWalking().webWalk(SafeSpot);
npcToSafeSpot.interact("Attack");
18 hours ago, billyboy420 said:

When you select your npc just save it in a variable like Explv said then interact with it after you move to the safe spot

 


NPC npcToSafeSpot = getNpcs().closest("NPC NAME");
getWalking().webWalk(SafeSpot);
npcToSafeSpot.interact("Attack");

It would need to be a global variable.

So something like this:

private NPC npc;

npc = getNpcs().closest("NPC");

if (safespot does not contain our player) {
	if (getWalking().webWalk(safespot)
	// sleep until whatever
} else {
	if (npc != null) {
		// attack npc
	}
}

 

Edited by HeyImJamie

23 minutes ago, aftabdear said:

If this is for Callisto gl ?

 

On 6/8/2018 at 2:09 PM, Criboo said:

There are several of this NPC in my general fight area

 

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.