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.

Blackjacking

Featured Replies

I'm trying to make a script for blackjacking menaphite thugs. After I create an npc object, I need to do npc.interact("Knock-out"). The problem is that the knock-out can fail. How can I detect when I have successfully knocked out the NPC and when I need to atempt knock-out again?

  • Author

you could try 

 

if(!myPlayer().isUnderAttack)

//kock out

else

//sleep

 

I'll try that. Another thing I was thinking of was checking my player's HP before and after the knockout. How do I get my player's HP with this API? I'm new at OSBot.

Edited by elemt

I'll try that. Another think I was thinking of was checking my players HP before and after the knockout. How do I get my players HP with this API? I'm new at OSBot.

 

it is......

 

 

this.getSkills().getDynamic(Skill.HITPOINTS) < X)

 

X = Hitpoints you wish to set it at

Thank you

 

I would also suggest getting straight into Conditional Sleeps, which is basically sleeping until a condition is true (prevents over sleeping, etc)

new ConditionSleep(2000){ // 2000 is the time out, so it will sleep for a max of 2 seconds
 @Override
 public boolean condition(){
     return !myPlayer().isUnderAttack() && !myPlayer.isAnimating();
 }
}.sleep();




Its a bit longer than a regular sleep, but considered better in terms of antiban in the long run and script efficiency/effectiveness.

Edited by Tom

Lads, you're giving him all the wrong information, he's asking for how he can detect if the NPC is knocked out.

When the thug is knocked out, the height will decrease. Log npc#getHeight() before and after you attempt to knockout,

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.