Time in Server Announement

Discussion in 'Server and Client Scripting' started by Tanner, Sep 14, 2014.

  1. Tanner

    Tanner Born a Champion

    Joined:
    Sep 14, 2014
    Messages:
    4
    Likes Received:
    0
    PO Trainer Name:
    Tanner'
    While exploring servers a while ago I came across some announcements that had live time inside them. Like the clock was literally ticking. How do I do this?
     
  2. Crystal Moogle

    Crystal Moogle Ayaya~ Administrator Administrator

    Joined:
    Jul 19, 2010
    Messages:
    3,205
    Likes Received:
    531
    PO Trainer Name:
    Hanako
    You'd use the step() event to update the announcement every second.
    Code (JAVASCRIPT):
    1.  
    2. step : function() {
    3.     sys.changeAnnouncement(html)
    4. }
    5.  
    You can use the Date object to get the current time and create html based on it to put it in the above.
     
  3. Tanner

    Tanner Born a Champion

    Joined:
    Sep 14, 2014
    Messages:
    4
    Likes Received:
    0
    PO Trainer Name:
    Tanner'
    I'd add that into the server scripts, correct?