Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
635
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. 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>]]
  2. x = 400
  3. y = 150
  4. joint = {
  5. -- i = posição na string tempo (não mudar)
  6. -- t = tamanho do ponteiro
  7. -- add = ajuste do horário (apenas valores positivos)
  8. -- g = graus por unidade
  9. {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)
  10. {type=0,point1=x..","..y,point2=0,line=5,color=0x324650,foreground=true,i=15,t=40,add=0,g=6},-- minuto
  11. {type=0,point1=x..","..y,point2=0,line=3,color=0xD74701,foreground=true,i=18,t=50,add=0,g=6}-- segundo
  12. }
  13. centro = {type=0,point1=x..","..y,point2=x..","..y+1,line=5,color=0xD74701,foreground=true}
  14. function eventLoop()
  15. local tempo = os.date("%c", os.time()/1000) -- função agora trabalha apenas com segundos
  16. for i, v in pairs(joint) do
  17. v.num = tonumber(tempo:sub(v.i,v.i+1),10)+v.add
  18. 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
  19. tfm.exec.addJoint(i, 0, 0, v)
  20. end
  21. tfm.exec.addJoint(4,0,0,centro)
  22. for i=1, 12 do
  23. 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)
  24. end
  25. tfm.exec.setUIMapName(string.format("<p align='center'>%02d:%02d:%02d</p>\n",joint[1].num%24, joint[2].num, joint[3].num))
  26. end
  27.  
  28. tfm.exec.disableAutoNewGame(true)
  29. tfm.exec.disableAfkDeath(true)
  30. tfm.exec.disableAutoShaman(true)
  31. tfm.exec.newGame(mapa)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement