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.

A few questions regarding models

Featured Replies

I have 2 questions regarding models:

  • How do I check which model or object is at the top of where the cursor is? For example, say I have my camera moved in such a way where a seed stall is infront of the master farmer, and I move my mouse to the master farmer and left click. This is going to click the seed stall. How can I detect that the seed stall is the first object there so I can choose to right click?
  • How do I check for visible parts of the model? For example, say 2 models are slightly overlapping (let's use the seed stall and master farmer example once more), and this leaves the master farmer with about half his actual model as actual visible space (to us). The client, however, recognises his entire model as visible. How can I see which bits of the model are actually visible to the client?

Sorry if these do not make sense, I just woke up.

 

EDIT: I am still looking for how to find which objects appear in front of my specified object. pls help <3

Edited by Bobrocket

I have 2 questions regarding models:

  • How do I check which model or object is at the top of where the cursor is? For example, say I have my camera moved in such a way where a seed stall is infront of the master farmer, and I move my mouse to the master farmer and left click. This is going to click the seed stall. How can I detect that the seed stall is the first object there so I can choose to right click?
  • How do I check for visible parts of the model? For example, say 2 models are slightly overlapping (let's use the seed stall and master farmer example once more), and this leaves the master farmer with about half his actual model as actual visible space (to us). The client, however, recognises his entire model as visible. How can I see which bits of the model are actually visible to the client?

Sorry if these do not make sense, I just woke up.

 

1. getMouse().getEntitiesOnCursor().contains(...);

 

Might do the trick, or you could derive it from the action displayed in the top left corner, however I'm not sure whether the API supports that out of the box.

 

2. You could get the 3D bounding boxes of multiple entities' models and obtain a new model(s) by subtracting overlapping ones.

Edited by Botre

  • Author

1. getMouse().getEntitiesOnCursor().contains(...);

 

Might do the trick, or you could derive it from the action displayed in the top left corner, however I'm not sure whether the API supports that out of the box.

 

2. You could get the 3D bounding boxes of multiple entities' models and obtain a new model(s) by subtracting overlapping ones.

 

Thank you. I'll see what I can do about the bounding boxes and edit the first post with a solution for those looking for it.

Also, for the first one, I am looking to see if the Master Farmer is on top of the stack. I know that the mouse will have the entity on the cursor, but I simply need to know if the farmer is on top or not.

 

Also, while I'm asking questions, I seem to have something which is more of a problem with Entity#isVisible(), for some reason, when the entity goes off the game screen but still within the actual applet, it seems to return true. Is there a method that checks if an entity is within the window?

Use client.getToolTip() for the top left messages. In my interaction method I check if the action parameter is in the toolTip, if yes I left click, otherwise I right click. To check if your entity is first on cursor you could maybe use something like: if getMouse().getEntitiesOnCursor()[0].equals(yourEntity).... and so on.

  • Author

Use client.getToolTip() for the top left messages. In my interaction method I check if the action parameter is in the toolTip, if yes I left click, otherwise I right click. To check if your entity is first on cursor you could maybe use something like: if getMouse().getEntitiesOnCursor()[0].equals(yourEntity).... and so on.

 

Would index 0 really be the first object though? Because the items are drawn in a layered fashion, so the first visible object is drawn the last. Maybe I'm overthinking this though :/

 

Also, didn't know about getToolTip(). Thanks!

Play around with it a bit smile.png

public void onPaint(Graphics2D g){
   for(int i = 0; i < mouse.getEntitiesOnCurson().size(); i++){
      g.drawString("Entity number: " +i +" = " +mouse.getEntitiesOnCurson()[i], x, y + (i*15));
   }
}

Edited by blabla123

  • Author

 

Play around with it a bit smile.png

public void onPaint(Graphics2D g){
   for(int i = 0; i < mouse.getEntitiesOnCurson().size(); i++){
      g.drawString("Entity number: " +i +" = " +mouse.getEntitiesOnCurson()[i], x, y + (i*15));
   }
}

 

Yeah will do, just hoped you had the answer tongue.png

 

Edit: was right; higher index = closer to the front of the stack.

Edited by Bobrocket

  • Author

Nah, haven't tried it myself yet. Post here what you'll find out please smile.png

 

I edited my post saying that the higher index = the closer to the front of the stack. Working on the code still for the proper bounding boxes.

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.