Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mapa = [[<C><P /><Z><S><S lua="0" L="800" o="324650" H="40" X="400" Y="380" T="12" P="0,0,0.3,0.2,0,0,0,0" /></S><D /><O /></Z></C>]]
- x = 400
- y = 150
- joint = {
- -- i = posição na string tempo (não mudar)
- -- t = tamanho do ponteiro
- -- add = ajuste do horário (apenas valores positivos)
- -- g = graus por unidade
- {type=0,point1=x..","..y,point2=0,line=5,color=0x324650,foreground=true,i=12,t=25,add=21,g=30},-- hora (mude o add=21 para ajustar a hora)
- {type=0,point1=x..","..y,point2=0,line=5,color=0x324650,foreground=true,i=15,t=40,add=0,g=6},-- minuto
- {type=0,point1=x..","..y,point2=0,line=3,color=0xD74701,foreground=true,i=18,t=50,add=0,g=6}-- segundo
- }
- centro = {type=0,point1=x..","..y,point2=x..","..y+1,line=5,color=0xD74701,foreground=true}
- function eventLoop()
- local tempo = os.date("%c", os.time()/1000) -- função agora trabalha apenas com segundos
- for i, v in pairs(joint) do
- v.num = tonumber(tempo:sub(v.i,v.i+1),10)+v.add
- v.point2 = math.floor(v.t*math.sin(math.rad(v.num*v.g)))+x .. "," .. math.floor(-v.t*math.cos(math.rad(v.num*v.g)))+y
- tfm.exec.addJoint(i, 0, 0, v)
- end
- tfm.exec.addJoint(4,0,0,centro)
- for i=1, 12 do
- ui.addTextArea(i, "<p align='center'><font color='#324650'><b>"..i, nil, math.floor(60*math.sin(math.rad(i*30)))+x-15, math.floor(-60*math.cos(math.rad(i*30)))+y-10, 30, 20, 0, 0, 0, false)
- end
- tfm.exec.setUIMapName(string.format("<p align='center'>%02d:%02d:%02d</p>\n",joint[1].num%24, joint[2].num, joint[3].num))
- end
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.newGame(mapa)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement