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.

DefaultModelList > Looting method()

Featured Replies

hi guys, iv got a - DefaultModelList myLoot;

I'm kinda stuck converting this list into a working looting method.

 any help is appreciated.

 

I'd say convert your model to an array by copying contents over while iterating the model, using the enumeration returned by the DefaultListModel#elements method.

 

Then pass that array using getGroundItems().closest(array) to get the closest desired item on the ground; or getGroundItems().filter(array) to get them all.

toArray?

 

toArray doesn't make use of generics, and will always return Object[], so he'd have to convert it regardless to use it with the EntityAPI

 

I'd say convert your model to an array by copying contents over while iterating the model, using the enumeration returned by the DefaultListModel#elements method.

 

Then pass that array using getGroundItems().closest(array) to get the closest desired item on the ground; or getGroundItems().filter(array) to get them all.

toArray doesn't make use of generics, and will always return Object[], so he'd have to convert it regardless to use it with the EntityAPI

 

He could actually use copyInto, which is backed by System.arraycopy. But seeing how DefaultListModel is backed by Vector, it would be wiser to use your own ListModel implementation, allowing you to add this support while potentionally increasing performance.

Edited by fixthissite

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.