The time.lua script creates a lightweight user-list entry whose name changes to show the current time. It is useful for hubs that want a visible timezone marker for international communities.
Adjust prefix, postfix, format, interval, and offset before loading the script. Keep the interval reasonable so the hub does not perform unnecessary updates.
Load And Unload Commands
!luaload /PATH/TO/HUB/scripts/time.lua
!luaunload /PATH/TO/HUB/scripts/time.luaScript Code
name = ''
class = 3
description = 'Time Bot: US'
speed = '100'
email = ''
share = '0'
prefix = '!_US_'
postfix = ''
interval = 10
counter = 0
format = "%I:%M:%S%p"
offset = -5
function GetTime()
return os.date(format, os.time() + offset * 60 * 60)
end
function GetName()
time = GetTime()
return prefix..time..postfix
endConfiguration Notes
- offset is the timezone difference from the server time in hours.
- format uses Lua os.date formatting, so %I:%M:%S%p renders a 12-hour time such as 06:30:00PM.
- prefix and postfix let you make the generated user-list name easy to recognize.
- class, speed, email, and share control the bot-like profile shown by the hub.