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.

Strange functionality with Camera rotations & Ground items.

Featured Replies

Hi guys, I am occasionally having strange interactions with getting ground items and camera rotations which I have not been able to pinpoint the reasoning for.

What is happening is that when I go to pick up a stack of items below me occasionally the camera will rotate constantly while trying to pick up and move to a weird spot. The script will then idle for 5/10 seconds and then try banking (will sometimes get the bank option or missclick on the teller). After this idle it will bank the items and find them on the floor afterwards but the wasted time is what is the issue.

 

The snippet of code is as follows:

if (getGroundItems().groundItems.closest("Item name here") != null){
            log("Found some items went to the floor");
            int x = myPlayer().getX();
            int y = myPlayer().getY();
            for (GroundItem g :  getGroundItems().filter(getGroundItems().get(x, y), new NameFilter<>("Item name here"))){
                log("Picking up floor item");
                if (g != null && g.exists()){
                    Long invitemnameamount = getInventory().getAmount("Item name here");
                    g.interact("Take");
                    new ConditionalSleep(10000) {
                        @Override
                        public boolean condition() throws InterruptedException {
                            return getInventory().getAmount("Item name here") == invitemnameamount+1;
                        }
                    }.sleep();
                }

            }
        }

Replaced variables & strings so they do not show item names. You get the idea.

 

Thank you for any help!

Edited by Impensus
Updated

Hmm try changing the filters around so it will be more specific:

NameFilter<GroundItem> nameFilter = new NameFilter<>("item name here");
getGroundItems().filter(a -> a.getX() == x && a.getY() == y && nameFilter.match(a));

As for the time, change the conditional sleep so:

                    int expiredAmount = (int) getInventory().getAmount("Item name here");
                    new ConditionalSleep(10000) {
                        @Override
                        public boolean condition() throws InterruptedException {
                            return ((int) getInventory().getAmount("Item name here")) != expiredAmount;
                        }
                    }.sleep();

This will make it so the sleep depends on if the amount changed at all, instead of if the amount has been added by 1. 

If you want the script to not move the camera you must use InteractionEvent and disable the camera, I will try and find a link somewhere to an osbot thread with help.

Edited by Czar

  • Author
11 minutes ago, Czar said:

Hmm try changing the filters around so it will be more specific:


NameFilter<GroundItem> nameFilter = new NameFilter<>("item name here");
getGroundItems().filter(a -> a.getX() == x && a.getY() == y && nameFilter.match(a));

As for the time, change the conditional sleep so:


                    int expiredAmount = (int) getInventory().getAmount("Item name here");
                    new ConditionalSleep(10000) {
                        @Override
                        public boolean condition() throws InterruptedException {
                            return ((int) getInventory().getAmount("Item name here")) != expiredAmount;
                        }
                    }.sleep();

This will make it so the sleep depends on if the amount changed at all, instead of if the amount has been added by 1. 

If you want the script to not move the camera you must use InteractionEvent and disable the camera, I will try and find a link somewhere to an osbot thread with help.

Okay thank you for your help Czar! I will make these changes now, the link would be useful too! :)

I recently had this problem aswell i fixed it by making a custom InteractionEvent for it

 InteractionEvent take = new InteractionEvent(item, "Take");
                    take.setOperateCamera(false);
                   
                    if (!getInventory().isFull()) 
                        execute(take);
		

 

  • Author
6 minutes ago, zwaffel said:

I recently had this problem aswell i fixed it by making a custom InteractionEvent for it


 InteractionEvent take = new InteractionEvent(item, "Take");
                    take.setOperateCamera(false);
                   
                    if (!getInventory().isFull()) 
                        execute(take);
		

 

Thank you :)

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.