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.

Need help keeping bot in specified area

Featured Replies

Hello everybody, I recently decided to begin botting once more and thought it would be interesting to make some basic scripts. I am currently working on a looting script that will pick up items near varrock west bank and bank them. The issue is some items are found inside the G.E. walls and the bot will run inside and loot them then return to it's designated location. Is their anyway to prevent the bot from travelling outside of it's designated area entirely rather than running outside and returning?

yea, just use a filter when doing closest and return ground items pos is within x area

I don't really how to use filters, but I'd try something else before using/learning about filters

Something like

if(IsInLootingArea()){

loot;

}

else{

walkToLootingArea;

}

IsInLootingArea() is a boolean method that returns if your player is in the looting area. If true, it'll loot. Else, it'll walk there.

Would be something like this:

private boolean isInLootingArea(){
 return lootingArea.contains(myPosition());
}

Then you can add conditional sleeps and much more to make it a more complete script.

I'm kinda new to scripting, but if you're looking for help hit me up @ PM, I'll gladly help you with what I can

 

Edited by Ragboys is back

  • Author
1 hour ago, Ragboys is back said:

I don't really how to use filters, but I'd try something else before using/learning about filters

Something like


if(IsInLootingArea()){

loot;

}

else{

walkToLootingArea;

}

IsInLootingArea() is a boolean method that returns if your player is in the looting area. If true, it'll loot. Else, it'll walk there.

Would be something like this:


private boolean isInLootingArea(){
 return lootingArea.contains(myPosition());
}

Then you can add conditional sleeps and much more to make it a more complete script.

I'm kinda new to scripting, but if you're looking for help hit me up @ PM, I'll gladly help you with what I can

 

 

 

Caught me a little late, as I had already learned how to use a basic filter. It's actually pretty simple and you should definitely learn their functionality.

 

I shoved this into my onloop after defining my designated area:

 

Filter<GroundItem> LocationFilter = new Filter<GroundItem>()
{

    @Override
    public boolean match(GroundItem GroundItem)
    {
        return myArea.contains(GroundItem) ;
    }
};

I then ran this in my code 

GroundItem Loot = getGroundItems().closest(LocationFilter);

This ended up picking up all loot in the designated area which I will then have to include/exclude certain items at a later time.

Edited by AdhesiveBandage

Could you not just do:

 

getGroundItems().closest(f -> f != null && myArea.contains(f));

 

and obviously any other filters you wanted to apply?

Wow you guys are making this harder than it is.....

literally just do

GroundItem items = getGroundItems.().closest(AREA, "item names");

 

only takes one line to only loot in a specific area

  • Author
8 hours ago, Bankah said:

Could you not just do:

 

getGroundItems().closest(f -> f != null && myArea.contains(f));

 

and obviously any other filters you wanted to apply?

 

1 hour ago, Juggles said:

Wow you guys are making this harder than it is.....

literally just do

GroundItem items = getGroundItems.().closest(AREA, "item names");

 

only takes one line to only loot in a specific area

Welp, future knowledge I guess. Thanks for the help.

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.