Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- room = {}
- interface = {}
- interface.main = [[
- <p align='center'><font size='20' face='Monospace' color='#98E2EB'>Room control</font>
- The next groups are available:
- <font color='#95D9D6'>
- <a href="event:room">Room settings</a>
- <a href="event:shaman">shaman settings</a>
- <br/>
- <a href="event:exit"><b>Close menu</b></a></font></p>
- </p>
- ]]
- interface.shaman = [[
- <p align='center'><font size='20' face='Monospace' color='#98E2EB'>Shaman settings</font><br/>
- <font color='#95D9D6'>
- <a href="event:add_shaman">Add a new shaman</a>
- <a href="event:all_shaman">Set everyone as shaman</a>
- <br/><a href="event:back"><b>Back to previous menu</b></a></p>
- ]]
- interface.room = [[
- <p align='center'><font size='20' face='Monospace' color='#98E2EB'>Room settings</font>
- <font color='#95D9D6'><a href="event:play_map">Play a new map</a>
- <a href="event:all_shaman">Enable Snow</a>, <a href="event:all_shaman">Disable Snow</a>
- <br/><a href="event:back"><b>Back to previous menu</b></a></p>
- ]]
- for playerName,player in pairs(tfm.get.room.playerList) do
- ui.addTextArea(18, "<a href='event:openmenu'><font color='#D4CDCD'><b>Open room control</font></b></a>", playerName, 660, 30, 130, 20, "0x274850", "0x98E2EB", 0.1)
- end
- function whisper(to,from,message) tfm.exec.chatMessage('<font color="#F0A78E"><B>></B> [<font color="#e88f4f"><B>'..from..'</B></font>] '..message..'</font>',to) end
- function botSay(message) tfm.exec.chatMessage('<font color="#009D9D">[Infobot]</font> '..message..'</font>') end
- function split(str) local t = {} for w in str:gmatch("%S+") do table.insert(t,w) end return t end
- function eventNewGame()
- room['allshams'] = 0
- end
- function userInRoom(mouse)
- for playerName,player in pairs(tfm.get.room.playerList) do
- if playerName == mouse then
- return true
- else
- return false
- end
- end
- end
- function eventTextAreaCallback(id, playerName, callback)
- if callback == "openmenu" then
- ui.addTextArea(1, interface.main, playerName, 225, 50, 350, 300, "0x274850", "0x98E2EB", 0.8)
- elseif callback == "back" then
- ui.addTextArea(1, interface.main, playerName, 225, 50, 350, 300, "0x274850", "0x98E2EB", 0.8)
- elseif callback == "exit" then
- ui.addTextArea(1, interface.shaman, playerName, 220005, 100060, 350, 125, "0x274850", "0x98E2EB", 0.8)
- elseif id == 1 then
- if callback == "shaman" then
- ui.addTextArea(1, interface.shaman, playerName, 225, 50, 350, 300, "0x274850", "0x98E2EB", 0.8)
- elseif callback == "room" then
- ui.addTextArea(1, interface.room, playerName, 225, 50, 350, 300, "0x274850", "0x98E2EB", 0.8)
- elseif callback == "add_shaman" then
- ui.addTextArea(1, interface.shaman, playerName, 220005, 100060, 350, 125, "0x274850", "0x98E2EB", 0.8)
- ui.addPopup(2, 2, "Enter the name of the shaman you want to add.", playerName, 225, 160, 350)
- elseif callback == "play_map" then
- ui.addTextArea(1, interface.shaman, playerName, 220005, 100060, 350, 125, "0x274850", "0x98E2EB", 0.8)
- ui.addPopup(3, 2, "Enter a map code", playerName, 225, 160, 350)
- elseif callback == "all_shaman" then
- for playerName,player in pairs(tfm.get.room.playerList) do
- tfm.exec.setShaman(playerName)
- end
- botSay("<font color='#95D9D6'>"..playerName.."</font> added everyone as shaman.")
- tfm.exec.setUIShamanName("<ROSE>Everyone! :D")
- end
- end
- end
- function eventPopupAnswer(id, playerName, answer)
- if id == 2 then
- tfm.exec.setShaman(answer)
- botSay("<font color='#95D9D6'>"..playerName.."</font> added <font color='#FF99FF'>"..answer.."</font> as shaman.")
- elseif id == 3 then
- tfm.exec.newGame(answer)
- botSay("<font color='#95D9D6'>"..playerName.."</font> plays map <font color='#EB1D51'>"..answer.."</font>")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment