Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- by Romaen. this code all goes into one script.
- daybox = daybox or {}
- daybox.daynight = daybox.daynight or 0
- daybox.c = Geyser.MiniConsole:new({
- name="daybox",
- x="70%", y="50%",
- autoWrap = true,
- color = "black",
- scrollBar = false,
- fontSize = 8,
- width="30%", height="20%",
- })
- function daybox.write()
- if not gmcp.IRE then return end
- if not gmcp.IRE.Time then return end
- if not gmcp.IRE.Time.Update then return end
- if gmcp.IRE.Time.Update.daynight then daybox.daynight = tonumber(gmcp.IRE.Time.Update.daynight) end
- local bg = ''
- local fg = ''
- local n = 0
- local state = ''
- if daybox.daynight < 100 then
- bg = '<deep_sky_blue>'
- fg = '<yellow>'
- else
- bg = '<medium_blue>'
- fg = '<white>'
- daybox.daynight = daybox.daynight - 100
- end
- local perc = math.floor(daybox.daynight / 4)
- n = 4
- if perc > 22 then n = 26-perc elseif perc < 1 then n = 3 end
- local line1 = bg..string.rep('-', perc-1)..fg..string.rep('@', n)..bg..string.rep('-', 22-perc)..'\n'
- n = 6
- if perc > 21 then n = 27-perc elseif perc == 1 then n = 5 elseif perc < 1 then n = 4 end
- local line2 = bg..string.rep('-', perc-2)..fg..string.rep('@', n)..bg..string.rep('-', 21-perc)..'\n'
- daybox.c:cecho('\n'..bg..string.rep('-', 25)..'\n'..line1..line2..line1..bg..string.rep('-', 25)..'\n')
- end
- if isActive('daybox update', 'trigger') == 0 then
- daybox.trigger = permPromptTrigger("daybox update", "", [[daybox.write()]])
- end
- sendGMCP([[Core.Supports.Add ["IRE.Time 1"] ]])
- tempExactMatchTrigger([[Password correct. Welcome to Achaea.]], [[sendGMCP('Core.Supports.Add ["IRE.Time 1"]') ]], 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement