Thread: Time Stamps in chat

Results 1 to 8 of 8
  1. #1 Time Stamps in chat 


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    22
    Posts
    9,653
    Thanks given
    1,748
    Thanks received
    3,047
    Rep Power
    5000


    Code:
        public static String getTime() {
            Calendar calendar = new GregorianCalendar();
            String meridiem;
            int hour = calendar.get(Calendar.HOUR);
            int minute = calendar.get(Calendar.MINUTE);
            meridiem = calendar.get(Calendar.AM_PM) == 0 ? "AM" : "PM";
            return "[" + hour + ":" + minute + " " + meridiem + "]";
        }
    compare&replace
    Code:
    if ((chatType == 1 || chatType == 2)
                                && (chatType == 1 || publicChatMode == 0 || publicChatMode == 1 && isFriendOrSelf(s1))) {
                            if (chatTypeView == 1 || chatTypeView == 0) {
                                int xPos = 11;
                                if (Configuration.enableTimeStamps) {
                                    newRegularFont.drawBasicString(timeStamp, xPos, yPos + yOffset,
                                            changeChatArea ? 0xFFFFFF : 0, shadow);
                                    xPos += newRegularFont.getTextWidth(timeStamp);
                                }
                                if (playerRights >= 1) {
                                    modIcons[playerRights - 1].drawSprite(xPos, yPos - 12 + yOffset);
                                    xPos += 16;
                                }
                                newRegularFont.drawBasicString(title + s1 + ":", xPos - 3, yPos + yOffset,
                                        changeChatArea ? 0xFFFFFF : 0, shadow);
                                xPos += newRegularFont.getTextWidth(title + s1) + 8;
                                newRegularFont.drawBasicString(" " + chatMessages[k], xPos - 8, yPos + yOffset,
                                        changeChatArea ? 0x7FA9FF : 255, shadow);
                                j++;
                                j77++;
                            }
                        }
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Jan 2011
    Posts
    1,908
    Thanks given
    356
    Thanks received
    323
    Rep Power
    299
    Thanks for this!
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Apr 2014
    Posts
    1,229
    Thanks given
    31
    Thanks received
    391
    Rep Power
    486
    i think galkon had this in his runelimited client
    Eternal Safari
    Reply With Quote  
     

  4. Thankful user:


  5. #4  


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    22
    Posts
    9,653
    Thanks given
    1,748
    Thanks received
    3,047
    Rep Power
    5000
    Quote Originally Posted by Zion View Post
    i think galkon had this in his runelimited client
    I think so, but not where this op post came from though.
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  6. #5  
    Registered Member
    Join Date
    Nov 2016
    Posts
    31
    Thanks given
    2
    Thanks received
    8
    Rep Power
    12
    I think this is ripped straight from Vencillio. Also you need to account for a 0 when the minute is between 0 and 9, inclusive.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #6  
    Registered Member
    Zivik's Avatar
    Join Date
    Oct 2007
    Age
    21
    Posts
    3,771
    Thanks given
    811
    Thanks received
    1,149
    Rep Power
    4018
    Thanks for the share
    Quote Originally Posted by Killapkz View Post
    and I know there is an issue because it's a 317 PI.
    Quote Originally Posted by MyrChivvon View Post
    But I keep failing, and the worse part is that I do not even know why..
    Reply With Quote  
     

  8. #7  
    I need some more coffee

    Jason's Avatar
    Join Date
    Aug 2009
    Age
    23
    Posts
    5,686
    Thanks given
    1,984
    Thanks received
    2,313
    Rep Power
    2679
    Code:
    private final LocalTimeStringConverter converter = new LocalTimeStringConverter(FormatStyle.SHORT);
    
    String getTime() {
        return converter.toString(LocalTime.now());
    }
    Doesn't need to be anything more than that. It would return X:XX AM or X:XX PM because of the parameter FormatStyle.SHORT. None the less, good job.
    Reply With Quote  
     

  9. Thankful user:


  10. #8  
    Respected Member


    Galkon's Avatar
    Join Date
    Nov 2007
    Age
    13
    Posts
    7,520
    Thanks given
    1,741
    Thanks received
    2,783
    Rep Power
    5000
    Ripped straight from old clients lmao
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ][Only registered and activated users can see links. ][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)

Similar Threads

  1. Replies: 6
    Last Post: 04-28-2009, 02:12 PM
  2. Replies: 18
    Last Post: 04-01-2009, 07:17 PM
  3. Changing the (arterisk) * In Chat And others
    By mr smith in forum Tutorials
    Replies: 7
    Last Post: 01-19-2009, 09:56 PM
  4. Replies: 1
    Last Post: 11-01-2008, 10:19 AM
  5. Total Time Online (in minutes)
    By Evil in forum Tutorials
    Replies: 8
    Last Post: 10-26-2008, 02:48 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •