Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- welcome_image 154389890f4.png
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoNewGame(true)
- system.disableChatCommandDisplay ("profile", true)
- system.disableChatCommandDisplay ("help", true)
- system.disableChatCommandDisplay ("q^", true)
- players = {}
- --stuff
- translators = {'Restgato', '+Jullyy', 'Skittlesuni'}
- admin = {'Aviener'}
- mapCrew = {'Kaysha'}
- maplist={'@6561339', '@6534430', '@6636186', '@6636419', '@6636186', '@6637399'}
- mes = {
- en =
- {
- chat_welcome = '<J>Welcome to #darkroom, %s! Type !help for more information.';
- chat_win = '<V>%s<BL> has won!';
- chat_help = '<BL>Your main purpose is <J>finding an escape from the labyrinth. <BL>Find it first or die. Commands:\n<J>!profile nickname <BL>- open player\'s profile\n<J>!q^ <BL>- information about version and etc';
- chat_info = '<J>#<BL>darkroom: version 1.1\n<J>#<BL>Disscussion thread:\n<J>#<BL>Map Submissions thread:\n\n<J>#<BL>Created by <V>Aviener';
- profile_ratio = '<N> • Ratio: <V>';
- profile_rounds = '<N> • Total rounds played: <V>';
- profile_wins = '<N> • Wins: <V>';
- profile_close = 'Close';
- };
- e2 =
- {
- chat_welcome = '<J>Welcome to #darkroom, %s! Type !help for more information.';
- chat_win = '<V>%s<BL> has won!';
- chat_help = '<BL>Your main purpose is <J>finding an escape from the labyrinth. <BL>Find it first or die. Commands:\n<J>!profile nickname <BL>- open player\'s profile\n<J>!q^ <BL>- information about version and etc';
- chat_info = '<J>#<BL>darkroom: version 1.1\n<J>#<BL>Disscussion thread:\n<J>#<BL>Map Submissions thread:\n\n<J>#<BL>Created by <V>Aviener';
- profile_ratio = '<N> • Ratio: <V>';
- profile_rounds = '<N> • Total rounds played: <V>';
- profile_wins = '<N> • Wins: <V>';
- profile_close = 'Close';
- };
- br =
- {
- chat_welcome = '<J>Bem-vindo(a) ao #darkroom, %s! Digite !help para maiores informações.';
- chat_win = '<V>%s<BL> venceu!';
- chat_help = '<BL>Seu principal objetivo é <J>procurar uma saída para o labirinto, <BL>encontre a saída ou fique no escuro. Comandos:\n<J>!profile nome do jogador <BL>- para abrir o perfil de um jogador\'s profile\n<J>!q^ <BL>- informações sobre a versão do jogo e etc';
- chat_info = '<J>#<BL>darkroom: versão 1.1\n<J>#<BL>Tópico de discussões:\n<J>#<BL>Tópico de submissão de mapas:\n\n<J>#<BL>Minigame criado pelo <V>Aviener';
- profile_ratio = '<N> • Estatísticas: <V>';
- profile_rounds = '<N> • Partidas jogadas: <V>';
- profile_wins = '<N> • Partidas vencidas: <V>';
- profile_close = 'Fechar';
- };
- fr =
- {
- chat_welcome = '<J>Bienvenue au #darkroom, %s! Écris !help pour plus d\'informations.';
- chat_win = '<V>%s<BL> a gagné!';
- chat_help = '<BL>Ton objectif principal est <J>de trouver la sortie du labyrinthe. <BL>Trouve la en premier ou meurs. Commandes:\n<J>!profile nickname <BL>- ouvre le profil du joueur\n<J>!q^ <BL>- informations à propos de la version etc';
- chat_info = '<J>#<BL>darkroom: version 1.1\n<J>#<BL>Topic de discussion:\n<J>#<BL>Topic pour proposer des cartes:\n\n<J>#<BL>Créé par <V>Aviener';
- profile_ratio = ' • Ratio: <V>';
- profile_rounds = ' • Total des parties jouées: <V>';
- profile_wins = ' • Parties gagnées: <V>';
- profile_close = 'Fermer';
- };
- ro =
- {
- chat_welcome = '<J>Bine ai venit în #darkroom, &s! Scrie !help pentru mai multe informații.';
- chat_win = '<V>&s<BL> a câștigat!' ;
- chat_help = '<BL>Obiectivul tău este <J> să găsești o scăpare din labirint. <BL>Gasește-o primul sau mori. Comenzi: \n<J>!profile nickname <BL>- deschide profilul jucătorul\n<J>!q^ <BL>- informații despre versiune etc';
- chat_info = '<J>#<BL>darkroom: versiunea 1.1\n<J>#<BL>Thread-ul de discuții :\n<J>#<BL>Thread-ul de trimitere a mapelor: \n\n<J>#<BL>Creat de <V>Aviener';
- profile_ratio = ' • Ratio: <V>';
- profile_rounds = ' • Totalul de runde jucate: <V>';
- profile_wins = ' • Runde câștigate: <V>';
- profile_close ='Închidere';
- };
- ru =
- {
- chat_welcome = '<J>Добро пожаловать в #darkroom, %s! Напиши !help, чтобы узнать подробнее.';
- chat_win = '<V>%s<BL> выиграл!';
- chat_help = '<BL>Ваша главная задача - <J>найти выход из лабиринта. <BL>Найдите его первым или проиграйте. Команды: \n<J>!profile ник - открывает профиль игрока\n!q^ - информация про версию и т. д.';
- chat_info = '<J>#<BL>darkroom: версия 1.1\n<J>#<BL>Тема обсуждения игры:\n<J>#<BL>Прием карт:\n\n<J>#<BL>Создано <V>Aviener\'ом';
- profile_ratio = '<N> • Соотношение: <V>';
- profile_rounds = '<N> • Сыграно раундов: <V>';
- profile_wins = '<N> • Выиграно раундов: <V>';
- profile_close = 'Закрыть';
- };
- }
- Module = {
- ['TitleGenerator'] = function ()
- for name,player in pairs(tfm.get.room.playerList) do
- players[name]={rounds=0; wins = 0; title = '<V>Player'}
- end
- for player,name in pairs(translators) do
- players[name]={rounds=0; wins = 0; title = '<BV>★ Translator ★'}
- end
- for player,name in pairs(admin) do
- players[name]={rounds=0; wins = 0; title = '<ROSE>★★★ Little Boy ★★★'}
- end
- for player,name in pairs(mapCrew) do
- players[name]={rounds=0; wins = 0; title = '<PT>★ Staff ★'}
- end
- end;
- ['Start'] = function (arg)
- tfm.exec.newGame(arg)
- Module.TitleGenerator()
- end;
- ['Check'] = function(var, arg)
- --
- local flag = true
- for i,v in pairs (arg) do
- if v == var then
- flag = false
- break
- end
- end
- return flag
- end;
- ['GetPoints'] = function (xml)
- local obj={}
- local i= 1
- local blacklist={"0","1","2","4","5","6","7","8","10","12","13","14","15","16","17","18","19","20","21","22","23","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","40","47","48","49","50","51","52","53","54","55","56","57","58","59","60","61","62","63","64","65","66","67","68","69","70","71","72","73","74","75","76","77","78","79","80","81","82","83","84","85","86","87","88","89","90","91","92","93","94","95","96","97","98","99","100","101","102","103","104","105","106","107","108","109","110","111","112","113","114","115","116","117","118","119","120","121","122","123","124","125","126","127","128","129","130","131"}
- for w in string.gmatch(xml, "<P.-T.->") do
- local tmps=string.sub(w, string.find(w, 'X="[-]?%d+"'))
- xO=string.sub(tmps,string.find(tmps,"[-]?%d+"))
- tmps=string.sub(w, string.find(w, 'Y="[-]?%d+"'))
- yO=string.sub(tmps,string.find(tmps,"[-]?%d+"))
- idO=string.gsub(string.sub(w, string.find(w, 'T="%d+"')),"%D","")
- if Module.Check(idO, blacklist) then
- obj[i]={x=xO;y=yO;id=idO}
- i=i+1
- end
- end
- return obj
- end;
- ['PlacePortals'] = function ()
- myVar = Module.GetPoints(xml)
- local tmpO=myVar[math.random(#myVar)]
- tfm.exec.addShamanObject (27, tmpO.x, tmpO.y-50, 0, 0, 0, false)
- tfm.exec.addShamanObject (26, 830, 334, 0, 0, 0, false)
- end;
- --players--
- ['ProfileLanguage'] = function ()
- lang = tfm.get.room.community
- if lang == 'xx' then
- lang = 'en'
- return lang
- end
- return lang
- end;
- ['OpenProfile'] = function (a, r)
- Module.ProfileLanguage()
- local ratio = players[a].wins / players[a].rounds
- ui.addTextArea(8, "", r, 275, 104, 258, 212, 0x151819, 0x54585a, 1, true)
- ui.addTextArea(10, "<p align='center'><font size='25' face='Arial Black, Soopafresh'>"..a.."</p></font>", r, 283, 111, 240, 45, 0x151819, 0x151819, 1, true)
- ui.addTextArea(11, "Title: "..players[a].title,r, 281, 157, 248, 21, 0x151819, 0x151819, 1, true)
- ui.addTextArea(12, "<V>Statistics:<br><br>"..mes[lang].profile_rounds..players[a].rounds.."<br>"..mes[lang].profile_wins..players[a].wins.."<br><br>"..mes[lang].profile_ratio..ratio, r, 286, 189, 236, 90, 0x151819, 0x151819, 1, true)
- ui.addTextArea(9, "<a href='event:closeProfile'><p align=\"center\">"..mes[lang].profile_close.."</p></a>", r, 281, 294, 246, 16, 0x151819, 0x54585a, 1, true)
- end;
- ['CloseProfile'] = function ()
- for x,a in ipairs({8,10,11,12,9}) do
- ui.removeTextArea(a)
- end
- end;
- }
- Player = {
- ['GetTitle'] = function (name)
- if Module.Check(name, translators) then
- players[name]={rounds=0; wins = 0; title = '<V>Player'}
- else players[name]={rounds=0; wins = 0; title = '<BV>★ Translator ★'}
- end
- if Module.Check(name, mapCrew) then
- players[name]={rounds=0; wins = 0; title = '<V>Player'}
- else players[name]={rounds=0; wins = 0; title = '<PT>★ Staff ★'}
- end
- if Module.Check(name, admin) then
- players[name]={rounds=0; wins = 0; title = '<V>Player'}
- else players[name]={rounds=0; wins = 0; title = '<ROSE>★★★ Little Boy ★★★'}
- end
- end;
- }
- MsgBox = {
- ['SendMessage'] = function (message, name)
- --print(message)
- --ui.addTextArea(98989, message, nil, 8, 329, 787, 65, 0x324650, 0x0, 0.9)
- tfm.exec.chatMessage(message, name)
- end;
- ['LanguageSwitcher'] = function (name)
- lang = tfm.get.room.playerList[name].community
- if mes[lang]~= nil then
- return lang
- end
- end;
- }
- function eventNewGame()
- for name,player in pairs(tfm.get.room.playerList) do
- players[name].rounds = players[name].rounds + 1
- xml = tfm.get.room.xmlMapInfo.xml
- Module.PlacePortals()
- end
- for z,q in ipairs({6, 99, 889}) do
- ui.removeTextArea(q)
- end
- end
- -- player win
- function eventPlayerWon(name)
- players[name].wins = players[name].wins + 1
- ui.addTextArea(6, "", name, 6, 25, 788, 366, 0xe0e0e, 0xe0e0e)
- tfm.exec.setGameTime(2)
- if MsgBox.LanguageSwitcher(name) then
- MsgBox.SendMessage(string.format(mes[lang].chat_win, name), nil)
- end
- end
- --new player
- function eventNewPlayer(name)
- ui.addTextArea(99, "", name, 1, 2, 800, 400, 0x010101)
- tfm.exec.addImage("154389890f4.png", "&0", 14, -10);
- tfm.exec.newTimer(function() ui.RemoveTextArea(99) tfm.exec.removeImage ("154389890f4.png") end, 2000, false)
- Player.GetTitle(name)
- if MsgBox.LanguageSwitcher(name) then
- MsgBox.SendMessage(string.format(mes[lang].chat_welcome, name), name)
- else MsgBox.SendMessage(string.format(mes.en.chat_welcome, name), name)
- end
- tfm.exec.respawnPlayer(name)
- end
- --died
- function eventPlayerDied(name)
- ui.addTextArea(889, "", name, 6, 25, 788, 366, 0x010101)
- end
- --comms
- function eventChatCommand(name, c)
- local atr = {}
- for argument in c:gmatch("[^%s]+") do
- table.insert(atr,argument)
- end
- if atr[1] == 'help' then if MsgBox.LanguageSwitcher(name) then
- MsgBox.SendMessage(mes[lang].chat_help, name) else MsgBox.SendMessage(mes.en.chat_help, name)
- end
- elseif atr[1] == 'profile' and atr[2]~= nil and players[atr[2]] ~= nil then
- Module.OpenProfile(atr[2], name)
- elseif atr[1] == 'q^' then
- if MsgBox.LanguageSwitcher(name) then
- MsgBox.SendMessage(mes[lang].chat_info, name)
- else MsgBox.SendMessage(mes.en.chat_info, name)
- end
- end
- end
- function eventTextAreaCallback(id, name, callback)
- if callback == 'closeProfile' then
- Module.CloseProfile()
- end
- end
- function eventLoop(t1, t2)
- if t2<=0 then
- tfm.exec.newGame(maplist[math.random(#maplist)])
- end
- end
- Module.Start(maplist[math.random(#maplist)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement