Professional Documents
Culture Documents
CMDS: !help - !cmd - !cmds - !commands to see the commands list in game
--]]
local _, msg = pcall(nil)
roomloader = string.match(msg, "^(.-)%.")
admin = {roomloader}
win = 10 autoJoin = true teamColors = {Team1 = '00ff55', Team2 = 'ff8540', Team3 =
'ff50ee', Team4 = '00f5e5'}
vnMaps = {"2" , "11" , "12" , "19" , "22" , "24" , "40" , "44" , "45" , "53" , "55"
, "57" , "62" , "67" , "69" , "71" , "73" , "74" , "75" , "79" , "80" , "85" , "86"
, "119" , "123" , "127" , "138" , "142" , "145" , "150" , "172" , "173" , "174" ,
"7470754" , "7470763" , "7470774" , "7470782" , "7470797" , "7697587" , "7767224" ,
"7767228" , "7767300" , "7767308" , "7767311"}
bcMaps = {"@182681" , "@261814" , "@1893451" , "@424604", "@1018394" , "@1788490" ,
"@2252731" , "@1595965" , "@232678" , "@729863" , "@801683" , "@2692883" ,
"@4445580" , "@2176211" , "@392240" , "@6986340" , "@2208924" , "@155606" ,
"@2208924" , "@155628" , "@571683" , "@168204" , "@184868" , "@159145" ,
"@1646448" , "@159298" , "@176619" , "@523270" , "@191205" , "@458528" ,
"@399364" , "@177652" , "@171480" , "@124000" , "@319443" , "@3043779" ,
"@173816" , "@174223" , "@152260" , "@505619" , "@497965" , "@239698" , "@408577" ,
"@168754" , "@543010" , "@1678634" , "@173623" , "@156720" , "@564198" ,
"@176729" , "@170007" , "@178297", "@549759", "@149451" , "@161023"}
burlaMaps = {"@7652017" , "@7652019" , "@7652033" , "@7652664" , "@5932565" ,
"@7652667" , "@7652670" , "@7652674" , "@7652679" , "@7652686" , "@7652691" ,
"@7652790" , "@7652791" , "@7652792" , "@7652793" , "@7652796" , "@7652797" ,
"@7652798" , "@7652944" , "@7652954" , "@7652958" , "@7652960" , "@7007413" ,
"@7653108" , "@7653124" , "@7653127" , "@7653135" , "@7653136" , "@7653139" ,
"@7653142" , "@7653144" , "@7653149" , "@7653151" , "@7420052" , "@7426198" ,
"@7426611" , "@7387658" , "@7654229" , "@7203871" , "@7014223" , "@7175013" ,
"@7165042" , "@7154662" , "@6889690" , "@6933442" , "@7002430" , "@6884221" ,
"@6886514" , "@6882315" , "@6927305" , "@7659190" , "@7659197" , "@7659203" ,
"@7659205" , "@7659208" , "@7660110" , "@7660117" , "@7660104" , "@7660502" ,
"@7660703" , "@7660704" , "@7660705" , "@7660706" , "@7660709" , "@7660710" ,
"@7660714" , "@7660716" , "@7660718" , "@7660721" , "@7660723" , "@7660727" ,
"@7661057" , "@7661060" , "@7661062" , "@7661063" , "@7661067" , "@7661072" ,
"@7662547" , "@7662555" , "@7662559" , "@7662562" , "@7662565" , "@7662566" ,
"@7662569" , "@7662759" , "@7662768" , "@7662777" , "@7662780" , "@7662796" ,
"@7663423" , "@7663428" , "@7663429" , "@7663430" , "@7663432" , "@7663435" ,
"@7663437" , "@7663438" , "@7663439" , "@7663440" , "@7663444" , "@7663445"}
t1C = "Team1" t2C = "Team2" t3C = "Team3" t4C = "Team4" mod = "Racing" antiLevevn =
false antiLeverc = false minimalist = false np = false map = 0 fourteams = false
teams = {Team1 = {}, Team2 = {}, Team3 = {}, Team4 = {}} p = {T1 = 0, T2 = 0, T3 =
0, T4 = 0} first = false gameStarted = false t1N = "Team 1" t2N = "Team 2" t3N =
"Team 3" t4N = "Team 4" mix_v = true mix_bc = false mix_rc = false vote = {} ban =
{} ban1 = {} ban2 = {} ban3 = {}
mapsAntivn = {"6135200","7008845","7121189","7121027","7121192","7762520"}
mapsAntirc =
{"6641062","6641147","6641130","6641108","6641063","6640755","6641141","6641097","6
641144","6641111","6641110","6641087","6641075","6641132","6641101","6641090","6641
077","6641069","6641067","6641064" ,"6641058","6640884","6640869","6640866","664086
0","6640859","6640858","6640854","6640852","6640846","6640833","6640816","6640808",
"6640737","6641109","6641096"}
--[[MACRO--]]macroON = true macro_time = 2000 macro_warn = 18 macro_freeze = 24
macro_keys = {[38] = "Up", [87] = "W", [90] = "Z"} macro_info = {} mice_info = {}
concatenation = {} os_time = os.time
function main()
system.disableChatCommandDisplay(nil)
for _,k in pairs({"AfkDeath", "DebugCommand", "AutoNewGame",
"AutoShaman","AutoScore","AutoTimeLeft","PhysicalConsumables"}) do
tfm.exec["disable"..k]() end
tfm.exec.newGame(7774050) tfm.exec.setGameTime(99999) SetMapName()
checkColor() ShowStartBoard()
for _,admins in pairs(admin) do ui.addTextArea(99999, "<a
href='event:ce'>Commands", admins, 5, -25, 0, 10, 0x1e3d42, 0x1e3d42) end
for name in pairs(tfm.get.room.playerList) do eventNewPlayer(name) end
end
function toTeams()
teams.Team1 = {}
teams.Team2 = {}
teams.Team3 = {}
teams.Team4 = {}
local equipo = 1
local playersTotal = {}
for name, p in pairs(tfm.get.room.playerList) do table.insert(playersTotal,
name) end
for i = 1, #playersTotal do
numJugador = math.random(#playersTotal)
addPlayer = playersTotal[numJugador]
table.remove(playersTotal, numJugador)
if fourteams then
if equipo == 1 then table.insert(teams.Team1, addPlayer) equipo =
2
elseif equipo == 2 then table.insert(teams.Team2, addPlayer)
equipo = 3
elseif equipo == 3 then table.insert(teams.Team3, addPlayer)
equipo = 4
elseif equipo == 4 then table.insert(teams.Team4, addPlayer)
equipo = 1
end
else
if equipo == 1 then table.insert(teams.Team1, addPlayer) equipo =
2
elseif equipo == 2 then table.insert(teams.Team2, addPlayer)
equipo = 1
end
end
end
end
function eventNewGame()
for k in pairs(mice_info) do mice_info[k].adv = 0 end
if gameStarted then
if antiLevevn then antiLevevn = false
elseif antiLeverc then antiLeverc = false
elseif np then np = false
end
setTimeMode()
SetMapName()
for n,p in pairs(tfm.get.room.playerList) do if not PlayerInTeam(n)
then tfm.exec.killPlayer(n) end end
for _,k in pairs(ban) do table.clear(teams.Team1,k)
table.clear(teams.Team2,k) table.clear(teams.Team3,k) table.clear(teams.Team4,k)
end
SetPlayerNameColor()
first = false
if mod == "Vanilla" then
tfm.exec.disableMinimalistMode(minamalist)
tfm.exec.disableAfkDeath(false)
elseif mod =="Racing" then
tfm.exec.disableMinimalistMode(minimalist)
tfm.exec.disableAfkDeath(false)
elseif mod =="Bootcamp" then
tfm.exec.disableMinimalistMode(minimalist)
tfm.exec.disableAfkDeath(false)
elseif mod =="Burlas" then
tfm.exec.disableMinimalistMode(minimalist)
tfm.exec.disableAfkDeath(false)
elseif mod =="Mix" then
tfm.exec.disableMinimalistMode(minimalist)
tfm.exec.disableAfkDeath(false)
elseif mod =="end" then
tfm.exec.disableMinimalistMode(false)
tfm.exec.disableAfkDeath(true)
end
end
end
function eventNewPlayer(plr, y)
local info = {}
for key in next, macro_keys do
info[key] = {0, os_time() + macro_time, false, false}
system.bindKeyboard(plr, key, true, true)
end
macro_info[plr] = info
mice_info[plr] = {adv = 0}
if gameStarted then
if PlayerInTeam(plr) then tfm.exec.killPlayer(plr) return end
if autoJoin then
if fourteams then
if #teams.Team1 < #teams.Team2 and #teams.Team1 <
#teams.Team3 and #teams.Team1 < #teams.Team4 or #teams.Team1 == #teams.Team2 and
#teams.Team1 == #teams.Team3 and #teams.Team1 == #teams.Team4 or #teams.Team2 >
#teams.Team1 and #teams.Team2 > #teams.Team3 and #teams.Team2 > #teams.Team4 and
#teams.Team1 == #teams.Team3 and #teams.Team1 == #teams.Team4 and #teams.Team3 ==
#teams.Team4 or #teams.Team2 > #teams.Team1 and #teams.Team2 > #teams.Team3 and
#teams.Team3 > #teams.Team1 and #teams.Team2 > #teams.Team4 and #teams.Team1 ==
#teams.Team4 then table.insert(teams.Team1,plr)
elseif #teams.Team2 < #teams.Team1 and #teams.Team2 <
#teams.Team3 and #teams.Team2 < #teams.Team4 or #teams.Team3 > #teams.Team1 and
#teams.Team3 > #teams.Team2 and #teams.Team4 > #teams.Team1 and #teams.Team4 >
#teams.Team2 and #teams.Team1 == #teams.Team2 or #teams.Team1 > #teams.Team2 and
#teams.Team1 > #teams.Team4 and #teams.Team3 > #teams.Team2 and #teams.Team3 >
#teams.Team4 and #teams.Team2 == #teams.Team4 or #teams.Team1 > #teams.Team2 and
#teams.Team1 > #teams.Team3 and #teams.Team1 > #teams.Team4 and #teams.Team2 ==
#teams.Team3 and #teams.Team2 == #teams.Team4 and #teams.Team3 == #teams.Team4 then
table.insert(teams.Team2,plr)
elseif #teams.Team3 < #teams.Team1 and #teams.Team3 <
#teams.Team2 and #teams.Team3 < #teams.Team4 or #teams.Team4 > #teams.Team1 and
#teams.Team4 > #teams.Team2 and #teams.Team4 > #teams.Team3 and #teams.Team1 ==
#teams.Team2 and #teams.Team1 == #teams.Team3 and #teams.Team2 == #teams.Team3 or
#teams.Team1 > #teams.Team2 and #teams.Team1 > #teams.Team3 and #teams.Team4 >
#teams.Team2 and #teams.Team4 > #teams.Team3 and #teams.Team2 == #teams.Team3 or
#teams.Team2 > #teams.Team1 and #teams.Team2 > #teams.Team3 and #teams.Team4 >
#teams.Team1 and #teams.Team4 > #teams.Team3 and #teams.Team1 == #teams.Team3 then
table.insert(teams.Team3,plr)
elseif #teams.Team4 < #teams.Team1 and #teams.Team4 <
#teams.Team2 and #teams.Team4 < #teams.Team3 or #teams.Team1 == #teams.Team2 and
#teams.Team1 == #teams.Team3 and #teams.Team1 == #teams.Team4 and #teams.Team2 ==
#teams.Team3 and #teams.Team2 == #teams.Team4 and #teams.Team3 == #teams.Team4 or
#teams.Team3 > #teams.Team1 and #teams.Team3 > #teams.Team2 and #teams.Team3 >
#teams.Team4 and #teams.Team1 == #teams.Team2 and #teams.Team1 == #teams.Team4 and
#teams.Team2 == #teams.Team4 or #teams.Team1 > #teams.Team3 and #teams.Team1 >
#teams.Team4 and #teams.Team2 > #teams.Team3 and #teams.Team2 > #teams.Team4 and
#teams.Team3 == #teams.Team4 then table.insert(teams.Team4,plr)
else table.insert(teams.Team4,plr)
end
else
if #teams.Team1 == #teams.Team2 then
table.insert(teams.Team1,plr)
elseif #teams.Team1 > #teams.Team2 then
table.insert(teams.Team2,plr)
end
end
end
else tfm.exec.respawnPlayer(plr)
end
for _,k in pairs(ban) do ui.addTextArea(666, "<p align='center'><font
size='100'><r>\nBAN</r></font>", k, 0, 0, 800, 400, 0x000001, 0x000001, 1, true)
end
end
function eventPlayerDied(plr)
if gameStarted then
local plrCount = 0
for n,p in pairs(tfm.get.room.playerList) do
if not p.isDead then
plrCount = plrCount + 1
end
end
if plrCount <= 0 then
newMap()
end
end
end
function newMap()
local vanilla = vnMaps[math.random(#vnMaps)]
local bootcamp = bcMaps[math.random(#bcMaps)]
local antivn = mapsAntivn[math.random(#mapsAntivn)]
local antirc = mapsAntirc[math.random(#mapsAntirc)]
local burlas = burlaMaps[math.random(#burlaMaps)]
if antiLevevn then
tfm.exec.newGame(antivn)
elseif antiLeverc then
tfm.exec.newGame(antirc)
elseif np then
tfm.exec.newGame(map)
elseif mod == "Vanilla" then
tfm.exec.disableMinimalistMode(minimalist)
tfm.exec.newGame(vanilla)
elseif mod == "Racing" then
tfm.exec.disableMinimalistMode(minimalist)
tfm.exec.newGame'#17'
elseif mod == "Bootcamp" then
tfm.exec.disableMinimalistMode(minimalist)
tfm.exec.newGame(bootcamp)
elseif mod == "Burlas" then
tfm.exec.disableMinimalistMode(minimalist)
tfm.exec.newGame(burlas)
elseif mod == "MIX" then
tfm.exec.disableMinimalistMode(minimalist)
if mix_v then
tfm.exec.newGame(vanilla)
mix_v = false
mix_bc = true
elseif mix_bc then
tfm.exec.newGame(bootcamp)
mix_bc = false
mix_rc = true
elseif mix_rc then
tfm.exec.newGame'#17'
mix_rc = false
mix_v = true
end
elseif mod == "end" then
tfm.exec.newGame(7774050)
tfm.exec.setGameTime(99999)
ui.removeTextArea(16)
ui.removeTextArea(17)
tfm.exec.setUIMapName("vs")
gameStarted = false
mod = "Racing"
ShowStartBoard()
end
end
function SetPlayerNameColor()
checkColor()
for i,v in pairs(teams.Team1) do tfm.exec.setNameColor(v, "0x"..t1C) end
for i,n in pairs(teams.Team2) do tfm.exec.setNameColor(n, "0x"..t2C) end
for i,b in pairs(teams.Team3) do tfm.exec.setNameColor(b, "0x"..t3C) end
for i,m in pairs(teams.Team4) do tfm.exec.setNameColor(m, "0x"..t4C) end
end
function setTimeMode()
if mod == "Vanilla" then tfm.exec.setGameTime(110)
elseif mod == "Racing" then tfm.exec.setGameTime(63)
elseif mod == "Bootcamp" then tfm.exec.setGameTime(110)
elseif mod == "Burlas" then tfm.exec.setGameTime(63)
elseif mod == "MIX" then tfm.exec.setGameTime(110)
elseif mod == "end" then tfm.exec.setGameTime(13)
elseif mod == nil then mod = "Racing" tfm.exec.setGameTime(63)
end
end
function SetMapName()
local npN4 = " <font color='#"..t1C .."'>"..t1N..":
"..p.T1.."</font> | <font color='#"..t2C.."'>"..t2N..": "..p.T2.."</font> |
<font color='#"..t3C.."'>"..t3N..": "..p.T3.."</font> | <font
color='#"..t4C.."'>"..t4N..": "..p.T4.."</font> | <n>D: "..win.."</n>"
local npN2 = " <font color='#"..t1C .."'>" ..t1N ..": ".. p.T1
.."</font> | <font color='#" ..t2C .."'>" ..t2N ..": "..p.T2.."</font> | <n>D:
" ..win.."</n>"
if gameStarted then
if fourteams then tfm.exec.setUIMapName(npN4)
else tfm.exec.setUIMapName(npN2)
end
else
tfm.exec.setUIMapName("vs")
end
end
function FillTeams()
local t = 1
teams.Team1 = {}
teams.Team2 = {}
teams.Team3 = {}
teams.Team4 = {}
for n,p in pairs(tfm.get.room.playerList) do
if fourteams then
if t == 1 then table.insert(teams.Team1,n) t = 2
elseif t == 2 then table.insert(teams.Team2,n) t = 3
elseif t == 3 then table.insert(teams.Team3,n) t = 4
elseif t == 4 then table.insert(teams.Team4,n) t = 1
end
else
if t == 1 then table.insert(teams.Team1,n) t = 2
elseif t == 2 then table.insert(teams.Team2,n) t = 1
end
end
end
end
function checkColor()
local c = false
for key,v in pairs(teamColors) do
if key == t1C then
t1C = v
c = true
elseif key == t2C then
t2C = v
c = true
elseif key == t3C then
t3C = v
c = true
elseif key == t4C then
t4C = v
c = true
elseif t1C == v then
c = true
elseif t2C == v then
c = true
elseif t3C == v then
c = true
elseif t4C == v then
c = true
end
end
end
function table.contain(t,obj) for i,v in pairs(t) do if v==obj then return true end
end return false end
function TeamFix(plr)
local char = plr
for i,v in pairs(teams.Team1) do if v == char then return "team1" end end
for i,n in pairs(teams.Team2) do if n == char then return "team2" end end
for i,b in pairs(teams.Team3) do if b == char then return "team3" end end
for i,m in pairs(teams.Team4) do if m == char then return "team4" end end
return false
end
function PlayerCheck(plr)
local playerToSerch = plr
for n,p in pairs(tfm.get.room.playerList) do if n == plr then return true end
end
return false
end
function PlayerInTeam(plr)
local player = plr
for i,v in pairs(teams.Team1) do if v == player then return true end end
for i,n in pairs(teams.Team2) do if n == player then return true end end
if fourteams then
for i,b in pairs(teams.Team3) do if b == player then return true end
end
for i,m in pairs(teams.Team4) do if m == player then return true end
end
end
return false
end
function ShowVot()
vote = {racing = 0, burlas = 0, bootcamp = 0, vanilla = 0, mix = 0}
ui.addTextArea(35, "<p align='center'><font size='20'>Vote</font></p>\nSelect
a mode\n\n<font size='15'><a href='event:mrc'>Racing</a>\n<a
href='event:mbr'>Burlas</a>\n<a href='event:mbc'>Bootcamp</a>\n<a
href='event:mvn'>Vanilla</a>\n<a href='event:mmix'>Mix</a></font>", nil, 300, 100,
200, 200, 0x000001, 0xffffff, 1, true)
end
function ShowStartBoard()
ui.addTextArea(0, "<p align='center'>Admin: <font
color='#fff000'><b>"..admin[1], nil, 263, 365, 265, 20, 0x000001, 0x000000, 0.8,
true)
ui.addTextArea(1, "", nil, 209, 33, 381, 326, 0x000001, 0x000000, 1, true)
ui.addTextArea(2, "<p align='center'><font size='12'
color='#" ..t1C .."'>"..(table.concat(teams.Team1,"\n") or ""), nil, 210, 66, 151,
254, 0x000001, 0x00ff55, 1, true)
ui.addTextArea(3, "<p align='center'><font size='12' color='#" ..t2C .."'>
"..(table.concat(teams.Team2,"\n") or ""), nil, 439, 66, 151, 254, 0x000001,
0xff8540, 1, true)
if fourteams then
ui.removeTextArea(2)
ui.removeTextArea(3)
ui.addTextArea(22, "<p align='center'><font size='12'
color='#" ..t1C .."'>"..(table.concat(teams.Team1,"\n") or ""), nil, 210, 66, 151,
120, 0x000001, 0x00ff55, 1, true)
ui.addTextArea(33, "<p align='center'><font size='12'
color='#" ..t2C .."'>"..(table.concat(teams.Team2,"\n") or ""), nil, 439, 66, 151,
120, 0x000001, 0xff8540, 1, true)
ui.addTextArea(24, "<p align='center'><font size='12'
color='#" ..t3C .."'>"..(table.concat(teams.Team3,"\n") or ""), nil, 210, 215, 151,
120, 0x000001, 0xff50ee, 1, true)
ui.addTextArea(25, "<p align='center'><font size='12'
color='#" ..t4C .."'>"..(table.concat(teams.Team4,"\n") or ""), nil, 439, 215, 151,
120, 0x000001, 0x00f5e5, 1, true)
ui.addTextArea(26, "<font color='#"..t3C.."'><font size='9'><p
align='center'><b>"..t3N.."</b></p>/font>", nil, 220, 190, 125, 15, 0x000001,
0x000000, 0, true)
ui.addTextArea(27, "<font color='#"..t4C.."'><font size='9'><p
align='center'><b>"..t4N.."</b></p>/font>", nil, 450, 190, 125, 15, 0x000001,
0x000000, 0, true)
end
ui.addTextArea(4, "<p align='center'>" ..(mod or "Racing"), nil, 354, 60, 90,
19, 0x000001, 0x000000, 1, true)
ui.addTextArea(5, "<font size='12'><p align='center'><b>\\ VS /", nil, 209,
33, 381, 21, 0x000001, 0x000000, 1, true)
ui.addTextArea(6, "<font color='#"..t1C.."'><font size='9'><p
align='center'><b>"..t1N.."</b></p>/font>", nil, 220, 40, 125, 15, 0x000001,
0x000000, 0, true)
ui.addTextArea(7, "<font color='#"..t2C.."'><font size='9'><p
align='center'><b>"..t2N.."</b></p>/font>", nil, 450, 40, 125, 15, 0x000001,
0x000000, 0, true)
ui.addTextArea(8, "<p align='center'><b><a href='event:vn'>Vanilla</a>", nil,
365, 186, 69, 20, 0x000001, 0xffffff, 1, true)
ui.addTextArea(9, "<p align='center'><b><a href='event:rc'>Racing</a>", nil,
365, 105, 69, 20, 0x000001, 0xffffff, 1, true)
ui.addTextArea(18, "<p align='center'><b><a href='event:bc'>Bootcamp</a>",
nil, 365, 159, 69, 20, 0x000001, 0xffffff, 1, true)
ui.addTextArea(20, "<p align='center'><b><a href='event:brc'>Burlas</a>",
nil, 365, 132, 69, 20, 0x000001, 0xffffff, 1, true)
ui.addTextArea(21, "<p align='center'><b><a href='event:mix'>MIX</a>", nil,
365, 213, 69, 20, 0x000001, 0xffffff, 1, true)
ui.addTextArea(10, "<p align='center'><font size='16'><b><a
href='event:start'>Start</a>", nil, 359, 255, 82, 23, 0x000001, 0xFCFF5A, 1, true)
ui.addTextArea(11, "<p align='center'>Score: <a href='event:dec'>-</a>
"..win.." <a href='event:inc'>+</a>", nil, 460, 345, 95, 20, 0x000001, 0x000000, 0,
true)
ui.addTextArea(12, "<p align='center'>Auto Join: <a href='event:OnAndOff'>"..
(autoJoin and "<font color='#5ECE52'>on</font>" or not autoJoin and "<font
color='#CE5252'>off</font>") .."</a>", nil, 245, 345, 87, 20, 0x000001, 0x000000,
0, true)
ui.addTextArea(15, "<p align='center'><a href='event:Fill'>Fill</a>", nil,
375, 320, 47, 20, 0x000001, 0x000000, 0, true)
ui.addTextArea(19, "<p align='center'>Teams: <a href='event:nteams'>"..(not
fourteams and "2 (or 4)" or fourteams and "4 (or 2)") .."</a>", nil, 345, 345, 100,
20, 0x000001, 0x000000, 0, true)
end
main()