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.

How to pick up Grounditems?

Featured Replies

How do you pick up grounditems?

 

I did this

 

int feather = 314;
GroundItem Feathers = groundItems.closest(feather);
if(Feathers != null)
Feathers.interact("Take");

 

Doesn't seem to work, what is the right way to do it?

int feather = 314;

This part seems like a waste of time

 

GroundItem Feathers = groundItems.closest(314);
if(Feathers != null){
Feathers.interact("Take");
}

you need these {} after an if statement

Edited by Sentende

 

int feather = 314;

This part seems like a waste of time

 

Not at all, enjoy changing all occurrences of "314" if the ID ever changes. Not only that but it's terrible practice.

 

OP: Check whether your interact statement is being called or not.

GroundItem Feathers = groundItems.closest(314);
if(Feathers != null){
Feathers.interact("Take");
}

you need these {} after an if statement

 

No, but thank you for posting something logical.

Not at all, enjoy changing all occurrences of "314" if the ID ever changes. Not only that but it's terrible practice.

 

OP: Check whether your interact statement is being called or not.

 

the id's change like once every hundred million years

i guess it is good practice though :P

  • Author

Pastebin your code

 

http://pastebin.com/05ppNaAc

 

Edit : I forgot to mention I changed the id to iron ore where I was standing so I can test the script

Edited by Santas

  • Author

http://prntscr.com/4s8hq7

 

i think you show make a void for pickup and wait and call them in your cases

 

Thanks, a lot that works. :)

 

May I also ask why does it work this way and not the other way around?

Thanks, a lot that works. smile.png

 

May I also ask why does it work this way and not the other way around?

when you created the private field feathers

        GroundItem Feathers = groundItems.closest(feather);

the private field was never initialized. It would of been better if you created a local variable and use it.

case PICK_UP:
	GroundItem Feathers = groundItems.closest(feather);
							
	if(Feathers != null)	{
		Feathers.interact("Take");
                wait(100,250);
	}
	break;

since your private field feathers wasn't initialized it was null what why it gave you a NPE

Edited by josedpay

Guest
This topic is now closed to further replies.

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.