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
  • Try asking for help in the chatbox
  • Whats wrong here (im retarded)


    yungnigga123
     Share

    Recommended Posts

    First off, you never want to set your variable names with a capital first letter, especially in this case. (Area)

    Second, getPlayers().all() returns a list of players, not a boolean. You have to check if the list is empty then beep if it isn't.

    Area area = new Area(1, 1, 1, 1);
    
    List<Player> playerList = getPlayers().all(player -> player != null && area.contains(player));
    if(!playerList.isEmpty()) {
    	Toolkit.getDefaultToolkit().beep();
    }

     

    Link to comment
    Share on other sites

    1 minute ago, Milasoft said:

    First off, you never want to set your variable names with a capital first letter, especially in this case. (Area)

    Second, getPlayers().all() returns a list of players, not a boolean. You have to check if the list is empty then beep if it isn't.

    Area area = new Area(1, 1, 1, 1);
    
    List<Player> playerList = getPlayers().all(player -> player != null && area.contains(player));
    if(!playerList.isEmpty()) {
    	Toolkit.getDefaultToolkit().beep();
    }

     

    yes, ty im new to this shit tryna learn helped alot thx

    Link to comment
    Share on other sites

    1 minute ago, Milasoft said:

    No problem :)

    Current situation is that im trying to build artifacts with this code and it says the \ufeff error in the box and ive been trying to google the solution but so far the changing of utf-8 to utf-16 etc isnt working or im doing it wrong. I will try to get an answer to this tho

    Link to comment
    Share on other sites

    49 minutes ago, yungnigga123 said:

    When running in utf-8 after making a new class file https://prnt.sc/l08qtu

    When running in utf-16 after making a new class file https://prnt.sc/l08r2f

    What was the default encoding set to in your preferences? And can you screenshot the class file the errors are in?

    And maybe try typing in the code instead of pasting it in, might be an issue with rich text or something.

    Edited by Milasoft
    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
     Share

    ×
    ×
    • 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.