Advertisement
suxonov

Untitled

Jan 13th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. --DARKROOM--
  2.  
  3. tfm.exec.disableAutoScore(true)
  4. tfm.exec.disableAutoShaman(true)
  5. tfm.exec.disableAfkDeath(true)
  6. tfm.exec.disableAutoNewGame(true)
  7.  
  8. mapcr={"Aviener","Kaysha","Ilyasport"}
  9. admins={"Aviener"}
  10.  
  11. maplist={"@1257258", "@6459786", "@4043664"}
  12. maps=maplist[math.random(#maplist)]
  13.  
  14. imagelist={"urO90YM.png", "urO90YM.png", "lxPoKiA.png", "9JYR0yi.png", "4IOIp8K.png"}
  15. skin=imagelist[math.random(#imagelist)]
  16.  
  17. function xmlToobj(xmlS)
  18. local obj={}
  19. local i={}
  20. for w in string.gmatch(xmlS, "<P.-T.->") do
  21. local tmps=string.sub(w, string.find(w, 'X="[-]?%d+"'))
  22. xO=string.sub(tmps,string.find(tmps,"[-]?%d+"))
  23. tmps=string.sub(w, string.find(w, 'Y="[-]?%d+"'))
  24. yO=string.sub(tmps,string.find(tmps,"[-]?%d+"))
  25. idO=string.gsub(string.sub(w, string.find(w, 'T="%d+"')),"%D","")
  26.  
  27. table.insert(obj,{x=tonumber(xO);y=tonumber(yO);id=tonumber(idO)})
  28.  
  29. end
  30. return obj
  31. end
  32.  
  33. function eventNewGame()
  34. if tfm.get.room.xmlMapInfo.xml then
  35. local myVar = xmlToobj(tfm.get.room.xmlMapInfo.xml);
  36. local tmpO=myVar[math.random(#myVar)]
  37. tfm.exec.addShamanObject (27, tmpO.x, tmpO.y-10, 0, 0, 0, ghost)
  38. tfm.exec.addShamanObject (26, 830, 334, 0, 0, 0, false)
  39. ui.removeTextArea (1, playerName)
  40.  
  41. end
  42. end
  43.  
  44. --ChatCommands
  45. function eventChatCommand(playername, cmd)
  46. if cmd == "help" then
  47. print("<BV>Point of game</BV><N>: Find <BV> the hole</BV> (exit from room)\
  48. <N>Type <j>!cont</j> for contacts\
  49. <BV>Original idea</BV><N>: Defoster\
  50. <BV>Game made by</BV><N>: Aviener")
  51.  
  52. else
  53.  
  54. if cmd== "cont" then
  55. print("<BV>Admin<N>: Aviener\
  56. <BV>Map Crew<N>: "..table.concat(mapcr, ", "))
  57.  
  58. end
  59. end
  60. end
  61.  
  62. --Game
  63. tfm.exec.newGame(maplist[math.random(#maplist)])
  64.  
  65. function eventNewPlayer(playerName)
  66. print("<BV>"..playerName.."</BV><N>, hello! Welcome to <BV>#darkroom<BV>!<N> Try to find hole. Type <J>help<J> <N>(with exclamation mark) for more information!<CH>")
  67. end
  68.  
  69. function eventPlayerWon(playerName)
  70. print("<CH>"..playerName.."</CH><N> won the <J>game!<G>")
  71. tfm.exec.newGame(maplist[math.random(#maplist)])
  72. end
  73.  
  74. function eventLoop(t1,t2)
  75. if t2<=0 then
  76. maps=maplist[math.random(#maplist)]
  77. tfm.exec.newGame(maplist[math.random(#maplist)])
  78. end
  79. end
  80.  
  81. --Give Skin to player
  82. function eventNewGame()
  83. for name,player in pairs(tfm.get.room.playerList) do
  84. tfm.exec.addImage("skin=imagelist[math.random(#imagelist)]", "playerName", 0, 0, playerName)
  85. end
  86. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement