Thread: [Ref] Random Login Message [SPOONFED]

Results 1 to 8 of 8
  1. #1 [Ref] Random Login Message [SPOONFED] 
    Banned
    Join Date
    Oct 2011
    Posts
    860
    Thanks given
    371
    Thanks received
    214
    Rep Power
    0
    DISCLAIMER:
    I do NOT give permission to re-release this (or any content provided) or start a new thread with any content in this thread!
    Flame and I will report to a mod, if you flame you agree to the consequences.
    This applies for trolling aswell.
    Also don't say how easy this is, as I don't care it's a contribution.


    This is VERY easy,
    assumed knowledge:
    -Copy paste,
    -editing inside quotes

    Pictures:
    Spoiler for :





    Background information:
    I was reading about random math variables and put this together.

    Step 1:
    Open your client class. (client.java)[unless you have otherwise renamed it, open the renamed version]

    Step 2:
    Press the control and f key on your keyboard
    When the search box pops up paste this in there:
    Code:
    processLoginScreenInput()
    You should see something like this:

    Code:
    private void processLoginScreenInput()
    	{
    		if(loginScreenState == 0)
    		{
    Step 3:
    Search or scroll down in the class until you see something like this:

    Code:
    loginMessage1 = "";
    loginMessage2 = "Enter your username & password.";
    Now replace
    Code:
    loginMessage1 = "";
    With:
    Code:
    loginMessage1 = randomMessage();
    Now you should have:

    Code:
    loginMessage1 = randomMessage();
    loginMessage2 = "Enter your username & password.";
    Now scroll back up untill you see: (should be about 10 - 20 lines)
    Code:
    private void processLoginScreenInput()
    	{
    Step 4:

    above:
    Code:
    private void processLoginScreenInput()
    	{
    put:
    Spoiler for Void:

    public String randomMessage(){
    int maxNumber = 2;
    int randomNumber = (int)Math.floor(Math.random() * maxNumber);
    switch (randomNumber) {
    case 0:
    return "Enjoy the game!";
    case 1:
    return "Remember to vote!";
    case 2:
    return "Only donate to @cr2@@or3@YOUR_NAME@yel@!";

    default: return "Welcome!";
    }
    }



    Spoiler for info:

    What this does is picks and random number, and each message is assigned a number. So every time you click the "Existing User" or "Play Now" button it will choose a message.


    Step 5:
    To make the message your own:
    Find the "Case #" you want to change.
    Below where it says return
    Inside the quotes put your message.

    Make sure the return ALWAYS looks like this
    return "Only donate to @cr2@@or3@Mark@yel@!";
    It must have quotes and a semi-colon.

    Step 6: (optional)
    To add more cases find:
    Code:
    int maxNumber = 2;
    and make that the number of messages you want minus one (There's a zero case)

    So if you want 8 messages make it
    Code:
    int maxNumber = 7;
    Because 8-1=7.
    Make sure your cases have returns and follow everything I said.

    Step 7:
    Load your client and admire your C&P skills.


    Good luck, I know this is easy, but it could be useful for starters.
    Good luck with your servers guys.

    This could be useful for:
    Spoiler for :
    • Getting Votes
    • Getting Donations
    • Making sure people know the rules *
    • Making sure they know your forums
    • Did you know?'s



    Have fun guys!

    ~Paradox_
    Reply With Quote  
     

  2. Thankful users:


  3. #2  
    Trusted MM & RsGp Seller.

    Join Date
    Feb 2012
    Posts
    354
    Thanks given
    98
    Thanks received
    29
    Rep Power
    48
    Thanks mate.
    Reply With Quote  
     

  4. #3  
    Banned
    Join Date
    Oct 2011
    Posts
    860
    Thanks given
    371
    Thanks received
    214
    Rep Power
    0
    Quote Originally Posted by 'Keviin View Post
    Thanks mate.
    Any time, glad you used it, thanks for the feedback.
    Reply With Quote  
     

  5. #4  
    Banned

    Join Date
    Feb 2012
    Age
    27
    Posts
    474
    Thanks given
    20
    Thanks received
    65
    Rep Power
    0
    thanks man! Will use.
    Reply With Quote  
     

  6. #5  
    Banned
    Join Date
    Feb 2012
    Posts
    25
    Thanks given
    0
    Thanks received
    7
    Rep Power
    0
    Nice one, looks good.
    Reply With Quote  
     

  7. #6  
    Registered Member
    Freezia's Avatar
    Join Date
    Feb 2011
    Posts
    6,013
    Thanks given
    1,147
    Thanks received
    758
    Rep Power
    1311
    Looks good man bookmarked!


    Host your RUNESCAPE PRIVATE SERVER on the cheapest and flagship provider on Rune-Server! Now equipped with DDOS Protection!.


    Reply With Quote  
     

  8. #7  
    Banned
    Join Date
    Oct 2011
    Posts
    860
    Thanks given
    371
    Thanks received
    214
    Rep Power
    0
    Quote Originally Posted by Freezia View Post
    Looks good man bookmarked!
    Damn. That means alot. Thanks!
    Reply With Quote  
     

  9. #8  
    Registered Member
    Velocity's Avatar
    Join Date
    Jan 2009
    Age
    28
    Posts
    2,028
    Thanks given
    1,013
    Thanks received
    2,376
    Rep Power
    4112
    Change

    Code:
    public String randomMessage(){
    int maxNumber = 2;
    int randomNumber = (int)Math.floor(Math.random() * maxNumber);
    switch (randomNumber) {
    case 0:
    return "Enjoy the game!";
    case 1:
    return "Remember to vote!";
    case 2: 
    return "Only donate to @cr2@@or3@YOUR_NAME@yel@!";
    
    default: return "Welcome!";
    }
    }
    into

    Code:
    String[] messages = new String[] {"message1", "message2", "notherone", "unlimited ones"};
    
    public String randomMessage(){
    	return messages[(int)(Math.random() * messages.length-1)];
    }
    Other than that, great job.
    xxxxxxx
    Reply With Quote  
     

  10. Thankful users:



Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Replies: 3
    Last Post: 11-29-2011, 02:12 AM
  2. Random Login Message
    By lare96 in forum Snippets
    Replies: 8
    Last Post: 03-19-2011, 09:10 AM
  3. [REF]Fixing Death Emote[REF]
    By MonsterDev in forum Snippets
    Replies: 4
    Last Post: 11-09-2010, 04:28 PM
  4. [galkons ref] T2 error on login
    By rmb7 in forum Help
    Replies: 2
    Last Post: 03-20-2010, 02:54 PM
  5. Replies: 39
    Last Post: 01-05-2010, 02:59 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •