Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --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()
Advertisement
Add Comment
Please, Sign In to add comment