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.

Passing inventory.getItems() into my gui class

Featured Replies

I created a gui class for my script. The only problem is I have a button in the gui that uses an action listener class that when pressed calls inventory.getItems() .. but it tells me that inventory is not a defined variable.. how would I pass the items[] into the gui when my button is called... yes i know it is not supposed to say sout, it is used for a debug in the main .. yes i  will change it to log later

4yAuIIr.png

Edited by javant

MyGUI g = new MyGUI(Script script);

 

put script as one of the parameters...

 

then just call script.inventory.getItems()

GetInventory().

Edited by VAG

  • Author

GetInventory().

method is undefined

MyGUI g = new MyGUI(Script script);

 

put script as one of the parameters...

 

then just call script.inventory.getItems()

 

script.getInventory().getItems() worked will that complete the same task.? Thank you soo much!

 

script.getInventory().getItems() worked will that complete the same task.? Thank you soo much!

 

yes.

GetInventory().

 

It has no way of relating to the jar build path so this wouldn't work either

without proper implementation

You have to pass the script object to if you want to acces it's methods, since we are not using a static API here.

The only reason you don't have to do that in the main class is because you extended your mainclass with the Script object.

 

Khaleesi

 

Just do this in main class:

GUI gui = new GUI(this);
gui.setVisible(true);

At GUI:

script.inventory.getItem("APA's mom <3");

Enjoy!

Edited by Khaleesi

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.