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.

useOn()

Featured Replies

Didn't see an interact method between item and entity. Here's an example (can overload to accept String) :

  • Does not check for item 
  • Does not check for entity
  • returns true on interaction between item and entity

 

Spoiler

private boolean useOn(int itemID, Entity e) throws InterruptedException {

        if(getInventory().getItem(itemID).interact("Use"))
        {
            new ConditionalSleep(10000) {
                @Override
                public boolean condition() throws InterruptedException {
                    return getInventory().isItemSelected();
                }
            }.sleep();

            sleep(random.nextInt(500) + 800);

           return e.interact("Use");
        }

        return false;
    }

 

 

 sleep(random.nextInt(500) + 800);

:think:

Don't do this!

 

Also you should check if there is a current item selected and if it is the correct one otherwise click to deselect it.

..

Also use item names over IDs ^^

Edited by OSRSPsycheDelic

  • Author

The purpose of sleep is to avoid instantaneous reaction. Otherwise, explain your reasoning. 

The behavior of the method is to interact, not check.

As mentioned, overloading is doable.

Edited by dreameo

6 minutes ago, dreameo said:

The purpose of sleep is to avoid instantaneous reaction. Otherwise, explain your reasoning. 

The behavior of the method is to interact, not check.

As mentioned, overloading is doable.

If you're aiming for a script on the SDN Alek doesn't support for random numbers/sleeps unless you have a strict math background and have valid reasoning. For private scripts though it's personal preference on your part. :) 

  • Author

I'm not aiming for the SDN, however, it is allowed.

IS NOT ALLOWED:

Quote

-Scripts that randomize sleep whose bounds are 25% within the mean or less than 250ms

Which does not apply

11 hours ago, dreameo said:

The purpose of sleep is to avoid instantaneous reaction. Otherwise, explain your reasoning. 

The behavior of the method is to interact, not check.

As mentioned, overloading is doable.

 

Alek has multiple posts explaining that sleeps such as the one you have included are not a good idea and are possibly worse than not including them at all,

 

Basically you can plot these sleeps and see a trend which pretty much gives away "bot like behavior" if Jagex wanted to look at it.

 

Secondly yes i understand that the method you wrote is to interact however it also makes sense to include simple checks rather than having to include them multiple times in your code before calling this method, after all that is why we use methods to rerun code without having to rewrite it many times :)

 

I'm simply chucking constructive criticism at you try to help!

Edited by OSRSPsycheDelic

  • Author

I understand alek may have posted explaining but, you still haven't given me a valid reason. Saying that its more 'bot like' doesn't prove anything.

 

And yes, I keep behavior strictly to what the method does. Same as the interact method in osbot, you must first check to see if an entity is not null and visible before you interact, it's not the responsibility of the interact method to do that. Simply creating a method to check beforehand is what you're looking for.

 

I never rejected your criticism, i'm asking for clarification. 

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.