Advertisement
Novohp

Cellphone 2.0

Feb 8th, 2017
441
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.23 KB | None | 0 0
  1.  
  2. tfm.exec.disableAutoNewGame()
  3. tfm.exec.disableAutoShaman()
  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. -- Evento de chat comando
  13. function eventChatCommand(jogador,comando,p) -- Comando do bate-papo do evento
  14.   local parametro = split(comando)
  15.   -- se o comando foi "np @110182", então parametro recebe {"np", "@110182"}
  16.   if parametro[1] == "np" then -- verifica se o primeiro parâmetro é "np"
  17.     tfm.exec.newGame(parametro[2]) -- inicia um novo mapa usando o segundo parâmetro
  18.  elseif comando == 'opencell' then  -- Abre o cellphone
  19.    ui.addTextArea(1, "", p, 258, 32, 284, 332, 0x242f42, 0x324650, 1, true)
  20.    ui.addTextArea(2, "", p, 258, 323, 284, 44, 0x242f42, 0x324650, 0.9, true)
  21.    ui.addTextArea(3, "<p align='center'><a href='event:open'>Off</a></p>", p, 270, 332, 44, 24, 0x324650, 0x242f42, 1, true)
  22.    ui.addTextArea(4, "<a href='event:home'>Home</a>", p, 377, 334, 41, 23, 0x324650, 0x242f42, 1, true)
  23.     elseif comando == 'help' then
  24.    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)
  25.    ui.addTextArea(21, "<p align='center'><a href='event:closehelp'>Fechar</a>", p, 212, 328, 364, 24, 0x242f42, 0x000000, 0.8, true)
  26. end
  27. end  
  28. --
  29. function eventTextAreaCallback(t,p,link) -- Evento textarea chamada de volta
  30.     if link == [[off]] then
  31.         eventChatCommand(name,'opencell')
  32.     elseif link == [[open]] then -- Area de Trabalho
  33.    ui.addTextArea(8, "<font size='15'><a href='event:zapbr'><b>H</a>", p, 267, 122, 41, 26, 0x242f42, 0x324650, NaN, true)
  34.    ui.addTextArea(9, "<font size='15'><a href='event:play'><b>P</a>", p, 266, 74, 40, 25, 0x242f42, 0x324650, NaN, true)
  35.    ui.addTextArea(10, "<font size='15'><a href='event:idlua'><b>I</a>", p, 392, 74, 40, 25, 0x242f42, 0x324650, NaN, true)
  36.    ui.addTextArea(11, "<a href='event:next1'><b>»", p, 522, 286, 12, 19, 0x242f42, 0x7f7f7f, NaN, true)
  37.    ui.addTextArea(12, "<font size='15'><a href='event:modules'><b>M</a>", p, 329, 74, 41, 26, 0x242f42, 0x324650, NaN, true)
  38.    ui.addTextArea(13, "<font size='15'><a href='event:helplua'><b>L</a>", p, 331, 122, 40, 25, 0x242f42, 0x324650, NaN, true)
  39.    ui.addTextArea(14, "<p align='center'><a href='event:off'>On</a></p>", p, 270, 332, 44, 24, 0x324650, 0x242f42, 1, true)
  40.    ui.addTextArea(15, "<a href='event:inforplaystore'>+</a>", p, 293, 80, 11, 16, 0x242f42, 0x242f42, 1, true)
  41.    ui.addTextArea(16, "", p, 263, 38, 276, 17, 0x242f42, 0x324650, 1, true)
  42.    ui.addTextArea(17, "<a href='event:inforzapbr'>+</a>", p, 293, 128, 10, 16, 0x242f42, 0x242f42, 1, true)
  43.    ui.addTextArea(18, "<a href='event:informodules'>+</a>", p, 355, 83, 11, 16, 0x242f42, 0x242f42, 1, true)
  44.    ui.addTextArea(19, "<a href='event:inforlua'>+</a>", p, 356, 128, 8, 15, 0x242f42, 0x242f42, 1, true)
  45.    ui.addTextArea(20, "<a href='event:inforids'>+</a>", p, 416, 79, 10, 19, 0x242f42, 0x242f42, 1, true)
  46.    elseif link == [[next1]] then -- Proxima página de inicio
  47.    ui.addTextArea(74, "", p, 258, 33, 284, 279, 0x242f42, 0x324650, 1, true)
  48.    elseif link == [[home]] then
  49.      for i = 74,75 do
  50.             ui.removeTextArea(i,p)
  51.          end  
  52. ------------
  53. -- Área do aplicativo = [[ Zap BR]]
  54. ------------
  55.    elseif link == [[zapbr]] then -- Aplicativo do Cellphone
  56.    ui.addTextArea(41, "<p align='center'><b>Bem-vindo ao What´s Mice BR</b></p>\n\n<b>Eu sou o seu celular de ajuda, se necessitar de ajuda basta usar um dos meus aplicativos para tal, ou use uma dos meus chats comandos.  \nPara saber mais digite !help", p, 193, 71, 413, 257, 0x242f42, 0x324650, 0.5, true)
  57.    ui.addTextArea(42, "<a href='event:returnwhat'><p align='center'>Return</p>", p, 524, 304, 76, 18, 0x242f42, 0x324650, 1, true)
  58.    elseif link == [[returnwhat]] then -- Fecha a Aba What
  59.          for i = 41,42 do
  60.             ui.removeTextArea(i,p)
  61.          end        
  62.    elseif link == [[inforzapbr]] then
  63.    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)
  64.    ui.addTextArea(46, "<a href='event:closeinforzapbr'>Retorne</a>", p, 443, 233, 48, 18, 0x242f32, 0x324650, 0.9, true)
  65.    elseif link == [[closeinforzapbr]] then
  66.    for i = 45,46 do
  67.       ui.removeTextArea(i,p)
  68.       end
  69. ------------
  70. -- Área do aplicativo = [[ Aprendizagem Lua]]
  71. ------------
  72.    elseif link == [[helplua]] then
  73.    ui.addTextArea(81, "", p, 175, 48, 451, 238, 0x242f42, 0x324650, 1, true)
  74.    ui.addTextArea(82, "<font size='15'><a href='event:textarea'>Text Areas</a>", p, 182, 54, 96, 32, 0x242f42, 0x324650, 1, true)
  75.    ui.addTextArea(84, "<font size='15'><a href='event:closehelpmodule'>Fechar</a>", p, 381, 300, 55, 32, 0x242f42, 0x324650, 1, true)
  76.    elseif link == [[textarea]] then
  77.    ui.addTextArea(85, "<center><font size='14'>Text Areas</center>\n\n", p, 175, 48, 451, 238, 0x242f42, 0x324650, 1, true)
  78.    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)
  79.    ui.addTextArea(87, "<a href='event:pergunta2'>Para que serve o eventTextAreaCallback.</a>", p, 184, 122, 346, 23, 0x242f42, 0x000000, 1, true)
  80.    ui.addTextArea(89, "<font size='14'><center><a href='event:closeText'>Fechar</a>", p, 230, 302, 345, 23, 0x242f42, 0x000000, 1, true)
  81.    for i = 81,84 do
  82.       ui.removeTextArea(i,p)
  83.    end
  84.    elseif link == [[inforlua]] then
  85.    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)
  86.    ui.addTextArea(91, "<a href='event:closeinforlua'>Retorne</a>", p, 587, 279, 48, 18, 0x242f32, 0x324650, 0.9, true)
  87.    elseif link == [[closeinforlua]] then -- Fecha a aba de ajuda Module
  88.    for i = 90,91 do
  89.          ui.removeTextArea(i,p)
  90.       end
  91.    elseif link == [[closehelpmodule]] then -- Fecha a aba de ajuda Module
  92.    for i = 81,89 do
  93.          ui.removeTextArea(i,p)
  94.       end
  95.    elseif link == [[pergunta1]] then
  96.    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)
  97.    ui.addTextArea(101, "<font size='14'><center><a href='event:closepergunta1'>Fechar</a>", p, 233, 357, 345, 23, 0x242f42, 0x000000, 1, true)
  98.    for i = 85,89 do
  99.       ui.removeTextArea(i,p)
  100.    end
  101.    elseif link == [[closepergunta1]] then
  102.    for i = 100,101 do
  103.       ui.removeTextArea(i,p)
  104.       end
  105.    elseif link == [[closeText]] then -- Fecha a aba de perguntas Lua
  106.       for i = 85,89 do
  107.          ui.removeTextArea(i,p)
  108.       end
  109. ------------
  110. -- Área do aplicativo = [[ Lista Modules]]
  111. ------------
  112.    elseif link == [[modules]] then -- Aba Modules
  113.    ui.addTextArea(26, "<font size='15'><p align='center'>Modules</p>\n", p, 231, 31, 334, 336, 0x242f42, 0x242f42, NaN, true)
  114.    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)
  115.    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)
  116.    ui.addTextArea(29, "<a href='event:closemodule'><b>X</a>", p, 544, 37, 15, 21, 0x242c42, 0x324650, NaN, true)
  117.    elseif link == [[closemodule]] then -- Podeda loja
  118.              for i = 26,29 do
  119.                     ui.removeTextArea(i,p)
  120.                 end
  121.    elseif link == [[informodules]] then
  122.    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)
  123.    ui.addTextArea(91, "<a href='event:closeinformodules'>Retorne</a>", p, 548, 216, 48, 18, 0x242f32, 0x324650, 0.9, true)
  124.    elseif link == [[closeinformodules]] then
  125.          for i = 90,91 do
  126.             ui.removeTextArea(i,p)
  127.          end
  128. ------------
  129. -- Área do aplicativo = [[ Play Store]]
  130. ------------
  131.    elseif link == [[play]] then -- Loja
  132.    ui.addTextArea(30, "<font size='15'><b><p align='center'>Loja</p>\n", p, 143, 79, 513, 241, 0x242f42, 0x000000, NaN, true)
  133.    ui.addTextArea(31, "<font size='15'><b><p align='center'>Meep!</p>", p, 155, 122, 111, 115, 0x242f42, 0x000000, NaN, true)
  134.    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)
  135.    ui.addTextArea(33, "<font size='15'><b><p align='center'>Cheese!</p>", p, 283, 123, 111, 116, 0x242f42, 0x000000, NaN, true)
  136.    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)
  137.    ui.addTextArea(35, "<a href='event:return'><p align='center'><b>Return</p></a>", p, 545, 291, 99, 22, 0x242f42, 0x000000, NaN, true)
  138.    elseif link == [[return]] then -- Fecha loja
  139.                 for i = 30,35 do
  140.                     ui.removeTextArea(i,p)
  141.                 end
  142.    elseif link == [[inforplaystore]] then
  143.    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)
  144.    ui.addTextArea(412, "<a href='event:closeinforplaystore'>Retorne</a>", p, 487, 214, 48, 18, 0x242f32, 0x324650, 0.9, true)
  145.    elseif link == [[closeinforplaystore]] then
  146.    for i = 411,412 do
  147.                     ui.removeTextArea(i,p)
  148.                 end
  149.    elseif link == [[closeshelp]] then -- Fecha a aba de modules
  150.              for i = 20,21 do
  151.                     ui.removeTextArea(i,p)
  152.                 end
  153. ------------
  154. -- Área do aplicativo = [[ ID´s Lua]]
  155. ------------
  156.    elseif link == [[returnid]] then
  157.                 for i = 36,40 do
  158.                     ui.removeTextArea(i,p)
  159.                 end
  160.    elseif link == [[particleid]] then -- ID´s Lua
  161.             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)
  162.             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)
  163.             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)
  164.             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)
  165.    elseif link == [[emoteid]] then -- ID´s Lua
  166.             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)
  167.             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)
  168.    elseif link == [[shamanid]] then -- ID´s Lua
  169.             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)
  170.             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)
  171.             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)
  172.             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)
  173.             ui.addTextArea(22, "»", p, 625.75, 64.05, 22, 22, 0x565757, 0x565757)
  174.             elseif link == [[cheese]] then
  175.             if tfm.get.room.playerList[p].score > 300 then
  176.             tfm.exec.setPlayerScore(p, -300, true)
  177.             tfm.exec.giveCheese(p)
  178.         end
  179.     end
  180. end
  181. function eventNewGame()
  182.     for name in pairs(tfm.get.room.playerList) do
  183.         eventChatCommand(name,'opencell')
  184.     end
  185. end
  186. -- Neve
  187.        if k == 32 and tfm.get.room.playerList[p].isFacingRight == true and info[p].time < os.time()-1500 then
  188.             info[p].time = os.time()
  189.             tfm.exec.movePlayer(p,0,0,true,100,0,false)
  190.         elseif k == 32 and tfm.get.room.playerList[p].isFacingRight == false and info[p].time < os.time()-1500 then
  191.             info[p].time = os.time()
  192.             tfm.exec.movePlayer(p,0,0,true,-100,0,false)
  193.         end
  194.  local facingLeft = {}
  195.  
  196. for name in pairs(tfm.get.room.playerList) do
  197. for _,key in pairs{0,2,3} do system.bindKeyboard(name, key, true) end
  198. end
  199.  
  200. function eventKeyboard(name, key, down, x, y)
  201.     if key == 0 or key == 2 then
  202.     facingLeft[name] = key == 0
  203.         elseif key == 3 then
  204.             if facingLeft[name] then
  205.                 tfm.exec.addShamanObject(34, x - 8, y - 5, 0, -20)
  206.                 else
  207.                 tfm.exec.addShamanObject(34, x + 8, y - 5, 0, 20)
  208.             end
  209.         end
  210. end
  211. tfm.exec.newGame(0)
  212. tfm.exec.setUIMapName("<VI>Cell<ROSE>Phone")
  213.  
  214. -- Obrigado/Crédito ao Contistente que me ajudou com o reparo de alguns bugs.
  215. -- Obrigado/Crédito ao Ninguem que me ajudou com o script que permite que o jogador rode o mapa de sua escolha.
  216. -- Obrigado/Crédito ao Vitordiaspas que me ajudou com algumas sugestões.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement