Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • How to Optimize Item Selection for My Bot?


    ToastLover

    Recommended Posts

    The title might sound a bit fuzzy, but that's because I'm struggling to put it into words. Here's the scoop: I'm seeking advice on a bot project. This bot needs to be able to choose the best item from the bank (equipment).

    I'm talking about a lot of items here, and I'm wondering if there's a list or a template that could help with the selection process through the API. I've been hunting through the javadocs, but I've gotta admit, I'm coming out empty-handed. Maybe I'm just a bit tired and not the best at searching.

    It's frustrating because I have this nagging feeling that the solution is probably really simple, but I just can't seem to find it right now. By the way, it seems like writing the whole list manually might be something someone's done before, and there might be widely available resources out there. Any hints or guidance would be much appreciated!

    Thanks a million for taking the time to read this and maybe lending a hand!

    Link to comment
    Share on other sites

    But what determines if an item is best?

    Is it based on stats require to wear it; is it based on the boss and changes depending on your target; is it based on which combat style you use; is it based on how cool it looks?

    There's nothing in the API that determines this for you if that's what you're asking. That's up to you to determine in your code.

    Link to comment
    Share on other sites

    I've experimented with a similar function in the past, and all I could come up with was an enum containing tiers of item (bronze, mithril, rune, etc) and then an enum containing types of equipment (sword, battleaxe, scimitar etc) and ranking these in order (this was for a f2p script). But this probably won't work in members where you have different weapon types (abyssal whip, sarachnis cudgel) that don't belong in a tier.

    Also, as above, how do you determine what the best weapon type is? A whip might be better at certain places, but other places might have a dragon sword as better. Maybe you can hardcode specific weapon types into categories (slash weapons, stab weapons, spec weapons etc) and then depending on what monster you fight select a certain weapon category

    Honestly, it's probably easier to just give the user the ability to input what the best weapon is

    Link to comment
    Share on other sites

    8 hours ago, ToastLover said:

    This bot needs to be able to choose the best item from the bank (equipment).

    if (Bank.open()) {
      Bank.withdraw("Redundant hat", 1);
    }

    here is code to withdraw the redundant hat, it is the best item.

    Link to comment
    Share on other sites

    14 hours ago, MaximusPrimo said:

    But what determines if an item is best?

    Is it based on stats require to wear it; is it based on the boss and changes depending on your target; is it based on which combat style you use; is it based on how cool it looks?

    There's nothing in the API that determines this for you if that's what you're asking. That's up to you to determine in your code.

    Thanks for your response, and I appreciate your insights. You're correct that determining what's 'best' can be quite subjective and depends on various factors. What I'm primarily seeking is working out if there's an existing list of items available in the game, for example just swords, armour etc.

    The reason I'm looking for this list or template is because there's a vast number of items, and it's a bit daunting to manually compile such an extensive inventory though if i can't find it i guess i'll have to do it. While I do understand that determining what's 'best' can be a complex task, having this list would serve as a fundamental building block for my project.

    Link to comment
    Share on other sites

    13 hours ago, Diggington said:

    I've experimented with a similar function in the past, and all I could come up with was an enum containing tiers of item (bronze, mithril, rune, etc) and then an enum containing types of equipment (sword, battleaxe, scimitar etc) and ranking these in order (this was for a f2p script). But this probably won't work in members where you have different weapon types (abyssal whip, sarachnis cudgel) that don't belong in a tier.

    Also, as above, how do you determine what the best weapon type is? A whip might be better at certain places, but other places might have a dragon sword as better. Maybe you can hardcode specific weapon types into categories (slash weapons, stab weapons, spec weapons etc) and then depending on what monster you fight select a certain weapon category

    Honestly, it's probably easier to just give the user the ability to input what the best weapon is

    That's a great point, and I appreciate your insights on this. Your idea of using enums for tiers and equipment types is a structured way to approach this, and also what i was going to do when i couldn't find a specific list for example all swords ingame etc. However, as you rightly mentioned, it becomes more complex in a Members scenario with diverse weapon types.

    You raised a valuable point about determining the "best" weapon type, which can vary depending on the context. I hadn't initially considered allowing user input for the best weapon, and that's an excellent suggestion. It would provide flexibility and allow users to define their criteria for the "best" weapon based on their preferences and specific situations.

    I'll definitely give this user input approach some serious thought. It seems like a practical and user-friendly solution that could be a lot more versatile than trying to define the "best" weapon type universally. Thanks for sharing your experience and insights!

    Link to comment
    Share on other sites

    7 hours ago, camalCase said:
    if (Bank.open()) {
      Bank.withdraw("Redundant hat", 1);
    }

    here is code to withdraw the redundant hat, it is the best item. 

    Ah, the "Redundant hat," the pinnacle of fashion and function! It's saving that hat for a special occasion.

    Link to comment
    Share on other sites

    10 minutes ago, sloppybot said:

    Sorry for off-topic.

    Are you a chatGPT bot asking for scripting advice?

    Humor aside, my general approach in forums and posts is to aim for clarity, even though, as this thread demonstrates, I may not always achieve that.

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.