"..tostring(thismap).." | no portals: "..tostring(conf.noportals).." | mirrored map: "..tostring(tfm.get.room.mirroredMap).." | able to fly: "..tostring(conf.flymode), name, 150, 380, 500, 27, info[currentMap].c or 0x000022, info[currentMap].c or 0x000022, 0.8, true)
ui.addTextArea(64, "X", nil, 640, 380, 20, 27, 0x000022, 0x000022, 0, true)
end
function mapdata(name,down,etc)
etc = etc or {}
displayMap=(etc.map or currentMap)
if displayMap==-100000000001 then displayMap=0 end
local col
if info[displayMap] then
if info[displayMap].o<=100 then
col="BV"
elseif info[displayMap].o>=101 and info[displayMap].o<=140 then
col="V"
elseif info[displayMap].o>=141 and info[displayMap].o<=170 then
col="VP"
elseif info[displayMap].o>=171 and info[displayMap].o<=230 then
col="J"
elseif info[displayMap].o>=231 and info[displayMap].o<=280 then
col="O"
elseif info[displayMap].o>=281 then
col="R"
else
col="N"
end
end
if down==true then
ui.addTextArea(81, "", name, -2600, -1840, 6000, 2000, info[currentMap].c or 0x000022, info[currentMap].c or 0x000022, 0.9,true)
-- ui.addTextArea(82, "", name, 25, 50, 160, 90, 0xffffff, 0x22, 1, true)
ui.addTextArea(83, "<"..col..">Map "..displayMap..(tfm.get.room.mirroredMap and "*" or "")..""..col..">\tOBJECTS "..info[currentMap].o.."\tOPTIMIZED "..tostring(chopt()).."
WIDTH "..info[currentMap].L.."\tHEIGHT "..info[currentMap].H.."\tGRAVITY "..tostring(info[currentMap].G).."
DATE "..tostring(info[currentMap].C).."\tCOLOR ■"..tostring(string.format("%06x",tonumber(info[currentMap].c) or 0x000022)) or 0x000022.."", name, 200, 50, 540, 120, 0x324650, 0x0, 0 ,true)
players[name].ctrl = tfm.exec.addImage(info[displayMap].i,"&"..displayMap,25,50,name)
else
for i,v in ipairs({81,82,83}) do ui.removeTextArea(v,name) end
tfm.exec.removeImage(players[name].ctrl,name)
end
end
function rmgui(name)
ui.removeTextArea(32,name)
ui.addTextArea(64, "+", name, 6, 22, 12, 15, info[currentMap].c or 0x000022, info[currentMap].c or 0x000022, 0.8, true)
end
function eventNewPlayer(name)
tfm.exec.bindKeyboard(name,1,true,true)
tfm.exec.bindKeyboard(name,16,false,true)
tfm.exec.bindKeyboard(name,16,true,true)
tfm.exec.bindKeyboard(name,17,false,true)
tfm.exec.bindKeyboard(name,17,true,true)
tfm.exec.bindKeyboard(name,50,true,true)
tfm.exec.bindKeyboard(name,120,true,true)
end
shift={}
function eventKeyboard(n, key, down, x, y)
if key==1 and conf.flymode == true then tfm.exec.movePlayer(n,0,0,true,0,-17,true) end
if key==16 then shift[n]=down end
if key==17 then mapdata(n,down) end
if key==50 then
players[n].c=players[n].c+1
print(""..players[n].c)
if players[n].c>1 then
for k,v in next,players do tfm.exec.setNameColor(k,0xc2c2da) end
chat.message("The new catcher is: "..n)
ui.setShamanName(n)
tfm.exec.setNameColor(n,0xeb1d51)
players[n].c=0
end
end
if key==120 then for k,v in pairs(tfm.get.room.objectList) do table.insert(objects,k) end tfm.exec.removeObject(objects[math.random(#objects)]) print("*_*") end
end
function eventNewGame()
for k,v in next, tfm.get.room.playerList do
players[k] = {c=0}
end
local Ptag = string.match(tfm.get.room.xmlMapInfo.xml, "")
local meta = string.match(Ptag, 'meta ?= ?"(.-)"')
local mapName
if meta then
mapName = string.gsub(meta, ",", " - $", 1).."" end
thismap = string.gsub(""..tostring(meta), ",", " - $", 1) print(thismap)
currentMap = tonumber(string.match(thismap,"%$%K_(.+)")) or -100000000001; print(currentMap)
ui.setMapName(mapName)
if Ptag:find('portal') and conf.noportals == false then
for value in Ptag:gmatch('portal="(.+)"') do
print(value)
tfm.exec.addShamanObject(26,tonumber(value:match('(.-);'):match('(.-),')),tonumber(value:match('(.-);'):match(',(.+)')),0,0,0,false)
tfm.exec.addShamanObject(27,tonumber(value:match(';(.+)'):match('(.-),')),tonumber(value:match(';(.+)'):match(',(.+)')),0,0,0,false)
end
end
if info[currentMap].H==nil or info[currentMap].W==nil then
if Ptag:find('H') then
info[currentMap].H = Ptag:match('H="(.-)"')
else info[currentMap].H = 400
end
if Ptag:find('L') then
info[currentMap].L = Ptag:match('L="(.-)"')
else info[currentMap].L = 800
end
end
if info[currentMap].G==nil then
if Ptag:find('G') then
info[currentMap].G = Ptag:match('G="(.-)"')
else info[currentMap].G = "0,10"
end
end
gui()
if currentMap==-100000000001 then ui.setMapName("#bodykudo0catch") rmgui() end
ui.setBackgroundColor("#080808")
end
ICR = {}
function atlas(page,targ)
page=page or 1
rmgui(targ)
for i=0,14 do ui.removeTextArea(i,targ) end
for i=320,334 do ui.removeTextArea(i,targ) end
ui.addTextArea(-1,"",targ,-5000,-5000,10000,10000,info[currentMap].c or 0x000022,info[currentMap].c or 0x000022,0.8,true)
ui.addTextArea(66,"",targ,5,10,790,32,info[currentMap].c or 0x000022,info[currentMap].c or 0x000022,1,true)
ui.addTextArea(65," \n3previous next4
",targ,5,10,300,32,0,0,0,true)
ui.addTextArea(64," \nclose r
",targ,735,10,60,32,0,0,0,true)
ui.addTextArea(63,"less laggy ▃▄▅▆▇█ more laggy
", targ, 150, 22, 500, 16, 0xffffff, 0x0, 0.08, true)
for k,v in next,ICR do tfm.exec.removeImage(v,targ) end
for i=0+(page-1)*15,(page-1)*15+14 do
local col
if info[i] then
if info[i].o<=100 then
col="BV"
elseif info[i].o>=101 and info[i].o<=140 then
col="V"
elseif info[i].o>=141 and info[i].o<=170 then
col="VP"
elseif info[i].o>=171 and info[i].o<=230 then
col="J"
elseif info[i].o>=231 and info[i].o<=280 then
col="O"
elseif info[i].o>=281 then
col="R"
else
col="N"
end
ui.addTextArea(i%15,"<"..col..">Map "..i..""..col..">
",targ,(i%5)*160+5,(math.ceil((((i-(page*15))+1)/5))*118)+285,155,23,0x000022,0x000022,0,true)
ui.addTextArea((i%15)+320,"ℹ
",targ,(i%5)*160+5,(math.ceil((((i-(page*15))+1)/5))*118)+284,155,23,0x000022,0x000022,0,true)
ICR[#ICR+1] = tfm.exec.addImage(info[i].i,"&"..i,(i%5)*160,(math.ceil((((i-(page*15))+1)/5))*118)+310,targ)
if conf.debug then chat.message("Loaded image "..i..": "..tostring(info[i].i).." "..tostring((i%5)*160).." "..tostring((math.ceil((((i-(page*15))+1)/5))*118)+310).." "..tostring(i%5)) end
end
end
end
function metadata(page,targ)
page = page or 1
rmgui(targ)
display = ""
for i=0+(page-1)*15,(page-1)*15+14 do
if info[i]~=nil then
local qqq=string.format("%06x",tonumber(info[i].c) or 0x000022)
display = display..string.format("%s\t%s\t%s\t%s\t%s\t\n",
tostring(i),
tostring(info[i].o) or "",
"■"..tostring(qqq) or 0x000022,
tostring(info[i].C) or "",
""..tostring(info[i].d).."" or "")
end
end
ui.addTextArea(0, "[prev][next][close]
_____________________________________
ID\tOBJ\tCOL\tDATE\tDEATHMSG\n"..display.."", targ, 112, 50, 576, 320, info[currentMap].c or 0x000022, info[currentMap].c or 0x000022, 0.65, true)
end
function mapInfo(map,targ)
print(""..map)
end
function eventTextAreaCallback(id, name, callback)
local c = { }
string.gsub(callback, "%S+", function(arg)
c[#c + 1] = arg
end)
if shift[name] then chat.message("eventTextAreaCallback",-1,{cmdFeedback=id.." \""..callback.."\""}) end
if callback=="minimizePanel" then rmgui(name) end
if callback=="restorePanel" then gui(name) end
if c[1]=="info" then
mapInfo(c[2],name)
end
if c[1]=="page" then atlas(c[2],c[3] or name) end
if c[1]=="pagem" then metadata(c[2],c[3] or name) end
if c[1]=="clsgen" then ui.removeTextArea(id,c[2] or name) end
if c[1]=="cls" then
for i=-1,14 do ui.removeTextArea(i,name) end
for i=63,66 do ui.removeTextArea(i,name) end
for i=320,334 do ui.removeTextArea(i,name) end
for k,v in next,ICR do tfm.exec.removeImage(v) end
gui(name)
end
end
function eventPlayerDied(name)
print(not not info[currentMap])
if info[currentMap] then
chat.message(""..string.format(info[currentMap].d,name)) print(""..string.format(info[currentMap].d,name))
end
end
function eventPopupAnswer(popupID, playerName, answer)
end
function eventLoop(time,rem)
for k,v in next,players do
players[k].c=0
end
-- if conf.debug then chat.message("Waiting period reset") end
end
function eventPlayerLeft(name)
players[name]=nil
end
for name,player in pairs(tfm.get.room.playerList) do eventNewPlayer(name) end