Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- movie_beginning: contains a long string
- -- how the movie must start
- movie_beginning = [[version 1
- emuVersion 90900
- rerecordCount 305
- romFilename 0006 Polarium (US).nds
- romChecksum 9B49BD53
- romSerial NTR-ASNE-USA
- guid 84BE2329-6CE1-AED6-9052-49F1F1BBE9EB
- useExtBios 0
- advancedTiming 1
- useExtFirmware 0
- firmNickname yopyop
- firmMessage DeSmuME makes you happy!
- firmFavColour 10
- firmBirthMonth 7
- firmBirthDay 15
- firmLanguage 1
- rtcStartNew 2009-JAN-01 00:00:00:000
- comment author partyboy1a
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............152 126 1|
- |0|.............152 126 1|
- |0|.............152 126 1|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............240 096 1|
- |0|.............240 096 1|
- |0|.............240 096 1|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............162 011 1|
- |0|.............162 011 1|
- |0|.............162 011 1|
- |0|.............000 000 0|
- |0|.............130 071 1|
- |0|.............130 071 1|
- |0|.............130 071 1|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............175 111 1|
- |0|.............175 111 1|
- |0|.............175 111 1|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|
- |0|.............000 000 0|]]
- -- x_offset: x position of the leftmost tile
- x_offset = {
- 0,
- 88,
- 80,
- 72,
- 64,
- 56,
- 48,
- 40,
- 32
- }
- -- y_offset: y position of the topmost tile
- y_offset = {
- 0,
- 64,
- 56,
- 48,
- 40,
- 32,
- 24,
- 16,
- 8
- }
- -- empty_line: contents of a line without any input
- empty_line = [[|0|.............000 000 0|
- ]]
- -- start_line: contents of a line where start is pressed
- start_line = [[|0|.....S.......000 000 0|
- ]]
- level_one_x = 56
- level_one_y = 88
- ok_x = 174
- ok_y = 112
- ten_levels_y_offset = 8
- function writepos(x,y)
- local s="|0|............."
- if x < 10 then s=s.."0" end
- if x < 100 then s=s.."0" end
- s=s..x.." "
- if y < 10 then s=s.."0" end
- if y < 100 then s=s.."0" end
- s = s..y..[[ 1|
- ]]
- file:write(s)
- end
- function convert_to_input(filename, cancel_early)
- dofile(filename)
- off_x = x_offset[SolutionPath.cols]
- off_y = y_offset[SolutionPath.rows]
- for i, tab in ipairs(SolutionPath) do
- if tab.x ~= nil then
- newx, newy = tab.x+off_x, tab.y+off_y
- writepos(newx,newy)
- elseif cancel_early then
- return i-1
- else
- file:write(empty_line)
- end
- end
- end
- -- how many frames to wait after each level
- looptab = {
- --1 to 10
- 113,113,113,113,117,
- 113,117,117,117,117,
- --11 to 20
- 113,117,117,113,113,
- 113,113,117,109,113,
- --21 to 30
- 121,117,121,121,121,
- 121,121,121,121,121,
- --31 to 40
- 117,121,117,113,113,
- 117,117,121,113,113,
- --41 to 50
- 113,121,121,121,121,
- 117,121,117,121,121,
- --51 to 60
- 121,121,121,121,121,
- 121,121,121,121,121,
- --61 to 70
- 121,121,121,121,117,
- 121,121,121,117,121,
- --71 to 80
- 121,117,121,121,121,
- 121,117,117,121,121,
- --81 to 90
- 117,117,117,117,117,
- 117,117,117,117,117,
- --91 to 100
- 121,117,121,121,117,
- 121,121,121,121,1,
- }
- file = io.open("automovie.dsm", "w")
- file:write(movie_beginning)
- for i = 1,100 do
- if i < 10 then
- filename="luabot_fastest_puzzle_00"..i
- elseif i < 100 then
- filename="luabot_fastest_puzzle_0"..i
- else --i == 100
- filename="luabot_fastest_puzzle_100"
- end
- convert_to_input(filename)
- --[[
- loops = 117
- if i < 5 then loops = 113 end
- if i >= 21 and i <= 30 and i ~= 22 then loops = 121 end
- if i == 32 or i == 38 then loops = 125 end
- --]]
- -- set to 1, 11, 21, ... 91
- -- to verify that the menu has been activated
- -- as early as possible
- test_from = 101
- test_to = test_from + 9
- -- test even levels (remainder == 0) or uneven levels (remainder == 1)
- test_remainder = 0
- if i >= test_from and i <= test_to and i % 2 == test_remainder then
- subtract = 1
- else
- subtract = 0
- end
- file:write(empty_line)
- loops = looptab[i] - convert_to_input(filename, true) - 1 - subtract
- if i==100 then break end
- for j=1,loops do file:write(empty_line) end
- file:write(start_line)
- file:write(start_line)
- for j=1,57 do file:write(empty_line) end
- new=i+1
- if new < 51 then
- for j=1,3 do
- writepos(level_one_x+16*((new-1)%10), level_one_y+8*math.floor((new-1)/10))
- end
- file:write(empty_line)
- elseif new == 51 then
- for j=1,3 do
- writepos(216,98)
- end
- for j=1,78 do
- file:write(empty_line)
- end
- ok_y = 112
- else --new > 51
- for j=1,3 do
- writepos(level_one_x+16*((new-51)%10), level_one_y+8*math.floor((new-51)/10))
- end
- file:write(empty_line)
- end
- if new==21 or new==71 then ok_y=130 end
- if new==41 or new==91 then ok_y=144 end
- for j=1,3 do writepos(ok_x, ok_y) end
- loops = 37
- for j=1,loops do file:write(empty_line) end
- end
- io.close(file)
Add Comment
Please, Sign In to add comment