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.

Sleeping Crab Detection

Featured Replies

I am creating my own private script for Rock Crabs (may be released after it's perfected, for a price of course). 

 

 

Is there anyway to detect whether or not the crab is aggressive? My first thought would be to walk near the crab and check for combat, and if no they are non aggressive, however there could be the exception that someone else is simply fighting the rock crab. 

 

So here are the questions:

How do I detect the crab when it's not an active NPC?

How do I detect the crab when it's in a fight with ANOTHER player? (or any NPC for that matter)

Is there a way to detect the crab based off of it's model? (not ID, but model)

 

Thank you everyone for your help in my journey to create quality scripts for the community.

It may take awhile to get the hang of it, but when I've got it, I'll be releasing the most human like scripts seen. 

 

-CX

 

Welllll

 

Firstly, we already have 3 rock crabs scripts (lol), but I guess we'll all welcome new competition

 

The way I check in my script is much the same to how a human would check:

  • Walk up to crab
  • Check if there is a rock crab in the nearest 3x3 square around the player which is fresh
  • Attack said crab
  • Check if under attack & rock crab still exists

If no rock crab (NPC) spawns, then refresh :)

ofcourse there would be timers going on throughout. The only problem with this method is sometimes it refreshes when it doesnt need to if the world lags by over 5 seconds or so, but this rarely happens, so it's not too much of a problemo in my script.

 

Apaec

  • Author

Please do not consider my contributions to the community as competition towards other scripters, but rather advancements towards the community.

 

Thank you for your response, however I believe my original question was not necessarily answered; this may have been an error on my part.

 

So the question rephrased would be: How are non-aggressive crabs classified in game? Are they objects or NPCS? Secondly, How do I go about gathering the information that they have changed to be nonaggressive? This way I can relay the information to a new part of the script that will then do what needs to be done in order to re-aggravate the crabs. 

Look up their object ID from the client, then interact with the object ID (Walk here). After this, make the loop attack the spawned NPC

I'm going to assume that with "non-aggressive" you mean "sleeping" and not "not automatically attacking the player". If I'm assuming wrongly then there's no way to find out if a monster is aggressive (in the API at least, that I'm aware of) but crabs in the "awake" state are ALWAYS NPCs. 

 

So the question rephrased would be: How are non-aggressive crabs classified in game? Are they objects or NPCS? 

 

"Sleeping" crabs are classified as Object (I'm pretty sure they are at least).

You can verify yourself with this debugger:

18501d32613167e97f3b3717f7887243.png

 

How do I detect the crab when it's in a fight with ANOTHER player?

NPC crab = //GET AWAKE CRAB HERE.
if (crab.getInteracting() != null) {
if (getInteracting().equals(myPlayer()) {
 // CRAB IS INTERACTING WITH ME
}
else {
// CRAB IS INTERACTING WITH OTHER PLAYER (OR NPC)
}
}

Hope this helped.

 

Edit: like APA  said, not sure if there's room for another RC script on the market tbh :p

Edited by Botre

I'm going to assume that with "non-aggressive" you mean "sleeping" and not "not automatically attacking the player". If I'm assuming wrongly then there's no way to find out if a monster is aggressive (in the API at least, that I'm aware of) but crabs in the "awake" state are ALWAYS NPCs.

"Sleeping" crabs are classified as Object (I'm pretty sure they are at least).

You can verify yourself with this debugger:

18501d32613167e97f3b3717f7887243.png

NPC crab = //GET AWAKE CRAB HERE.if (crab.getInteracting() != null) {if (getInteracting().equals(myPlayer()) { // CRAB IS INTERACTING WITH ME}else {// CRAB IS INTERACTING WITH OTHER PLAYER (OR NPC)}}
Hope this helped.

Edit: like APA said, not sure if there's room for another RC script on the market tbh :p

Make sure you store your instances of getInteracting, and everything else, then operate on those instances. That code can throw an npe.

  • Author

Thank you everyone!

 

Most likely I will code the project to fit my play style and reduce banning on my part, seeing as you all are very opposed to it hitting the market.

 

If I have anymore questions I'll be sure to report back here!

  • Author

At least I'm making an attempt to contribute to the society, instead of mocking those who do such.

 

:) Not to mention learning a valuable coding language in this day...Time well spent!

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.