Thread: [WordUtils] Proper usernames in Messages and Frames

Results 1 to 9 of 9
  1. #1 [WordUtils] Proper usernames in Messages and Frames 
    JackFrost
    Guest
    Description: 100% realistic player's usernames in frames or messages. Username starts with UpperCase, and after every space in username it also starts with UpperCase.

    Example:



    Difficulty: 1, have a little brain to find use of this.

    Files/Classes Modified: Player.java, also any, you wan't to include WordUtils.

    Procedure
    Step 1: Ok first of all add this java file into your rs2\util\ . And name it "WordUtils"

    Code:
    /*
     * Copyright 2002-2004 The Apache Software Foundation.
     * 
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     * 
     *      http://www.apache.org/licenses/LICENSE-2.0
     * 
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    package palidino76.rs2.util;
    
    /**
     * <p>Operations on Strings that contain words.</p>
     * 
     * <p>This class tries to handle <code>null</code> input gracefully.
     * An exception will not be thrown for a <code>null</code> input.
     * Each method documents its behaviour in more detail.</p>
     * 
     * @author Apache Jakarta Velocity
     * @author Henri Yandell
     * @author Stephen Colebourne
     * @author <a href="[Only registered and activated users can see links. ]

    Step 2: Lets test it, so open your players\Player.java

    At the top of the file there are other imports, add this:

    Code:
    import palidino76.rs2.util.WordUtils;
    And find your DeathMessages, from now on in case of using"username" use:
    Code:
    WordUtils.capitalizeFully(p.username)
    so the whole line should look like this:

    Code:
                p.frames.sendMessage(p2, WordUtils.capitalizeFully(p.username) + " falls before your might.");
    Effect:



    So you can use this in any frames, like dueling, trading etc...


    Credits: Credits to the Apache for creating, me for finding out...
    Reply With Quote  
     

  2. #2  
    Doctor p - Sweet Shop

    Join Date
    Apr 2007
    Age
    28
    Posts
    6,835
    Thanks given
    150
    Thanks received
    584
    Rep Power
    2595
    lol all those comments in your file, nice job

    Reply With Quote  
     

  3. #3  
     

    Vastiko's Avatar
    Join Date
    Dec 2006
    Posts
    5,700
    Thanks given
    300
    Thanks received
    660
    Discord
    View profile
    Rep Power
    5000
    This is just leeched from my request which zee best answered except you made a new java file with it so its pointless tea bagged.
    Reply With Quote  
     

  4. #4  
    JackFrost
    Guest
    Quote Originally Posted by Vastico View Post
    This is just leeched from my request which zee best answered except you made a new java file with it so its pointless tea bagged.
    1. I dont know anything about your requests.
    2. I take this from:
    [Only registered and activated users can see links. ]
    3. I didnt cut the coments and other functions of WordUtils that someone might find something useful.
    4. How can i leach from apache? lol
    Reply With Quote  
     

  5. #5  
    Doctor p - Sweet Shop

    Join Date
    Apr 2007
    Age
    28
    Posts
    6,835
    Thanks given
    150
    Thanks received
    584
    Rep Power
    2595
    so you just admitted you leeched this? lol

    Reply With Quote  
     

  6. #6  
    Member Market Banned Market Banned

    Zee Best's Avatar
    Join Date
    Feb 2007
    Age
    29
    Posts
    3,036
    Thanks given
    24
    Thanks received
    210
    Rep Power
    1171
    Quote Originally Posted by Vastico View Post
    This is just leeched from my request which zee best answered except you made a new java file with it so its pointless tea bagged.
    He didn't leech it, nothing like mine, i don't see why he had to do all the buffer crap when you could just use a split[] though.


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Aug 2007
    Posts
    2,395
    Thanks given
    2
    Thanks received
    63
    Rep Power
    558
    I think this is way too much code for just capitalizing after a space ?
    Anyways nice job
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #8  
    JackFrost
    Guest
    Quote Originally Posted by Jonas++ View Post
    I think this is way too much code for just capitalizing after a space ?
    Anyways nice job
    6 lines for it, just another apache words functions maybe someone might find useful(nat)
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Aug 2007
    Posts
    2,395
    Thanks given
    2
    Thanks received
    63
    Rep Power
    558
    Quote Originally Posted by Amirasthe View Post
    6 lines for it, just another apache words functions maybe someone might find useful(nat)
    Ye much longer it would'nt be
    but it's ok
    [Only registered and activated users can see links. ]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •