1. Before posting any MODs, please contact us at support@portalarium.com to ensure your MOD is acceptable to the Terms of Service and EULA of the game. Portalarium is not responsible for use of MODs and possible adverse effects on your client or computer, and we may take action on accounts using MODs that are deemed illegal. Whether submitted here or elsewhere in the community, use MODs at your own risk!
    Dismiss Notice

Earth time clock

Discussion in 'Lua Discussions' started by CatweazleX, Dec 2, 2019.

  1. CatweazleX

    CatweazleX Avatar

    Messages:
    632
    Likes Received:
    741
    Trophy Points:
    93
    Location:
    Veritas Sanctuary
    Code:
    -- clock by Catweazle Waldschrath
    -- depends on libsota.0.4.6
    
    
    function ShroudOnStart()
    
    ui.onInit(function()
    
        clock = {
            enabled = true,
            label = createLabelWithShadow(5, 0),
            timer = setInterval(10, function()
                setLabelCaption(clock.label, string.style(os.date("%c"), { size=20, color="#c4a000" }))
            end),
        }
        showLabel(clock.label)
          
        ui.command.add("clock", function()
            clock.enabled = not clock.enabled
    
            setTimerEnabled(clock.timer, clock.enabled)
            setLabelVisible(clock.label, clock.enabled)
          
            local msg = createLabel(nil, nil, 200, 120)
            if isTimerEnabled(clock.timer) then
                setLabelCaption(msg, "<size=18><color=white>clock activated</color></size>")
            else
                setLabelCaption(msg, "<size=18><color=white>clock deactivated</color></size>")
            end
            showLabel(msg)
            setTimeout(3, function() removeLabel(msg) end)
        end)
        ui.shortcut.add("pressed", "RightAlt", "C", "clock")
      
    end)
    
    
    
    
    end -- ShroudOnStart
    
    -- implement other ShroudOn... to allow other scripts
    function ShroudOnConsoleInput() end
    function ShroudOnGUI() end
    function ShroudOnUpdate() end
    
    
    depends on libsota and libsota.util. Can be found here


    Shows the date and time in the upper left.
    Can be deactivated/activated with RightAlt + c or bei typing \clock into the chat window

    [​IMG]
    upper/left : clock.lua | upper / center : loctrack.lua | under paperdoll : paperdoll.lua
     
    Last edited: Dec 3, 2019 at 7:18 AM
    Alleine Dragonfyre, FrostII and Anpu like this.
  2. FrostII

    FrostII Avatar

    Messages:
    4,520
    Likes Received:
    9,220
    Trophy Points:
    153
    Gender:
    Male
    Location:
    Pacific Northwest
    How about a pic of it ingame .... ;)
     
  3. CatweazleX

    CatweazleX Avatar

    Messages:
    632
    Likes Received:
    741
    Trophy Points:
    93
    Location:
    Veritas Sanctuary
  4. CatweazleX

    CatweazleX Avatar

    Messages:
    632
    Likes Received:
    741
    Trophy Points:
    93
    Location:
    Veritas Sanctuary
    Updated clock.lua on the cloud drive to show also time in game. (earth time | time played)
    One can also type \info client , \info player, \info scene, \info stat <name or number> or \info xp. (provided by libsota.util)
     
    Anpu likes this.
  5. craftymethod

    craftymethod Avatar

    Messages:
    788
    Likes Received:
    1,509
    Trophy Points:
    93
    errm what time zone? :D
     
  6. CatweazleX

    CatweazleX Avatar

    Messages:
    632
    Likes Received:
    741
    Trophy Points:
    93
    Location:
    Veritas Sanctuary
    Should be local time, including representation according your local settings
     
    Anpu likes this.