Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Put the script runner's name here
- runner = "Gekkeiju"
- ---last update: 24/10/2015
- --If you have map list, put it here. You can load them by the button "next". I gathered all the P3 maps here on 24/10/2015.
- 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 = ""
- 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)
- 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
- table.insert(log, {map, cp, ccp})
- print("Check point saved: " .. getMapString({map, cp, ccp}))
- 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
- local str={}
- for i, data in pairs(log) do
- table.insert(str, getMapString(data))
- end
- print("{" .. table.concat(str, ", ") .. "}")
- 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
- 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
- function eventNewGame()
- cp = {}
- ccp = 1
- map = tfm.get.room.xmlMapInfo.mapCode
- for i, data in pairs(log) do
- if data[1] == map then
- cp = data[2]
- ccp = data[3]
- break
- end
- end
- draw()
- end
- function eventPlayerDied(name)
- tfm.exec.respawnPlayer(name)
- end
- function eventTextAreaCallback(id, name, text)
- eventChatCommand(name, text)
- end
- function eventPlayerWon(name)
- eventPlayerDied(name)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement