Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Put the script runner's name here
- runner = "Gekkeiju"
- --If you have map list, put it here. You can load them by the button "next"
- maps = {"@213755", "@213752", "@209848", "@208653", "@205506", "@205240", "@204647", "@204488", "@203664", "@202574", "@201000", "@195672", "@193662", "@192560", "@192158", "@191443", "@191203", "@191177", "@185428", "@183139", "@182769", "@180801", "@176507", "@175204", "@172951", "@172520", "@172512", "@172501", "@171148", "@169076", "@166430", "@163159", "@160841", "@157960", "@157203", "@157004", "@151655", "@2329940", "@4445580", "@886744", "@330933", "@842019", "@3668888", "@179807", "@177652", "@1646448", "@206396", "@179488", "@1427980", "@815336", "@161434", "@216173", "@172621", "@592189", "@3908151", "@168754", "@512887", "@306365", "@1384078", "@2130169", "@410045", "@186066", "@2242899", "@3038589", "@2636519", "@263819", "@4067327", "@528032", "@511136", "@295932", "@271193", "@3988424", "@166032", "@460961", "@315666", "@162482", "@316012", "@304861", "@257218", "@232469", "@183141", "@423311", "@293559", "@2846829", "@458528", "@231137", "@320483", "@684566", "@2795201", "@4114521", "@3690269", "@167903", "@2416969", "@171480", "@171482", "@868262", "@166271", "@380516", "@368839", "@315800", "@297442", "@270143", "@189819", "@214631", "@281948", "@1256085", "@1410539", "@190996", "@424685", "@375455", "@182370", "@435812", "@3456260", "@257715", "@587501", "@1647131", "@3199998", "@2989803", "@2574744", "@438449", "@976944", "@1595965", "@277824", "@467137", "@1303323", "@1807217", "@164916", "@174223", "@161023", "@1111252", "@279337", "@408643", "@191642", "@1014313", "@319443", "@155765", "@176729", "@397478", "@1733211", "@365061", "@1657819", "@541223", "@306384", "@504485", "@496886", "@444589", "@551317", "@523270", "@2451444", "@153996", "@1580356", "@454049", "@1503203", "@1255359", "@506940", "@399364", "@2311703", "@155606", "@232675", "@1955745", "@586901", "@163531", "@149422", "@431749", "@1788490", "@514311", "@277513", "@272689", "@2794566", "@197229", "@2788517", "@113156", "@541729", "@172976", "@1156092", "@1989803", "@412467", "@333002", "@337644", "@1809410", "@2469365", "@556575", "@1226207", "@506613", "@1403454", "@1130256", "@596239", "@457726", "@898934", "@2520540", "@191205", "@496610", "@2914456", "@159145", "@394132", "@500748", "@223947", "@268915", "@1164086", "@166333", "@2040569", "@531084", "@1225867", "@5404791", "@263926", "@259319", "@167075", "@455271", "@500000", "@1990413", "@1580835", "@327354", "@1242584", "@1265789", "@172547", "@1620703", "@173623", "@564198", "@158417", "@1615753", "@169139", "@150651", "@1157281", "@170514", "@2024960", "@3551333", "@424900", "@834297", "@476706", "@3136410", "@2423300", "@721319", "@722837", "@557074", "@970919", "@1435902", "@158345", "@124000", "@568122", "@1722755", "@1046877", "@1390405", "@372255", "@149451", "@1000006", "@403755", "@1678634", "@1615949", "@1540221", "@302080", "@213874", "@1004622", "@1494499", "@1066607", "@593431", "@322582", "@156720", "@543010", "@1383297", "@500690", "@801683", "@593530", "@217261", "@222910", "@1333846", "@618999", "@1398609", "@395216", "@500894", "@329571", "@378704", "@235037", "@329200", "@354984", "@159932", "@401630", "@1162831", "@999963", "@163596", "@152260", "@373105", "@1593066", "@264091", "@1531604", "@1526894", "@552986", "@1323048", "@301610", "@199710", "@199210", "@424604", "@173816", "@299983", "@439092", "@654894", "@571683", "@152733", "@560526", "@166361", "@159187", "@236768", "@184817", "@176710", "@179492", "@1301649", "@410040", "@562897", "@449496", "@163172", "@4000000", "@3326197", "@563436", "@403940", "@593164", "@397467", "@208373", "@166805", "@374995", "@163506", "@159298", "@2932238", "@3133917", "@172605", "@155480", "@155628", "@361500", "@155611", "@919484", "@842167", "@758595", "@254785", "@214755", "@208940", "@185887", "@179005", "@176253", "@171776", "@169110", "@169059", "@158909", "@192255", "@343456", "@299942", "@208056", "@168204", "@881158", "@492399", "@505619", "@729863", "@184648", "@541693", "@258192", "@165186", "@163094", "@169228", "@556841", "@195116", "@391924", "@438333", "@420877", "@783547", "@303939", "@510996", "@185873", "@272402", "@692740", "@692650", "@184868", "@612415", "@605255", "@608368", "@313216", "@575497", "@522719", "@506032", "@220352", "@185529", "@185289", "@164544", "@397469", "@3380788", "@1266330", "@330967", "@584783", "@157805", "@237091", "@574183", "@176619", "@190646", "@549666", "@242291", "@295465", "@332906", "@557066", "@150664", "@560583", "@329318", "@342035", "@331344", "@175280", "@536905", "@192959", "@166056", "@1018394", "@3333223", "@3668866", "@499986", "@497965", "@492222", "@3242049", "@478236", "@447805", "@438364", "@432501", "@431433", "@425884", "@422981", "@419635", "@419369", "@419335", "@412913", "@408577", "@395961", "@395310", "@392240", "@376704", "@372419", "@336305", "@332130", "@331988", "@327743", "@320626", "@318129", "@314743", "@307324", "@305820", "@305614", "@305567", "@303151", "@295630", "@3734991", "@289865", "@286254", "@282584", "@277427", "@272518", "@271411", "@270924", "@3295967", "@261814", "@261298", "@258908", "@257324", "@250153", "@2178800", "@232678", "@231921", "@230588", "@227093", "@226266", "@225744", "@222377", "@216171"}
- ------------------------------------
- cp = {}
- ccp = 1
- map = ""
- mirror = false
- printStr = "";
- printStrIndex = 1;
- index = 0
- log = {}
- current = nil
- keyCodes = {space=32, ctrl = 17, ccp = 67}
- for i = 1, 10 do
- keyCodes[i] = 47 + i
- end
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoTimeLeft(true)
- system.bindMouse(runner, true)
- for key, value in pairs(keyCodes) do
- tfm.exec.bindKeyboard(runner, value, true, true)
- tfm.exec.bindKeyboard(runner, value, false, true)
- end
- ui.addTextArea(100, "<font color=\"#5555FF\"><a href=\"event:next\">next</a></font>", runner, 803, 0, 35, 18, 0xAAAAAA, 0x666666, 1, true)
- ui.addTextArea(101, "<font color=\"#5555FF\"><a href=\"event:save\">save</a></font>", runner, 803, 27, 35, 18, 0xAAAAAA, 0x666666, 1, true)
- ui.addTextArea(102, "<font color=\"#5555FF\"><a href=\"event:print\">print</a></font>", runner, 803, 54, 35, 18, 0xAAAAAA, 0x666666, 1, true)
- ui.addTextArea(103, "<font color=\"#5555FF\"><a href=\"event:mirror\">mirror</a></font>", runner, 803, 81, 35, 18, 0xAAAAAA, 0x666666, 1, true)
- function eventKeyboard(name, code, down)
- if down then
- current = code
- if code == keyCodes.ccp then
- ccp = #cp + 1
- draw()
- end
- else
- if code == current then
- current = nil
- end
- end
- end
- function eventMouse(name, x, y)
- if current == nil then return end
- if current >= keyCodes[1] and current <= keyCodes[10] then
- for i, xy in pairs(cp) do
- if (xy[1] - x)^2 + (xy[2] - y)^2 < 225 then
- return
- end
- end
- local ind = current - keyCodes[1] + 1
- if ind > #cp + 1 then
- ind = #cp + 1
- end
- table.insert(cp, ind, {x, y})
- if ind <= ccp then
- ccp = ccp + 1
- end
- if #cp==11 then
- table.remove(cp, 11)
- end
- draw()
- elseif current==keyCodes.ctrl then
- tfm.exec.movePlayer(runner, x, y)
- elseif current == keyCodes.ccp then
- for i, xy in pairs(cp) do
- if (xy[1] - x)^2 + (xy[2] - y)^2 < 225 then
- ccp = i
- draw()
- break
- end
- end
- elseif current == keyCodes.space then
- for i, xy in pairs(cp) do
- if (xy[1] - x)^2 + (xy[2] - y)^2 < 225 then
- table.remove(cp, i)
- if i < ccp then
- ccp = ccp - 1
- end
- draw()
- return
- end
- end
- end
- end
- function draw()
- for i = 1, 10 do
- ui.removeTextArea(i, runner)
- end
- for i = 1, ccp - 1 do
- ui.addTextArea(i, tostring(i - 1), runner, cp[i][1] - 12, cp[i][2] - 12, 25, 25, 0x91A918, 0xFFFFFF, 0.5)
- end
- for i = ccp, #cp do
- ui.addTextArea(i, "C"..(i - 1), runner, cp[i][1] - 12, cp[i][2] - 12, 25, 25, 0x91A918, 0xFFFFFF, 0.5)
- end
- end
- function eventChatCommand(name, message)
- if name~=runner then return end
- local args={}
- for arg in message:gmatch("[^%s]+") do
- table.insert(args,arg:lower())
- end
- if args[1] == "save" then
- for i, data in pairs(log) do
- if data[1] == map then
- table.remove(log, i)
- break
- end
- end
- local data;
- if mirror then
- eventChatCommand(name, "mirror");
- end
- data = copyMapData{map, cp, ccp});
- if mirror then
- eventChatCommand(name, "mirror");
- end
- table.insert(log, data);
- print("Check point saved: " .. getMapString(data) .. " mirror: " .. tostring(mirror))
- elseif args[1] == "next" then
- index = index + 1
- if index <= #maps then
- tfm.exec.newGame(maps[index])
- else
- print("no more map in the list")
- end
- elseif args[1] == "print" then
- if string.len(printStr) > printStrIndex then
- local npsi = printStrIndex + 4000;
- print(string.sub(printStr, printStrIndex, npsi) .. string.format("\n[[%d / %d]]", npsi, string.len(printStr)));
- printStrIndex = npsi + 1;
- else
- local str = {};
- for i, data in pairs(log) do
- table.insert(str, getMapString(data))
- end
- printStr = "{" .. table.concat(str, ", ") .. "}";
- printStrIndex = 1;
- eventChatCommand(name, "print");
- end
- elseif args[1] == "clear" then
- log = {}
- elseif args[1] == "delete" and args[2] then
- for i, data in pairs(log) do
- if data[1] == args[2] then
- table.remove(log, i)
- break
- end
- end
- elseif args[1] == "mirror" then
- for i, p in pairs(cp) do
- p[1] = 800 - p[1];
- end
- draw();
- elseif args[1] == "map" then
- tfm.exec.newGame(args[2]);
- end
- end
- function getMapString(data)
- local str = {}
- local cp = data[2]
- for i = 1, #(cp) do
- table.insert(str, "{" .. cp[i][1] .. ", " .. cp[i][2] .. "}")
- end
- str = table.concat(str, ", ")
- return "{\"@" .. data[1] .. "\", {" .. str .. "}, " .. data[3] .. "}"
- end
- countl = 0;
- function eventLoop()
- countl = countl + 1;
- if countl == checkReversed then
- local _sx;
- _sx = tfm.get.room.playerList[runner].x;
- if (sx - 400) * (_sx - 400) < 0 then
- eventChatCommand(runner, "mirror");
- print("mirror");
- mirror = true;
- else
- mirror = false;
- end
- draw();
- end
- end
- function eventNewGame()
- local tem;
- cp = {}
- ccp = 1
- map = tfm.get.room.xmlMapInfo.mapCode
- for i, data in pairs(log) do
- if data[1] == map then
- tem = copyMapData(data);
- cp = tem[2];
- ccp = tem[3];
- break
- end
- end
- local mapstr = "@" .. map
- for i, code in pairs(maps) do
- if code == mapstr then
- index = i
- break
- end
- end
- local str = string.upper(tfm.get.room.xmlMapInfo.xml);
- local DS = str:match("<DS%s[^%/]+%/");
- if DS then
- sx = DS:match('X%s*=%s*"(.-)"') or 0;
- else
- local T = str:match("<T%s[^%/]+%/");
- if T then
- sx = T:match('X%s*=%s*"(.-)"') or 0;
- end
- end
- sx = tonumber(sx) or -1;
- if sx >= 0 then
- print(mapstr .. "; right side:" .. tostring(sx > 400));
- end
- checkReversed = countl + 5;
- end
- function copyMapData(data)
- local d = {}
- d[1] = data[1];
- d[2] = {};
- for j, xy in pairs(data[2]) do
- d[2][j] = {table.unpack(data[2][j])};
- end
- d[3] = data[3];
- return d;
- end
- function eventPlayerDied(name)
- tfm.exec.respawnPlayer(name)
- end
- function eventTextAreaCallback(id, name, text)
- eventChatCommand(name, text)
- end
- function eventPlayerWon(name)
- eventPlayerDied(name)
- end
- oldData ={
- {"@500000", {{1, 69}, {513, 362}, {691, 290}, {510, 210}, {794, 74}, {527, 63}}, 5},
- {"@213755", {{631, 332}, {618, 197}, {415, 213}, {352, 146}, {535, 31}, {91, 168}}, 7},
- {"@213752", {{736, 300}, {546, 230}, {725, 92}, {286, 102}}, 5},
- {"@208653", {{759, 310}, {754, 177}, {204, 361}, {87, 201}}, 3},
- {"@205506", {{187, 246}, {353, 150}, {480, 161}, {763, 316}, {759, 140}}, 3},
- {"@205240", {{74, 353}, {167, 190}, {531, 340}, {582, 264}, {769, 112}, {701, 20}, {202, 290}, {33, 354}}, 7}, {"@204647", {{161, 148}, {520, 106}, {759, 37}, {571, 38}}, 5}, {"@204488", {{450, 348}, {748, 145}, {605, 61}, {447, 36}, {97, 343}}, 5}, {"@203664", {{325, 337}, {231, 220}, {540, 260}, {556, 142}, {276, 333}, {323, 206}}, 4}, {"@202574", {{302, 351}, {310, 253}, {488, 252}, {396, 156}, {422, 44}}, 5}, {"@201000", {{77, 348}, {36, 258}, {60, 73}, {770, 319}, {675, 221}, {552, 64}}, 4}, {"@195672", {{562, 327}, {743, 215}, {718, 54}, {371, 134}, {25, 359}}, 3}, {"@193662", {{737, 140}, {486, 132}, {481, 26}, {193, 245}, {170, 307}, {434, 221}, {529, 28}}, 5}, {"@192560", {{724, 328}, {719, 177}, {684, 36}, {501, 44}, {80, 330}, {87, 154}, {35, 195}, {425, 341}, {719, 361}, {719, 212}}, 7}, {"@191443", {{48, 156}, {187, 118}, {647, 369}, {757, 224}, {757, 31}}, 6}, {"@192158", {{492, 226}, {516, 26}, {253, 359}, {177, 217}}, 3}, {"@191203", {{770, 332}, {774, 162}, {590, 153}, {375, 154}, {60, 296}}, 5}, {"@191177", {{121, 333}, {116, 257}, {210, 132}, {406, 107}, {764, 171}}, 5}, {"@185428", {{476, 247}, {459, 181}, {401, 74}, {656, 30}}, 2}, {"@183139", {{558, 367}, {607, 285}, {716, 176}, {522, 111}, {150, 347}, {472, 40}}, 5}, {"@182769", {{760, 318}, {509, 147}, {155, 322}, {103, 211}}, 3}, {"@180801", {{189, 149}, {204, 28}, {414, 148}, {488, 336}, {359, 258}}, 4}, {"@176507", {{333, 184}, {509, 149}, {533, 47}, {176, 202}}, 4}, {"@175204", {{771, 315}, {794, 133}, {196, 342}, {101, 207}, {281, 101}}, 5}, {"@172951", {{772, 350}, {771, 156}, {291, 232}, {491, 137}, {619, 77}, {166, 365}}, 6}, {"@172520", {{750, 329}, {716, 207}, {462, 166}, {390, 59}}, 4}, {"@172512", {{241, 227}, {165, 116}, {151, 23}, {728, 25}, {651, 137}}, 6}, {"@172501", {{542, 337}, {744, 295}, {766, 165}, {716, 67}}, 5}, {"@171148", {{420, 260}, {721, 336}, {768, 333}, {721, 118}}, 3}, {"@169076", {{51, 208}, {373, 309}, {382, 203}, {765, 121}, {422, 304}}, 5}, {"@166430", {{498, 294}, {770, 308}, {629, 122}, {219, 246}, {24, 255}}, 3}, {"@163159", {{387, 315}, {436, 291}, {601, 199}, {244, 150}, {450, 114}, {726, 69}}, 3}, {"@160841", {{347, 361}, {237, 272}, {30, 359}, {-10, 262}, {65, 185}, {28, 137}, {214, 107}, {385, 92}}, 9}, {"@157960", {{70, 341}, {20, 340}, {20, 275}, {18, 130}, {23, 38}}, 1},
- {"@157203", {{504, 349}, {553, 349}, {660, 236}, {716, 54}, {142, 343}, {-15, 312}}, 5}, {"@157004", {{346, 245}, {393, 120}, {218, 29}, {717, 339}, {773, 316}, {743, 171}}, 4}, {"@151655", {{717, 297}, {738, 22}, {332, 250}, {287, 190}, {9, 199}, {16, 100}, {312, 115}}, 7}, {"@2329940", {{169, 217}, {212, 24}, {481, 293}, {288, 353}, {567, 352}, {317, 293}, {783, 142}, {610, 22}, {279, 208}}, 5}, {"@4445580", {{391, 227}, {762, 141}, {213, 86}, {154, 101}, {366, 206}}, 4}, {"@886744", {{232, 256}, {469, 340}, {499, 235}, {733, 80}, {422, 145}, {155, 161}}, 3}, {"@330933", {{615, 330}, {678, 329}, {700, 129}, {587, 88}, {541, 84}, {428, 211}, {380, 78}, {218, 129}}, 6}, {"@179807", {{647, 322}, {696, 158}, {771, 310}, {738, 181}, {582, 147}, {399, 239}}, 3}, {"@177652", {{753, 354}, {751, 282}, {270, 287}, {166, 82}, {344, 21}}, 5}, {"@206396", {{482, 352}, {498, 143}, {650, 147}, {697, 137}, {570, 27}, {215, 170}}, 6}, {"@179488", {{751, 329}, {747, 160}, {778, 62}, {502, 68}, {133, 268}}, 4}, {"@1427980", {{697, 212}, {546, 87}, {72, 151}, {340, 257}, {487, 163}, {314, 101}}, 3}, {"@815336", {{117, 346}, {204, 294}, {695, 161}, {466, 36}, {450, 324}, {173, 347}}, 4}, {"@161434", {{232, 211}, {312, 61}, {743, 367}, {789, 302}, {740, 259}, {764, 144}, {195, 371}, {8, 287}}, 6}, {"@216173", {{704, 247}, {767, 41}, {598, 128}, {355, 108}, {235, 244}, {6, 241}, {202, 287}, {318, 207}, {541, 268}, {730, 77}}, 6}, {"@172621", {{346, 367}, {393, 255}, {414, 155}, {687, 236}, {685, 98}, {523, 82}, {412, 72}}, 8}, {"@592189", {{615, 357}, {651, 88}, {390, 80}, {156, 54}, {110, 53}}, 3}, {"@168754", {{793, 33}, {129, 370}, {192, 314}, {252, 284}, {329, 271}}, 2}, {"@512887", {{391, 91}, {655, 81}, {457, 353}, {527, 175}, {739, 359}, {622, 83}, {294, 290}}, 5}, {"@306365", {{173, 196}, {215, 38}, {362, 351}, {409, 352}, {432, 252}, {462, 125}, {733, 101}, {596, 267}, {788, 327}, {704, 233}}, 7}, {"@2130169", {{14, 257}, {42, 101}, {434, 43}, {744, 168}, {520, 169}, {741, 368}}, 7}, {"@410045", {{450, 365}, {494, 300}, {251, 102}, {81, 140}, {59, 49}, {471, 240}, {721, 363}, {741, 249}}, 6}, {"@186066", {{490, 300}, {478, 190}, {530, 22}, {722, 100}, {140, 353}, {27, 305}, {41, 20}, {268, 191}, {357, 148}}, 4}, {"@2636519", {{759, 192}, {428, 173}, {720, 59}, {661, 103}, {204, 174}}, 4}, {"@263819", {{57, 276}, {66, 43}, {221, 182}, {374, 42}, {737, 39}, {631, 118}, {736, 340}, {480, 291}}, 8}, {"@528032", {{299, 105}, {331, 29}, {509, 81}, {576, 72}, {740, 39}, {160, 356}, {172, 277}, {34, 284}}, 8}, {"@511136", {{127, 253}, {163, 130}, {184, 42}, {455, 31}, {724, 113}}, 6}, {"@295932", {{566, 362}, {568, 254}, {580, 124}, {743, 58}, {697, 189}, {652, 188}, {725, 193}, {762, 111}, {602, 78}}, 6}, {"@271193", {{151, 303}, {185, 210}, {203, 92}, {308, 271}, {336, 70}, {440, 88}, {525, 64}, {744, 349}, {764, 245}, {726, 95}}, 8}, {"@3988424", {{299, 264}, {90, 80}, {644, 33}, {701, 83}, {518, 189}, {696, 263}, {556, 187}, {582, 32}}, 6}, {"@166032", {{687, 330}, {741, 316}, {736, 178}, {677, 40}, {357, 225}, {144, 254}, {1, 257}, {109, 36}, {639, 286}}, 9}, {"@460961", {{762, 377}, {705, 190}, {656, 155}, {651, 82}, {412, 163}, {286, 121}, {128, 78}, {420, 356}}, 8}, {"@315666", {{795, 178}, {106, 376}, {86, 296}, {85, 212}, {28, 39}, {350, 156}, {399, 157}, {445, 67}, {622, 94}}, 8}, {"@162482", {{634, 314}, {570, 193}, {722, 123}, {734, 52}, {547, 54}, {87, 310}}, 6}, {"@316012", {{163, 231}, {737, 370}, {644, 274}, {757, 179}, {646, 179}, {450, 220}, {346, 194}, {311, 71}}, 5}, {"@304861", {{64, 154}, {165, 64}, {365, 330}, {392, 328}, {438, 330}, {595, 263}, {589, 131}, {612, 45}}, 4}
- };
- if oldData then
- for i, data in pairs(oldData) do
- data[1] = tonumber(string.sub(data[1], 2));
- end
- log = oldData;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement