Skip 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.

Interact doesn't work as expected?

Featured Replies

Hello, I'm still very new to OSBot coding, and I don't understand why my doing (inventory.interact("Use", "Tinderbox", "Logs")) only selects either logs or tinderbox, whichever comes first. Could someone explain?

 

EDIT: Okay so I found a workaround, although I would still like original question answered. Also, now I'm having problems with what it returns. For some reason this doesn't seem to return false, so my player wont move. I decided I would just paste this snippet. I realize it's not made the best way it can be right now, so if you guys have any suggestions, feel free to add them.

while(script.inventory.contains("Logs")) 
        {
            if(!script.myPlayer().isAnimating())
            {
                script.inventory.interact("Use", "Tinderbox");
                if(!script.inventory.interact("Use", "Logs"))
                {
                    if(!script.walking.walk(new Position(script.myPlayer().getX()+1, script.myPlayer().getY(),
                            script.myPlayer().getZ())))
                    {
                        if(!script.walking.walk(new Position(script.myPlayer().getX()-1, script.myPlayer().getY(),
                                script.myPlayer().getZ())))
                        {
                            if(!script.walking.walk(new Position(script.myPlayer().getX(), 
                                    script.myPlayer().getY()+1, script.myPlayer().getZ())))
                            {
                                script.walking.walk(new Position(script.myPlayer().getX(), 
                                        script.myPlayer().getY()-1, script.myPlayer().getZ()));
                            }
                        }
                    }
                }
            }
            MethodProvider.sleep(MethodProvider.random(300, 400));

Edited by jakealaka9

There's no method for interact (item1, action, item2).
https://osbot.org/api/org/osbot/rs07/api/util/ItemContainer.html#interact-int-java.lang.String...-

You should look into conditional sleeps. Use them between selecting the item and interacting, then sleeping until the action is done or no action is done for a set amount of time. I'm gonna go on a limb here and imagine you're working on a firemaking script. You should check for pre-existing fires in your current spot as well as the spot behind you, before even attempting to interact. Also, you'll need to make sure that you can actually walk to the tile.

  • Author

Thank you, I have resolved my problems with some more workarounds and cleaned up my if statements. I don't know how to resolve a topic, I would if I knew how to.

  • Juggles locked this topic
Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.