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.

New scripter says hello to OSBOT ;)

Featured Replies

Tyvm! smile.png

 

 

WHAT PARTY? WHERE? WHEN?

I need to be there.

 

Thanks wink.png

party in my pants

invite only sry

  • Author

Hi welcome and good luck!

Your first script looks promising smile.png

Alright, I briefly checked your script wink.png

First of all when you script it's important to use an IDE such as eclipse or IntelliJ IDEA. Using IntelliJ you can jump to the (decompiled) implementation of an API method, so you can actually see what it does. There's this line in your script: while (bank.isOpen()){ bank.close(); ...  if we check the implementation, bank.close() already checks if the bank is open. I use this very often, perhaps it's useful for you as well to understand what exactly the api methods do.

Arrays.asList(stairs.getDefinition().getActions()).contains("Climb-down") could be simplified into stairs.hasAction("Climb-down")

You could also check out the doorHandler api, it most likely support gates. You specify what position you want to walk to and the doorhandler opens any doors/gates between the player and the target position.

There are a lot of nested if statements tongue.png I remember I did the same thing when I first started scripting. It's very difficult to debug, so you might want to avoid it wink.png

 

Thanks wub.png .

I use Eclipse, so thats okay i assume wink.png.

 

• @ the Close bank if it's still open. Yeah sounds logical actually wink.png. But I'm going to stay at the low level for a while. Going too deep will make me kill myself and quit this wink.png

 

• Yeah I got that from someone... (Thank god for copy-paste). It indeed saw a bit overcomplicated to me, but it does the job. Will change it.

 

• Will look into that the next basic script if it would require it ! Thanks for the tip

 

• Is there a way to make it cleaner? I mean having like 7 If statements to shear a sheep is indeed messy.

 

 

 

Welcome!

Thanks buddy smile.png

party in my pants

invite only sry

 

What beverages are available there ^^?

 

Buying invite 1M OSRS GP.

  • Author

Welcome and goodluck!

 

The godess herself has spoken.

I only got one script of you, and... Damn ;)

 

Thanks!

You could use a filter, some info: http://osbot.org/forum/topic/71713-objectsgetint-int-and-grounditemsgetint-int-not-working/

What you're doing right now is get the closest sheep and then check if it meets a few requirements.

You could do this using a filter like this (not tested):

 

    public boolean Shear() {

        if (myPlayer().isAnimating())
            return true;

        Area SHEEP_PEN = new Area(3193, 3257, 3211, 3276);
        NPC sheep = getNpcs().closest(
                npc -> npc.getName().equals("Sheep") &&
                        SHEEP_PEN.contains(npc) &&
                        npc.hasAction("Shear"));

        return sheep != null && sheep.interact("Shear");
    }

You basically say give me the closest npc which: has the name "Sheep", is located in the SHEEP_PEN area and has an action "Shear". interact should then turn the camera if needed. 

Welcome to OSBot! If you need anyone to test out your scripts, I'll be happy to.

-happy bottting& scripting

  • Author

You could use a filter, some info: http://osbot.org/forum/topic/71713-objectsgetint-int-and-grounditemsgetint-int-not-working/

What you're doing right now is get the closest sheep and then check if it meets a few requirements.

You could do this using a filter like this (not tested):

 

    public boolean Shear() {

        if (myPlayer().isAnimating())
            return true;

        Area SHEEP_PEN = new Area(3193, 3257, 3211, 3276);
        NPC sheep = getNpcs().closest(
                npc -> npc.getName().equals("Sheep") &&
                        SHEEP_PEN.contains(npc) &&
                        npc.hasAction("Shear"));

        return sheep != null && sheep.interact("Shear");
    }

You basically say give me the closest npc which: has the name "Sheep", is located in the SHEEP_PEN area and has an action "Shear". interact should then turn the camera if needed. 

 

 

Thanks for the tip.

But one quick question, why especially is your way better? (You forgot the WHY part of tips ;) )

It looks neater, but would it be faster or something?

Is it better to return a Boolean instead of repeating a void? Or do you mean I should do something with 'Shear = true' in the rest of the code ;)?

 

Welcome to OSBot! If you need anyone to test out your scripts, I'll be happy to.

-happy bottting& scripting

 

Do you know how to turn code => OSBot Script?

I'll PM you my Skype if I'm realeasing some stuff. (First few scripts will be low level focused, so level 3's all the way!)

Welcome and zoals wij nederlanders zeggen; Welkom !

 

This is in Dutch: Zoals we in Brabant zeggen: Ge zijt hier heulemaal Welkom!

  • Author

Welcome and zoals wij nederlanders zeggen; Welkom !

 

 

This is in Dutch: Zoals we in Brabant zeggen: Ge zijt hier heulemaal Welkom!

 

Thanks!

And I'd start talking English from now on in this topic, don't want to have haters or mods hate ;)

Do you know how to turn code => OSBot Script?

I'll PM you my Skype if I'm realeasing some stuff. (First few scripts will be low level focused, so level 3's all the way!)

No I don't know how, but plenty of other people around here do.

Thanks for the tip.

But one quick question, why especially is your way better? (You forgot the WHY part of tips wink.png )

It looks neater, but would it be faster or something?

Is it better to return a Boolean instead of repeating a void? Or do you mean I should do something with 'Shear = true' in the rest of the code wink.png?

 

 

Do you know how to turn code => OSBot Script?

I'll PM you my Skype if I'm realeasing some stuff. (First few scripts will be low level focused, so level 3's all the way!)

Well if it is any faster the speed improvement is negligible. The main advantage is that it's clean, and you can't really do anything wrong in this method as long as your filter is defined correctly (and of course interact works).

In this case it doesn't really matter if you return a void or boolean, just did that because interact returns a boolean ^^

  • Author

Well if it is any faster the speed improvement is negligible. The main advantage is that it's clean, and you can't really do anything wrong in this method as long as your filter is defined correctly (and of course interact works).

In this case it doesn't really matter if you return a void or boolean, just did that because interact returns a boolean ^^

 

It indeed does look neater (but seems more difficult with filters (which i've never used before))!

 

Will try to figure that out ;).

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.