Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --MOVIEMAKER
- --WRITTEN BY GAMAX92
- --VER 1.0 UPDATE http://pastebin.com/raw.php?i=qhE2QGm9
- --
- --NUCULAR'S MOD
- --i've only modified it for png support and fixed a few graphical glitches.
- --based on official version 1.6
- --all changes made by me are commented.
- --all rights for this script are going to gamax92.
- --HACKSTRIFE'MOD
- -- Added quality setting and fixed compatibility with latest ffmpeg version
- -- Based on nucular's mod and official version 1.6
- -- Changes are commented and prefixed with "%%"
- -- Credit goes to nucular and gamax92
- qual = 3 -- default quality bigger is worse ranges from 1 to 31
- nob = 6
- recording = 0
- recordfps = 25 -- more realistic fps
- recordframes = 0
- recordft = ".avi"
- recorduiseen = 0
- recorduitype = 0
- if package.config:sub(1,1) == "\\" then
- recordds = "\\"
- else
- recordds = "/"
- end
- uix = (612 / 2) - (146 / 2)
- uiy = (384 / 2) - (58 / 2)
- function tpt.recordsui()
- tpt.fillrect(612,nob * 16,14,14) -- fixed the fillrect-glitch in tptpp
- tpt.drawtext(618,nob * 16 + 5,"S",0,0,0)
- recordframes = recordframes + 1
- tpt.drawtext(5,385,tostring(math.floor(recordframes / recordfps)) .. "s") -- show real seconds in result - divide by recordfps not by 60
- end
- function tpt.recordui()
- if recorduiseen == 1 then
- tpt.fillrect(uix,uiy,146,58,0,0,0) -- fixed the fillrect-glitch in tptpp
- tpt.drawrect(uix,uiy,146,58)
- tpt.drawrect(uix + 107, uiy + 2, 37, 12)
- if recorduitype == 0 then
- tpt.drawtext(uix + 109, uiy + 5, "Options")
- tpt.drawrect(uix + 2, uiy + 2, 12, 12)
- tpt.drawrect(uix + 54, uiy + 2, 12, 12)
- if recordft == ".avi" then
- tpt.fillrect(uix + 2, uiy + 2, 10, 10, 0, 255, 0) -- fixed the fillrect-glitch in tptpp
- tpt.fillrect(uix + 54, uiy + 2, 10, 10, 0, 63, 0) -- fixed the fillrect-glitch in tptpp
- else
- tpt.fillrect(uix + 2, uiy + 2, 10, 10, 0, 63, 0) -- fixed the fillrect-glitch in tptpp
- tpt.fillrect(uix + 54, uiy + 2, 10, 10, 0, 255, 0) -- fixed the fillrect-glitch in tptpp
- end
- tpt.drawrect(uix + 2, uiy + 16, 70, 12)
- tpt.drawrect(uix + 74, uiy + 16, 70, 12)
- tpt.drawrect(uix + 2, uiy + 30, 70, 12)
- tpt.drawrect(uix + 74, uiy + 30, 70, 12)
- tpt.drawrect(uix + 2, uiy + 44, 142, 12)
- tpt.drawtext(uix + 16, uiy + 5, "AVI Out")
- tpt.drawtext(uix + 68, uiy + 5, "GIF Out")
- tpt.drawtext(uix + 9, uiy + 18, "Clean folder")
- tpt.drawtext(uix + 76, uiy + 18, "Start recording")
- tpt.drawtext(uix + 13, uiy + 32, "Select AVI")
- tpt.drawtext(uix + 85, uiy + 32, "Select GIF")
- tpt.drawtext(287, uiy + 47, "CREATE!")
- else
- tpt.drawtext(uix + 115, uiy + 5, "Main")
- tpt.drawrect(uix + 49, uiy + 16, 12, 12)
- tpt.drawrect(uix + 63, uiy + 16, 19, 12)
- tpt.drawrect(uix + 84, uiy + 16, 12, 12)
- tpt.drawtext(uix + 2, uiy + 19, "FPS:")
- tpt.drawline(uix + 52, uiy + 22, uix + 58, uiy + 22)
- tpt.drawtext(uix + (72 - (tpt.textwidth(tostring(recordfps)) / 2)), uiy + 19, tostring(recordfps))
- tpt.drawline(uix + 87, uiy + 22, uix + 93, uiy + 22)
- tpt.drawline(uix + 90, uiy + 19, uix + 90, uiy + 25)
- -- %%quality menu part
- tpt.drawrect(uix + 49, uiy + 32, 12, 12)
- tpt.drawrect(uix + 63, uiy + 32, 19, 12)
- tpt.drawrect(uix + 84, uiy + 32, 12, 12)
- tpt.drawtext(uix + 2, uiy + 35, "QUALITY:")
- tpt.drawline(uix + 52, uiy + 38, uix + 58, uiy + 38)
- tpt.drawtext(uix + (72 - (tpt.textwidth(tostring(qual)) / 2)), uiy + 35, tostring(qual))
- tpt.drawline(uix + 87, uiy + 38, uix + 93, uiy + 38)
- tpt.drawline(uix + 90, uiy + 35, uix + 90, uiy + 41)
- end
- end
- tpt.drawrect(613,nob * 16 + 1,14,14)
- tpt.drawtext(618,nob * 16 + 5,"S")
- end
- function tpt.recordmouse(x,y,b,e)
- if recording == 1 and x > 612 and y > (nob * 16) and x < 629 and y < (nob * 16 + 16) and b == 1 and e == 1 then
- tpt.unregister_step(tpt.recordsui)
- tpt.unregister_step(tpt.screenshot)
- tpt.register_step(tpt.recordui)
- tpt.set_pause(1)
- recording = 0
- recorduiseen = 1
- elseif recording == 0 and x > 612 and y > (nob * 16) and x < 629 and y < (nob * 16 + 16) and b == 1 and e == 1 then
- recorduiseen = math.mod(recorduiseen + 1, 2)
- tpt.set_pause(recorduiseen)
- end
- if x > uix + 106 and y > uiy + 1 and x < uix + 148 and y < uiy + 15 and b == 1 and e == 1 then
- recorduitype = math.mod(recorduitype + 1, 2)
- end
- if b == 1 and e == 1 and recorduiseen == 1 and recorduitype == 0 then
- if x > uix + 1 and y > uiy + 15 and x < uix + 73 and y < uiy + 29 then
- -- deleting only screenshot pngs
- if recordds == "\\" then
- os.execute("del screenshot_*.png")
- else
- os.execute("rm screenshot_*.png")
- end
- recordframes = 0
- --%small bugfix
- elseif x > uix + 73 and y > uiy + 15 and x < uix + 145 and y < uiy + 29 then
- tpt.unregister_step(tpt.recordui)
- tpt.register_step(tpt.recordsui)
- tpt.register_step(tpt.screenshot)
- tpt.set_pause(0)
- recording = 1
- recorduiseen = 0
- elseif x > uix + 1 and y > uiy + 29 and x < uix + 73 and y < uiy + 43 then
- recordft = ".avi"
- elseif x > uix + 73 and y > uiy + 29 and x < uix + 145 and y < uiy + 43 then
- recordft = ".gif"
- elseif x > uix + 1 and y > uiy + 43 and x < uix + 145 and y < uiy + 57 then
- videocount = 1
- while io.open("Videos" .. recordds .. "tptvideo" .. string.format("%04d",videocount) .. ".*", "rb") ~= nil do
- videocount = videocount + 1
- end
- os.execute("ffmpeg -r " .. tostring(recordfps) .. " -i screenshot_%06d.png -q:v " .. tostring(qual) .. " Videos" .. recordds .. "tptvideo" .. string.format("%04d",videocount).. recordft)
- -- working png converting
- -- %%updated with variable quality support '-q:v" .. qual ..'
- end
- elseif b == 1 and e == 1 and recorduiseen == 1 and recorduitype == 1 then
- if x > uix + 48 and y > uiy + 15 and x < uix + 61 and y < uiy + 29 then
- if recordfps > 1 then recordfps = recordfps - 1 end
- elseif x > uix + 83 and y > uiy + 15 and x < uix + 96 and y < uiy + 29 then
- if recordfps < 60 then recordfps = recordfps + 1 end
- -- %% quality menu mouse click check
- elseif x > uix + 48 and y > uiy + 33 and x < uix + 61 and y < uiy + 48 then
- if qual > 1 then qual = qual - 1 end
- elseif x > uix + 83 and y > uiy + 33 and x < uix + 96 and y < uiy + 48 then
- if qual < 31 then qual = qual + 1 end
- end
- end
- end
- tpt.register_step(tpt.recordui)
- tpt.register_mouseclick(tpt.recordmouse)
Add Comment
Please, Sign In to add comment