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
  • Issue with org.3b import and other org.1b, org.dreambot.4J ... etc


    Recommended Posts

    Posted

    Short and sweet - when trying to use lambda expressions (i.e. "()->...") there is an indirect reference to org.3b which is not getting recognized so I can't use this syntax...

    Error message: "The type org.3b cannot be resolved. It is indirectly referenced from required type org.dreambot.api.input.MouseJava(16777563)"

    I tried adding screenshots but got -200 error...

    Any advice is greatly appreciated.

    Regards,

    Zg 

    Posted

    Thanks for the quick reply.

    Here's 2 examples from the tutorial woodcutting script. My IDE (VSCode) isn't liking the org.2/3 imports which are in the underlying classes. If I remove the lambda expressions, the code is happy. Note, I tried from a different PC and seeing slightly different results (org.2x now vs org.2b before).

    Example 1 - closest(()->...)

    GameObject bankBooth = GameObjects.closest(b -> b != null && b.getName().equalsIgnoreCase("Bank booth"));

    Error message: The type org.2x cannot be resolved. It is indirectly referenced from required type org.dreambot.api.methods.container.impl.InventoryJava(16777563)

    Example 2 - sleepUntil(()->...)

    case BANKING:
                    Bank.depositAll("Logs");
                    Sleep.sleepUntil(() -> !Inventory.contains("Logs"), 2000);
                    if (!Inventory.contains("Logs")) {
                        Bank.close();
                    }
                    break;

    Error message: The type org.2x cannot be resolved. It is indirectly referenced from required type org.dreambot.api.methods.container.impl.InventoryJava(16777563)

     

    Thanks,

    Zg

    Posted

    You may need to clean your project or re-add the client as the library.

    Is that an IDE warning, or an actual compile error? Do you have the full logs from that?

    Posted

    @Pandemic A compile error. I tried refreshing client.jar, clean workspace, and rebuild. Perhaps I'll try intellij IDE for reference.

     

    I'm not seeing any logs, just a red squiggle and the error message I posted. No "quick fixes..." this time... Let me know if you have any other suggestions.

     

    Thanks,

    Zg

    Posted (edited)

    For banking try fetching the object first, then check if it is null.

    GameObject bankBooth = GameObjects.closest("Bank booth"); // Get's nearest Bank booth GameObject
    if (bankBooth!= null && bankBooth.interact("Bank")) // If it's not null, and interact "Bank" on the object successFul.
      Sleep.sleepUntil(bankBooth::isOpen, 4000); // Sleep until bank booth is open or 4000 ms passed.

    For the second one make sure you have imported the correct "Bank"; see my first line in the code below.

    You should also check if bank was opened before trying to deposit. I took the time to write some more code to deposit all items in the inventory except for an axe if the user is carrying one.

    import org.dreambot.api.methods.container.impl.bank.Bank; // <- This must be imported
    
    
    case BANKING:
                                                                   
        if (Bank.isOpen()) { // Check if bank is Open
        	if (Inventory.contains(item -> item.getName().contains("axe")) // If user has an Axe in inventory
    	        Bank.depositAllExcept(item -> item.getName().contains("axe")); // Deposit everything except axe
            else // If no axe in bag(Is equipped)
                Bank.depositAllItems(); // Deposit all items, includes birds nest, logs, random junk the bot clicked on by mistake etc.
    	Sleep.sleepUntil(() -> Inventory.onlyContains(item -> item.getName().contains("axe")) || Inventory.isEmpty(), 10000);
    	if (Inventory.onlyContains(item -> item.getName().contains("axe")) || Inventory.isEmpty()) { // Check if our condition is met.
    		Bank.close(); // Then close the bank
    	}
      
    	break;

     

    Edited by sloppybot
    • 2 weeks later...
    Posted

    Hi @sloppybot, thanks for your reply

    Here is what I see when I use your first code snippet

    https://ibb.co/YczwBsk

     

    Here is what I see when I use your second code snippet

     https://ibb.co/B3t2DD1

     

    If the links don't work, here's the gist:

    "The type org.3b cannot be resolved. It is indirectly referenced from required type org.dreambot.api.input.MouseJava(16777563)"

     

    Here is what I see when looking in the Mouse class

    https://ibb.co/JdbSNZt

     

    Perhaps I need to use Intellij, I'm just a bit surprised all other methods appear to be working. My scripts are running fine but having issues with sleepUntil(()->...) and closest(x->...) is definitely lowering the quality of my code.

    Thanks again,

    Zg

    Posted
    2 hours ago, Zgxgou said:

    Hi @sloppybot, thanks for your reply

    Here is what I see when I use your first code snippet

    https://ibb.co/YczwBsk

     

    Here is what I see when I use your second code snippet

     https://ibb.co/B3t2DD1

     

    If the links don't work, here's the gist:

    "The type org.3b cannot be resolved. It is indirectly referenced from required type org.dreambot.api.input.MouseJava(16777563)"

     

    Here is what I see when looking in the Mouse class

    https://ibb.co/JdbSNZt

     

    Perhaps I need to use Intellij, I'm just a bit surprised all other methods appear to be working. My scripts are running fine but having issues with sleepUntil(()->...) and closest(x->...) is definitely lowering the quality of my code.

    Thanks again,

    Zg

    If the Dreambot artifact is properly imported you should try cleaning your project cache.

    Eclipse -> project settings -> clean project 

    Posted

    @sloppybot Well - I installed Intellij and the issue is resolved... The org.2w imports are still highlighted, but no issues like in VSCode.

     

    Guess I'm switching to IntelliJ :) 

     

    Thanks everyone for your inputs on this.

    Regards,

    Zg

    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.