Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pkg = {
- vmail = "--Variables!@#&_logo = paintutils.loadImage(\"vmail_logo\")!@#&messageGUI = paintutils.loadImage(\"new_message_GUI\")!@#&Space = \" \"!@#&from_string = \"From: \"!@#&message_string = \"Message: \"!@#&Version = \"Developers: Beta 1.0\"!@#&!@#&--Functions!@#&function test()!@#& term.setCursorPos(10,10)!@#& write(\"TEST\")!@#&end!@#&!@#&function back()!@#&clean()!@#& draw()!@#& while true do!@#& parallel.waitForAny(listen, mouse_main)!@#& end!@#&end!@#&!@#&function new()!@#& --Start!@#& clean()!@#& term.setBackgroundColor(512)!@#& term.setCursorPos(1,6)!@#& write(\"Message:\")!@#& term.setCursorPos(45,1)!@#& write(\"[Quit]\")!@#& term.setCursorPos(10,1)!@#& write(\"[Send]\")!@#& term.setCursorPos(1,1)!@#& write(\"[Cancel]\")!@#& term.setCursorPos(1,4)!@#& write(\"From: \")!@#& term.setCursorPos(1,3)!@#& write(\"To: \")!@#& term.setCursorPos(5,3)!@#& to_input = read()!@#& term.setCursorPos(7,4)!@#& from_input = read()!@#& term.setCursorPos(9,6)!@#& message_input = read()!@#& mouse_new()!@#&end!@#&!@#&function mouse_new()!@#& while true do!@#& local event, button, xPos, yPos = os.pullEvent(\"mouse_click\")!@#& if _ms == 0 and button == 1 and xPos < 9 and yPos == 1 then!@#& back()!@#& end!@#& !@#& if _ms == 0 and button == 1 and xPos < 16 and xPos > 8 and yPos == 1 then!@#& send()!@#& end!@#& !@#& if _ms == 0 and button == 1 and xPos >= 45 and xPos <= 50 and yPos == 1 then!@#& quit()!@#& end!@#& end!@#&end!@#&!@#&function mouse_bugs()!@#&_ms = 0!@#&local event, button, xPos, yPos = os.pullEvent(\"mouse_click\")!@#& while true do!@#& if _ms == 0 and button == 1 and xPos <= 6 and yPos == 1 then!@#& back()!@#& end!@#& end!@#&end!@#&!@#&function mouse_help()!@#& while true do!@#& local event, button, xPos, yPos = os.pullEvent(\"mouse_click\")!@#& if _ms == 0 and button == 1 and xPos <= 7 and yPos == 1 then!@#& back()!@#& end!@#& !@#& if _ms == 0 and button == 1 and xPos >= 45 and xPos <= 50 and yPos == 1 then!@#& quit()!@#& end!@#& end!@#&end!@#&!@#&function mouse_main()!@#& _ms = 0!@#& while true do!@#& local event, button, xPos, yPos = os.pullEvent(\"mouse_click\")!@#& if _ms == 0 and button == 1 and xPos < 6 and yPos == 1 then!@#& new()!@#& end!@#& !@#& if _ms == 0 and button == 1 and xPos >= 45 and xPos <= 50 and yPos == 1 then!@#& quit()!@#& end!@#& !@#& if _ms == 0 and button == 1 and xPos >= 9 and xPos <= 16 and yPos == 1 then !@#& restart()!@#& end!@#& !@#& if _ms == 0 and button == 1 and xPos >= 19 and xPos <= 27 and yPos == 1 then!@#& help()!@#& end!@#& !@#& if _ms == 0 and button == 1 and xPos >= 28 and xPos <= 34 and yPos == 1 then!@#& bugs()!@#& end!@#& !@#& end!@#&end!@#&!@#&function clean()!@#& term.clear()!@#& term.setCursorPos(1,1)!@#&end!@#&!@#&function help()!@#& clean()!@#& paintutils.drawLine(1,1,100,1,512)!@#& term.setCursorPos(45,1)!@#& write(\"[Quit]\")!@#& term.setCursorPos(1,1)!@#& write(\"[Back]\")!@#& term.setCursorPos(1,3)!@#& write(\"FAQ: \")!@#& term.setCursorPos(1,5)!@#& write(\"Q: 1. While making an E-mail why can't I hit cancel in the middle of making it?\")!@#& term.setCursorPos(1,8)!@#& write(\"A: You have to finish making the E-Mail to cancel it because of the way it is coded.\")!@#& term.setCursorPos(1,9)!@#& write(\"Q: 2. What do I enter for To?\")!@#& term.setCursorPos(1,11)!@#& write(\"A: You enter the ID number for the computer you are trying to contact with.\")!@#& term.setCursorPos(1,16)!@#& write(\"If you have anymore questions please report them in bugs!\")!@#& mouse_help()!@#&end!@#&!@#&function start()!@#& --rednet.open(\"back\")!@#& term.setBackgroundColor(black)!@#& paintutils.drawImage(_logo, 10,5)!@#& sleep(1.2)!@#& clean()!@#&end!@#&!@#&function quit()!@#& clean()!@#& write(\"Thank you for using VinCore Programs\")!@#& sleep(1)!@#& os.reboot()!@#&end!@#&!@#&function bugs()!@#& clean()!@#& term.setCursorPos(1,1)!@#& write(\"[Back]\")!@#& term.setCursorPos(1,3)!@#& write(\"Please email: [email protected]\")!@#& term.setCursorPos(1,5)!@#& write(\"I will try to put out an update ASAP with that bug fixed if it is a major problem with the program.\")!@#& term.setCursorPos(1,7)!@#& write(\"You may also ask any questions on this email.\")!@#& term.setCursorPos(1,9)!@#& write(\"Thanks for reporting the bug!\")!@#& mouse_bugs()!@#&end!@#&!@#&function draw()!@#& clean()!@#& term.setBackgroundColor(512)!@#& paintutils.drawLine(1,1,100,1,512)!@#& paintutils.drawLine(1,1,100,1,512)!@#& term.setCursorPos(45,1)!@#& write(\"[Quit]\")!@#& term.setCursorPos(1,1)!@#& write(\"[New]\")!@#& term.setCursorPos(9, 1)!@#& write(\"[Reset]\") --25!@#& term.setCursorPos(19, 1)!@#& write(\"[Help]\")!@#& term.setCursorPos(28, 1)!@#& write(\"[Bugs]\")!@#& term.setCursorPos(10,10)!@#& term.setBackgroundColor(512)!@#& term.setCursorPos(1,3)!@#& write(\"Recent E-Mails: \")!@#& term.setCursorPos(32,19)!@#& write(Version)!@#&end!@#&!@#&function restart()!@#& clean()!@#& shell.run(\"vmail\")!@#&end!@#&!@#&function send()!@#& Send_String = from_string ..from_input ..Space ..message_input!@#& sendingN = tonumber(to_input)!@#& rednet.send(sendingN, Send_String)!@#& clean()!@#& term.setBackgroundColor(8192)!@#& write(\"Message sent...\")!@#& term.setCursorPos(1,3)!@#& sleep(1)!@#& back()!@#&end!@#&!@#&function recieve()!@#& counter = 5!@#& while true do!@#& ID, Message = rednet.receive()!@#& term.setCursorPos(1,counter)!@#& write(Message)!@#& end!@#&end!@#&!@#&function listen()!@#& counter = 5!@#& ID, Message = rednet.receive()!@#& counter = counter + 1!@#& term.setCursorPos(1, counter)!@#& write(Message)!@#&end!@#&!@#&function main()!@#& clean()!@#& start()!@#& draw()!@#& while true do!@#& parallel.waitForAny(listen, mouse_main)!@#& end!@#&end!@#&!@#&--Main!@#&main()",
- vmail_logo = "80000000000000000000000000008!@#&88000000000000000000000000888!@#&00880000000000000000000088800!@#&00088800000000000000088880000!@#&00000088800000000008880000000!@#&00000000888800000088000000000!@#&00000000000888888880000000000!@#&00000000000000000000000000000!@#&00000000000000000000000000000!@#&00000000000000000000000000000!@#&00000000000000000000000000000!@#&00000000000000000000000000000",
- startup = "rednet.open(\"back\")",
- pm = "sPackage = \"local pkg = %@1 local function makeFile(_path, _content) local file = fs.open(_path, \\\"w\\\") _content = _content:gsub(\\\"\\!@\\\"..\\\"#&\\\", \\\"%\\\\n\\\") _content = textutils.unserialize(_content) file.write(_content) file.close() end local function makeFolder(_path, _content) fs.makeDir(_path) for k,v in pairs(_content) do if type(v) == \\\"table\\\" then makeFolder(_path .. \\\"/\\\" .. k, v) else makeFile(_path .. \\\"/\\\" .. k, v) end end end local sDest = shell.resolve( \\\"%@2\\\" ) or \\\"/\\\" if sDest == \\\"root\\\" then sDest = \\\"/\\\" end local tPackage = pkg makeFolder(sDest, tPackage) print(\\\"Package Extracted to '\\\" .. sDest .. \\\"'!\\\")\"!@#&!@#&function addFile(_package, _path)!@#& if fs.getName(_path) == \".DS_Store\" then!@#& return _package!@#& end!@#& local file, err = fs.open(_path, \"r\")!@#& local content = file.readAll()!@#& content = content:gsub(\"%\\n\", \"\\!@\"..\"#&\")!@#& content = content:gsub(\"%%\", \"%%%%\")!@#& _package[fs.getName(_path)] = content!@#& file.close()!@#& print(\"Added file '\".._path..\"'\")!@#& return _package!@#&end!@#&!@#&function addFolder(_package, _path)!@#& if string.sub(_path,1,string.len(\"rom\"))==\"rom\" or string.sub(_path,1,string.len(\"/rom\"))==\"/rom\" then!@#& print(\"Ignored 'rom' folder. (\".._path..\")\")!@#& return!@#& end!@#& _package = _package or {}!@#& for _,f in ipairs(fs.list(_path)) do!@#& local path = _path..\"/\"..f!@#& if fs.isDir(path) then!@#& _package[fs.getName(f)] = addFolder(_package[fs.getName(f)], path)!@#& else!@#& _package = addFile(_package, path)!@#& end!@#& end!@#& return _package!@#&end!@#&!@#&local tArgs = { ... }!@#&if #tArgs < 2 then!@#& print( \"Usage: PkgMake <source> <destination>\" )!@#& return!@#&end!@#&!@#&local sSource = shell.resolve( tArgs[1] )!@#&local sDest = shell.resolve( tArgs[2] )!@#&!@#&if fs.isDir( sDest ) then!@#& error(\"Destination must not be a folder.\")!@#&end!@#&!@#&if sSource == sDest then!@#& error(\"Source can not be equal to destination.\")!@#&end!@#&!@#&if fs.exists( sSource ) and fs.isDir( sSource ) then!@#& tPackage = {}!@#& tPackage = addFolder(tPackage, sSource)!@#& fPackage = fs.open(sDest,\"w\")!@#&!@#& sPackage = string.gsub(sPackage, \"%%@2\", fs.getName(sSource))!@#& sPackage = string.gsub(sPackage, \"%%@1\", textutils.serialize(tPackage))!@#& fPackage.write(sPackage)!@#& fPackage.close()!@#& print(\"Package Done! ('\" .. sDest .. \"')\")!@#& print(\"Type '\" .. sDest .. \"' to run it.\")!@#&else!@#& error(\"Source does not exist or is not a folder.\")!@#&end",
- } local function makeFile(_path, _content) local file = fs.open(_path, "w") _content = _content:gsub("!@".."#&", "%\n") _content = textutils.unserialize(_content) file.write(_content) file.close() end local function makeFolder(_path, _content) fs.makeDir(_path) for k,v in pairs(_content) do if type(v) == "table" then makeFolder(_path .. "/" .. k, v) else makeFile(_path .. "/" .. k, v) end end end local sDest = shell.resolve( "root" ) or "/" if sDest == "root" then sDest = "/" end local tPackage = pkg makeFolder(sDest, tPackage) print("Package Extracted to '" .. sDest .. "'!")
Advertisement
Add Comment
Please, Sign In to add comment