Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variables
- _logo = paintutils.loadImage("vmail_logo")
- Space = " "
- from_string = "From: "
- Version = "Released"
- Last_Updated = "4/17/15"
- --Functions
- function test()
- --Test for mouse functions
- term.setCursorPos(10,10)
- write("TEST")
- end
- function update()
- local pastebinProgram = "pQgiZ5PT"
- local pastebinLogo = "1ncH36PP"
- drawColors()
- fs.delete("vmail_logo")
- shell.run("pastebin", "get", pastebinLogo, "vmail_logo")
- fs.delete("vmail")
- shell.run("pastebin", "get", pastebinProgram, "vmail")
- end
- function back()
- clean()
- draw()
- while true do
- parallel.waitForAny(listen, mouse_main)
- return
- end
- end
- function new()
- --Start
- clean()
- drawColors()
- term.setCursorPos(45,1)
- write("[Quit]")
- term.setCursorPos(10,1)
- write("[Send]")
- term.setCursorPos(1,1)
- write("[Cancel]")
- term.setBackgroundColor(colors.cyan)
- term.setCursorPos(1,6)
- write("Message:")
- term.setCursorPos(1,4)
- write("From: ")
- term.setCursorPos(1,3)
- write("ID: ")
- term.setCursorPos(5,3)
- to_input = read()
- term.setCursorPos(7,4)
- from_input = read()
- term.setCursorPos(10,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()
- 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
- back()
- end
- if _ms == 0 and button == 1 and xPos >= 8 and xPos <= 15 and yPos == 1 then
- email_bugs()
- end
- end
- end
- function mouse_gen()
- 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_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
- if _ms == 0 and button == 1 and xPos >= 1 and xPos <= 13 and yPos == 3 then
- email_bugs()
- 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 <= 15 and yPos == 1 then
- restart()
- end
- if _ms == 0 and button == 1 and xPos >= 19 and xPos <= 28 and yPos == 1 then
- help()
- end
- if _ms == 0 and button == 1 and xPos >= 28 and xPos <= 34 and yPos == 1 then
- bugs()
- end
- if _ms == 0 and button == 1 and xPos >= 36 and xPos <= 50 and yPos == 19 then
- noticeboard()
- end
- if _ms == 0 and button == 1 and xPos >= 36 and xPos <= 43 and yPos == 1 then
- clean()
- draw()
- while true do
- parallel.waitForAny(listen, mouse_main)
- end
- end
- end
- end
- function mouse_email_bugs()
- _ms = 0
- 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_email()
- end
- if _ms == 0 and button == 1 and xPos >= 45 and xPos <= 50 and yPos == 1 then
- quit()
- end
- end
- end
- function clean()
- term.clear()
- term.setCursorPos(1,1)
- end
- function listen()
- local counter = 2
- local Event, ID, Message, Distance = os.pullEvent("rednet_message")
- clean()
- draw()
- term.setCursorPos(1, 5)
- write("Sender's ID: " ..ID .."\n" ..Message)
- return
- end
- function noticeboard()
- clean()
- drawColors()
- term.setCursorPos(45,1)
- write("[Quit]")
- term.setCursorPos(1,1)
- write("[Back]")
- term.setBackgroundColor(colors.cyan)
- term.setCursorPos(1,3)
- write("Sorry that it has been a long time since I have")
- term.setCursorPos(1, 4)
- write("updated this program.")
- term.setCursorPos(1, 5)
- write("I will try to get back into it.")
- term.setCursorPos(1,6)
- write("For those who question why I have been away")
- term.setCursorPos(1,7)
- write("I have been working on a game in C++ that will be")
- term.setCursorPos(1,8)
- write("on Steam and XBLA.")
- term.setCursorPos(1, 10)
- write(" VinCore Programs")
- mouse_gen()
- end
- function help()
- clean()
- drawColors()
- term.setCursorPos(45,1)
- write("[Quit]")
- term.setCursorPos(1,1)
- write("[Back]")
- term.setBackgroundColor(colors.cyan)
- term.setCursorPos(1,3)
- write("[EMAIL DEVS]")
- mouse_help()
- end
- function start()
- clean()
- drawColors()
- paintutils.drawImage(_logo, 10, 5)
- sleep(1)
- end
- function quit()
- clean()
- drawColors()
- term.setCursorPos(1,1)
- write("Thank you for using VinCore Programs")
- sleep(1)
- os.reboot()
- end
- function email_bugs()
- clean()
- drawColors()
- term.setCursorPos(45,1)
- write("[Quit]")
- term.setCursorPos(10,1)
- write("[Send]")
- term.setCursorPos(1,1)
- write("[Cancel]")
- term.setBackgroundColor(colors.cyan)
- term.setCursorPos(1,5)
- write("Message/Bug:")
- term.setCursorPos(1,4)
- write("Your Email: ")
- term.setCursorPos(1,3)
- write("From:")
- term.setCursorPos(7,3)
- from_email_input = read()
- term.setCursorPos(13, 4)
- email_from_user = read()
- term.setCursorPos(14,5)
- message_email_input = read()
- mouse_email_bugs()
- end
- function bugs()
- clean()
- drawColors()
- term.setCursorPos(1,1)
- write("[Back]")
- term.setCursorPos(8,1)
- write("[Email]")
- term.setBackgroundColor(colors.cyan)
- term.setCursorPos(1,3)
- write("Please email us by click [Email] on the top of the screen!")
- term.setCursorPos(1,6)
- 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,8)
- write("You may also ask any questions on this email.")
- term.setCursorPos(1,10)
- write("WARNING: If you abuse the email system it will be taken down.")
- term.setCursorPos(1,13)
- write("Thanks for reporting the bug!")
- mouse_bugs()
- end
- function draw()
- clean()
- drawColors()
- 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.setCursorPos(36, 1)
- write("[Clear]") --7
- term.setCursorPos(36,19)
- write("[Notice Board]") --14
- term.setCursorPos(1,3)
- term.setBackgroundColor(colors.cyan)
- write("Mail: ")
- end
- function restart()
- clean()
- shell.run("vmail")
- end
- function send()
- Send_String = "From: " ..from_input .."\n" .."Message: " .."\n" .."\n" ..message_input
- sendingN = tonumber(to_input)
- rednet.send(sendingN, Send_String)
- clean()
- drawColors()
- term.setCursorPos(1,1)
- write("Message sent...")
- sleep(1)
- back()
- end
- function send_email()
- email = "From: " ..from_email_input .. "\n" .."Email: " ..email_from_user.."\n" .."\n".."Bug/Message: " ..message_email_input
- http.post(
- "http://vincoreprograms.host22.com/vmail_bugs_email.php?message=" ..textutils.urlEncode(tostring(email))
- )
- clean()
- drawColors()
- term.setCursorPos(1,1)
- write("Bug/Message has been emailed to the developer!")
- sleep(1)
- back()
- end
- function drawColors()
- paintutils.drawLine(1, 1, 100, 1, colors.blue)
- for i = 1,19 do
- i = i + 1
- paintutils.drawLine(1, i, 100, i, colors.cyan)
- end
- paintutils.drawLine(1, 19, 100, 19, colors.blue)
- term.setCursorPos(1,19)
- write("Last Updated: " ..Last_Updated)
- end
- function main()
- update()
- start()
- clean()
- draw()
- while true do
- parallel.waitForAny(listen, mouse_main)
- end
- end
- --Main
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement