Advertisement
Novohp

Cellphone 3.4

Feb 26th, 2017
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.67 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame()
  2. tfm.exec.disableAutoShaman()
  3. mensagem = ""
  4. -- Créditos ao Ninguem, por ter ajudado a fazer isso
  5. function split(str, sep)
  6.   local arg = {}
  7.   for i, v in string.gmatch(str, string.format("[^%s]+", sep or "%s")) do
  8.     table.insert(arg, i)
  9.   end
  10.   return arg
  11. end
  12. -- Whats
  13. function eventPopupAnswer(id, jogador, resposta)
  14.    mensagem = "<br> <V>["..jogador.."]:</V><N> "..resposta..mensagem
  15.    if id == 333333333 then
  16.       ui.addTextArea(1114, mensagem, jogador, 250, 38, 300, 347, 0x242f42, 0x242f62, 0.7, true)
  17.       ui.addPopup(333333333, 2, "Mensagem:", jogador, 255, 280, 290, 284, 0x141414, 0x141414, 0.5, true)
  18.    end
  19. end
  20. -- Evento de chat comando
  21. function eventChatCommand(jogador,comando,p) -- Comando do bate-papo do evento
  22.   local parametro = split(comando)
  23.   -- se o comando foi "np @110182", então parametro recebe {"np", "@110182"}
  24.   if parametro[1] == "np" then -- verifica se o primeiro parâmetro é "np"
  25.     tfm.exec.newGame(parametro[2]) -- inicia um novo mapa usando o segundo parâmetro
  26.    elseif comando == 'opencell' then  -- Abre o cellphone
  27.    ui.addTextArea(0, "", p, 553, 45, 1, 40, 0x0c0c0c, 0x0c0c0c, 1, true)
  28.    ui.addTextArea(1111, "<a href='event:open'><font color='#FF0000'>█\n█", p, 558, 42, 30, 45, 0x0c0c0c, 0x0c0c0c, 0, true)
  29.    ui.addTextArea(1112, "", p, 250, 38, 300, 347, 0x0c0c0c, 0x0c0c0c, 1, true)
  30.    ui.addTextArea(1113, "", p, 255, 43, 290, 10, 0x212121, 0x212121, 1, true)
  31.    ui.addTextArea(1114, "", p, 255, 64, 290, 284, 0x141414, 0x141414, 1, true)
  32.    ui.addTextArea(1115, "", p, 255, 360, 290, 20, 0x212121, 0x212121, 1, true)
  33.    ui.addTextArea(1116, "<a href='event:home'><p align='center'>████", p, 350, 362, 100, 16, 0x2b2b2b, 0x2b2b2b, 1, true)
  34.    ui.addTextArea(1117, "<a href='event:next1'>      ˃", p, 487, 362, 56, 16, 0x2b2b2b, 0x2b2b2b, 1, true)
  35.    ui.addTextArea(1118, "", p, 350, 47, 100, 1, 0x333333, 0x333333, 1, true)
  36.    elseif comando == 'help' then
  37.    ui.addTextArea(20, "<p align='center'><b>Bem-vindo ao CellPhone!</b></p> <font size='14'><b>Minhas funções ainda estão em andamento, mas existe algumas que você pode usar no momento.\n</b></p>\n[•] - !map name - Init error_404", p, 214, 90, 370, 218, 0x242f42, 0x000000, 0.8, true)
  38.    ui.addTextArea(21, "<p align='center'><a href='event:closehelp'>Fechar</a>", p, 212, 328, 364, 24, 0x242f42, 0x000000, 0.8, true)
  39. end
  40. end  
  41. --
  42. function eventTextAreaCallback(t,p,link) -- Evento textarea chamada de volta
  43.    if link == [[off]] then
  44.         eventChatCommand(name,'opencell')
  45.    elseif link == [[open]] then -- Area de Trabalho
  46.    ui.addTextArea(8, "<font size='15'><a href='event:zapbr'><b>H</a>", p, 267, 122, 48, 27, 0x141414, 0x324650, NaN, true)
  47.    ui.addTextArea(9, "<font size='15'><a href='event:play'><b>P</a>", p, 266, 74, 48, 27, 0x141414, 0x324650, NaN, true)
  48.    ui.addTextArea(10, "<font size='15'><a href='event:idlua'><b>I</a>", p, 410, 74, 48, 27, 0x141414, 0x324650, NaN, true)
  49.    ui.addTextArea(11, "<font size='15'><a href='event:modules'><b>M</a>", p, 339, 74, 48, 27, 0x141414, 0x324650, NaN, true)
  50.    ui.addTextArea(12, "<font size='15'><a href='event:helplua'><b>L</a>", p, 482, 74, 48, 27, 0x141414, 0x324650, NaN, true)
  51.    ui.addTextArea(13, "<a href='event:off'><font color='#00FF00'█\n█", p, 553, 39, 4, 40, 0x0c0c0c, 0x0c0c0c, 0, true)
  52.    ui.addTextArea(14, "<a href='event:inforplaystore'>+</a>", p, 295, 79, 12, 16, 0x141414, 0x242f42, 1, true) -- p
  53.    ui.addTextArea(15, "<a href='event:inforzapbr'>+</a>", p, 296, 127, 12, 16, 0x141414, 0x242f42, 1, true) -- h
  54.    ui.addTextArea(16, "<a href='event:informodules'>+</a>", p, 368, 79, 12, 16, 0x141414, 0x242f42, 1, true) -- m
  55.    ui.addTextArea(17, "<a href='event:inforlua'>+</a>", p, 511, 79, 12, 16, 0x141414, 0x242f42, 1, true) -- l
  56.    ui.addTextArea(18, "<a href='event:inforids'>+</a>", p, 439, 79, 12, 16, 0x141414, 0x242f42, 1, true) -- 1
  57.    elseif link == [[next1]] then -- Proxima página de inicio
  58.         ui.addTextArea(1119, "", p, 255, 64, 290, 284, 0x141414, 0x141414, 1, true)
  59.    elseif link == [[home]] then
  60.      for i = 74,75 do
  61.             ui.removeTextArea(i,p)
  62.      end
  63.         ui.removeTextArea(1119)  
  64.  
  65. ------------
  66. -- Área do aplicativo = [[ Zap BR]]
  67. ------------
  68.    elseif link == [[zapbr]] then -- Aplicativo do Cellphone
  69.       ui.addPopup(333333333, 2, "Mensagem:", p, 255, 250, 290, 284, 0x141414, 0x141414, 0.6, true)
  70.    elseif link == [[returnwhat]] then -- Fecha a Aba What
  71.          for i = 41,42 do
  72.             ui.removeTextArea(i,p)
  73.          end        
  74.    elseif link == [[inforzapbr]] then
  75.    ui.addTextArea(45, "<center>Infor Zap BR</center>\nZap Br é um aplicativo de bate papo interativo com outros jogadores da sala.\nNo momento o aplicativo está em manutenção", p, 320, 139, 177, 117, 0x242f32, 0x324650, 0.7, true)
  76.    ui.addTextArea(46, "<a href='event:closeinforzapbr'>Retorne</a>", p, 443, 233, 48, 18, 0x242f32, 0x324650, 0.9, true)
  77.    elseif link == [[closeinforzapbr]] then
  78.    for i = 45,46 do
  79.       ui.removeTextArea(i,p)
  80.       end
  81. ------------
  82. -- Área do aplicativo = [[ Aprendizagem Lua]]
  83. ------------
  84.    elseif link == [[helplua]] then
  85.    ui.addTextArea(81, "", p, 175, 48, 451, 238, 0x242f42, 0x324650, 1, true)
  86.    ui.addTextArea(82, "<font size='15'><a href='event:textarea'>Text Areas</a>", p, 182, 54, 96, 32, 0x242f42, 0x324650, 1, true)
  87.    ui.addTextArea(84, "<font size='15'><a href='event:closehelpmodule'>Fechar</a>", p, 381, 300, 55, 32, 0x242f42, 0x324650, 1, true)
  88.    elseif link == [[textarea]] then
  89.    ui.addTextArea(85, "<center><font size='14'>Text Areas</center>\n\n", p, 175, 48, 451, 238, 0x242f42, 0x324650, 1, true)
  90.    ui.addTextArea(86, "<a href='event:pergunta1'>Como fazer uma textarea que  redireciona a outra.</a>", p, 184, 80, 347, 24, 0x242f42, 0x000000, 1, true)
  91.    ui.addTextArea(87, "<a href='event:pergunta2'>Para que serve o eventTextAreaCallback.</a>", p, 184, 122, 346, 23, 0x242f42, 0x000000, 1, true)
  92.    ui.addTextArea(89, "<font size='14'><center><a href='event:closeText'>Fechar</a>", p, 230, 302, 345, 23, 0x242f42, 0x000000, 1, true)
  93.    for i = 81,84 do
  94.       ui.removeTextArea(i,p)
  95.    end
  96.    elseif link == [[inforlua]] then
  97.    ui.addTextArea(90, "<center>Infor Lua</center>\nLua é um aplicativo feito para a aprendizagem de algumas \"configurações\" da linguagem Lua do Transformice. \n\nEstado: EM MANUTENÇÃO", p, 360, 145, 283, 156, 0x242f32, 0x324650, 0.5, true)
  98.    ui.addTextArea(91, "<a href='event:closeinforlua'>Retorne</a>", p, 587, 279, 48, 18, 0x242f32, 0x324650, 0.9, true)
  99.    elseif link == [[closeinforlua]] then -- Fecha a aba de ajuda Module
  100.    for i = 90,91 do
  101.          ui.removeTextArea(i,p)
  102.       end
  103.    elseif link == [[closehelpmodule]] then -- Fecha a aba de ajuda Module
  104.    for i = 81,89 do
  105.          ui.removeTextArea(i,p)
  106.       end
  107.    elseif link == [[pergunta1]] then
  108.    ui.addTextArea(100, "<center><font size='14'>Como fazer uma textarea que  redireciona a outra.</center>\n\n<font size='12'>Existem dois tipos de Text Área. As que lhe redirecionam a outra(s), e as que não lhe redirecionam, que podem servir como uma aba de ajuda, um exemplo pode ser um menu.  Podemos colocar uma text Área nominada \"Menu\", e dar um evento.\n<font size='11'>Ex.: <.a>href='event: Aqui você coloca o nome do evento'> Menu<./a> \n<font size='12'>E quando o evento for chamado \"eventTextAreaCallback\", que significa liga de volta o evento de Text Área, mais ou menos isso.\n\nou seja quando o evento for chamado ele fará o que for denominado por você.\nfunction eventTextAreaCallback(t,p,link)\n    if link == [[menu]] then\n-- Aqui você colcoa a ação que acontecerá quando o evento for chamado.\nend", p, 101, 63, 597, 274, 0x242f42, 0x324650, 1, true)
  109.    ui.addTextArea(101, "<font size='14'><center><a href='event:closepergunta1'>Fechar</a>", p, 233, 357, 345, 23, 0x242f42, 0x000000, 1, true)
  110.    for i = 85,89 do
  111.       ui.removeTextArea(i,p)
  112.    end
  113.    elseif link == [[closepergunta1]] then
  114.    for i = 100,101 do
  115.       ui.removeTextArea(i,p)
  116.       end
  117.    elseif link == [[closeText]] then -- Fecha a aba de perguntas Lua
  118.       for i = 85,89 do
  119.          ui.removeTextArea(i,p)
  120.       end
  121. ------------
  122. -- Área do aplicativo = [[ Lista Modules]]
  123. ------------
  124.    elseif link == [[modules]] then -- Aba Modules
  125.    ui.addTextArea(26, "<font size='15'><p align='center'>Modules</p>\n", p, 231, 31, 334, 336, 0x242f42, 0x242f42, NaN, true)
  126.    ui.addTextArea(27, "#divinity \n#playground \n#football \n#ffarace \n#pewpew \n#elimination \n#campal \n#infected \n#domination\n#traitor \n#prophunt \n#circuit \n#deathmatch \n#powerup \n#basketball ", p, 407, 84, 146, 265, 0x242f42, 0x565757, NaN, true)
  127.    ui.addTextArea(28, "#derby \n#pictionary \n#cheesehunter \n#retro \n#planks \n#sketch \n#crowdsurf \n#hidenseek \n#feather \n#deploy \n#fight \n#transform \n#ratapult \n#spiritual \n#virus \n\n", p, 243, 84, 147, 265, 0x242f42, 0x565757, NaN, true)
  128.    ui.addTextArea(29, "<a href='event:closemodule'><b>X</a>", p, 544, 37, 15, 21, 0x242c42, 0x324650, NaN, true)
  129.    elseif link == [[closemodule]] then -- Podeda loja
  130.              for i = 26,29 do
  131.                     ui.removeTextArea(i,p)
  132.                 end
  133.    elseif link == [[informodules]] then
  134.    ui.addTextArea(90, "<center>Infor Modules</center>\nModules é um aplicativo simples que penas informa os nomes de alguns modules oficiais entre outras coisas\n\nEstado: EM MANUTENÇÃO", p, 372, 98, 231, 143, 0x242f32, 0x324650, 0.5, true)
  135.    ui.addTextArea(91, "<a href='event:closeinformodules'>Retorne</a>", p, 548, 216, 48, 18, 0x242f32, 0x324650, 0.9, true)
  136.    elseif link == [[closeinformodules]] then
  137.          for i = 90,91 do
  138.             ui.removeTextArea(i,p)
  139.          end
  140. ------------
  141. -- Área do aplicativo = [[ Play Store]]
  142. ------------
  143.    elseif link == [[play]] then -- Loja
  144.    ui.addTextArea(30, "<font size='15'><b><p align='center'>Loja</p>\n", p, 143, 79, 513, 241, 0x242f42, 0x000000, NaN, true)
  145.    ui.addTextArea(31, "<font size='15'><b><p align='center'>Meep!</p>", p, 155, 122, 111, 115, 0x242f42, 0x000000, NaN, true)
  146.    ui.addTextArea(32, "<p align='center'><a href='event:meep'><b><font size='10'>Buy</a>", p, 155, 251, 111, 17, 0x242f42, 0x000000, NaN, true)
  147.    ui.addTextArea(33, "<font size='15'><b><p align='center'>Cheese!</p>", p, 283, 123, 111, 116, 0x242f42, 0x000000, NaN, true)
  148.    ui.addTextArea(34, "<p align='center'><a href='event:cheese'><b><font size='10'>Buy</a>", p, 285, 253, 110, 17, 0x242f42, 0x000000, NaN, true)
  149.    ui.addTextArea(35, "<a href='event:return'><p align='center'><b>Return</p></a>", p, 545, 291, 99, 22, 0x242f42, 0x000000, NaN, true)
  150.    elseif link == [[return]] then -- Fecha loja
  151.                 for i = 30,35 do
  152.                     ui.removeTextArea(i,p)
  153.                 end
  154.    elseif link == [[inforplaystore]] then
  155.    ui.addTextArea(411, "<center>Infor Play Store</center>\nPlay Store é um aplicativo feito para a diversão dos jogadores, feito para que os próprios possam comprar poderes entre muitas outras coisas que estamos adicionando.  \n\nEstado: EM MANUTENÇÃO", p, 312, 96, 231, 144, 0x242f32, 0x324650, 0.5, true)
  156.    ui.addTextArea(412, "<a href='event:closeinforplaystore'>Retorne</a>", p, 487, 214, 48, 18, 0x242f32, 0x324650, 0.9, true)
  157.    elseif link == [[closeinforplaystore]] then
  158.    for i = 411,412 do
  159.                     ui.removeTextArea(i,p)
  160.                 end
  161.    elseif link == [[closeshelp]] then -- Fecha a aba de modules
  162.              for i = 20,21 do
  163.                     ui.removeTextArea(i,p)
  164.                 end
  165. ------------
  166. -- Área do aplicativo = [[ ID´s Lua]]
  167. ------------
  168.    elseif link == [[returnid]] then
  169.                 for i = 36,40 do
  170.                     ui.removeTextArea(i,p)
  171.                 end
  172.    elseif link == [[particleid]] then -- ID´s Lua
  173.             ui.addTextArea(14, "<font size='15'><p align='center'><b>Particle ID´s</p><br><p align='left'>This section contains a list of particles and their associated IDs, for use in tfm.exec.displayParticle.<br><br><br><br>", name, 146.5, 78, 507, 288, 0x565757)
  174.             ui.addTextArea(15, "0 - White Glitter<br>1 - Purple Glitter<br>2 - Orange Glitter<br>3 - Spawn Dust<br>4 - Soft White Glitter<br>5 - Hearts<br>6 - Bubbles<br>7 - Bubbles<br>8 - Bubbles<br>9 - Teal Glitter<br>10 - Spirit", name, 160.85, 149.65, 120, 205, 0x565757)
  175.             ui.addTextArea(16, "11 - Yellow Glitter<br>12 - Super Spirit<br>13 - Red Glitter<br>14 - Water Bubbles<br>15 - Plus 1<br>16 - Plus 10<br>17 - Plus 12<br>18 - Plus 14<br>19 - Plus 16<br>20 - Meep Sign", name, 297.9, 149.85, 120, 205, 0x565757)
  176.             ui.addTextArea(17, "21 - Red Confetti<br>22 - Green Confetti<br>23 - Blue Confetti<br>24 - Yellow Confetti<br>25 - Rain<br>26 - Wind<br>27 - Wind<br>28 - Lightning<br>29 - Yellow Stars<br>30 - Small Red Hearts<br>31 - Small Pink Hearts<br>32 - Flowers<br>33 - Bell<br>34 - Water Drops", p, 436, 149.55, 120, 205, 0x565757)
  177.    elseif link == [[emoteid]] then -- ID´s Lua
  178.             ui.addTextArea(23, "<font size='15'><p align='center'>Emote ID´s</p></font><br>This is a list of emotes and their corresponding enums. Bare in mind that the tfm.enum.emote table has a list of all emote names and enums.<br>", name, 136.5, 56, 527, 288, 0x565757)
  179.             ui.addTextArea(24, "0 - Dance<br>1 - Laugh<br>2 - Cry<br>3 - Kiss<br>4 - Rage<br>5 - Clap<br>6 - Sleep<br>7 - Facepaw<br>8 - Sit<br>9 - Confetti<br>10 - Flag Waving", name, 144.7, 167.7, 140, 169, 0x565757, 0x565757)
  180.    elseif link == [[shamanid]] then -- ID´s Lua
  181.             ui.addTextArea(18, "<font size='15'><p align='center'><b>Shaman Object IDs</p><br><p align='left'>While tfm.enum.shamanObject is an easy-to-access list of most shaman objects, it doesn't list every object available in Transformice. Here is a list of all shaman objects that can be spawned in with tfm.exec.addShamanObject.<br><br>Note that some of them can't be spawned properly in modules, so are crossed out.", name, 136.5, 56, 527, 288, 0x565757)
  182.             ui.addTextArea(19, "<font size='10'>0 - Arrow<br>1 - Small Box<br>2 - Large Box<br>3 - Small Plank<br>4 - Large Plank<br>5 - Heavy Ball<br>6 - Ball<br>7 - Trampoline<br>8 - Small Rough Plank<br>9 - Large Rough Plank<br>10 - Anvil<br>11 - Red Anchor<br>12 - Red Anchor Rotating Clockwise<br>13 - Red Anchor Rotating Counter-Clockwise", name, 144.7, 167.7, 140, 169, 0x565757, 0x565757)
  183.             ui.addTextArea(20, "<font size='10'><br>14 - Green Anchor<br>15 - Green Anchor Rotating Clockwise<br>16 - Green Anchor Rotating Counter-Clockwise<br>17 - Cannon (Up)<br>18 - Cannon (Down)<br>19 - Cannon (Right)<br>20 - Cannon (Left)<br>21 - Sticky Ball<br>22 - Yellow Anchor<br>23 - Bomb<br>24 - Spirit<br>", name, 498.7, 165.2, 153, 167, 0x565757, 0x565757)
  184.             ui.addTextArea(21, "25 - Fake Cheese<br>26 - Blue Portal<br>27 - Orange Portal<br>28 - Balloon<br>29 - Static Red Balloon<br>30 - Static Green Balloon<br>31 - Static Yellow Balloon<br>32 - Rune<br>33 - Chicken<br>34 - Snowball<br>35 - Valentine's Arrow<br>", p, 300.65, 166, 176, 170, 0x565757, 0x565757)
  185.             ui.addTextArea(22, "»", p, 625.75, 64.05, 22, 22, 0x565757, 0x565757)
  186.             elseif link == [[cheese]] then
  187.             if tfm.get.room.playerList[p].score > 300 then
  188.             tfm.exec.setPlayerScore(p, -300, true)
  189.             tfm.exec.giveCheese(p)
  190.         end
  191.     end
  192. end
  193. function eventNewGame()
  194.     for name in pairs(tfm.get.room.playerList) do
  195.         eventChatCommand(name,'opencell')
  196.     end
  197. end
  198. -- Neve
  199.        if k == 32 and tfm.get.room.playerList[p].isFacingRight == true and info[p].time < os.time()-1500 then
  200.             info[p].time = os.time()
  201.             tfm.exec.movePlayer(p,0,0,true,100,0,false)
  202.         elseif k == 32 and tfm.get.room.playerList[p].isFacingRight == false and info[p].time < os.time()-1500 then
  203.             info[p].time = os.time()
  204.             tfm.exec.movePlayer(p,0,0,true,-100,0,false)
  205.         end
  206.  local facingLeft = {}
  207.  
  208. for name in pairs(tfm.get.room.playerList) do
  209. for _,key in pairs{0,2,3} do system.bindKeyboard(name, key, true) end
  210. end
  211.  
  212. function eventKeyboard(name, key, down, x, y)
  213.     if key == 0 or key == 2 then
  214.     facingLeft[name] = key == 0
  215.         elseif key == 3 then
  216.             if facingLeft[name] then
  217.                 tfm.exec.addShamanObject(34, x - 8, y - 5, 0, -20)
  218.                 else
  219.                 tfm.exec.addShamanObject(34, x + 8, y - 5, 0, 20)
  220.             end
  221.         end
  222. end
  223. tfm.exec.newGame(0)
  224. tfm.exec.setUIMapName("<VI>Cell<ROSE>Phone")
  225.  
  226. -- Obrigado/Crédito ao Contistente que me ajudou com o reparo de alguns bugs.
  227. -- Obrigado/Crédito ao Ninguem que me ajudou com o script que permite que o jogador rode o mapa de sua escolha.
  228. -- Obrigado/Crédito ao Vitordiaspas que me ajudou com algumas sugestões.
  229. -- *Passei e Rabisquei* Design do cell e alinhamento de algumas coisas By: Nettoork
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement