Posted 03 March 2012 - 05:00 AM
alrighty… I've got some code… I came up with a short and sweet 1 message kinda mail drop box :unsure:/>/>
when a user boots up the pc it asks for their name and saves the name as y variable. and then it asks for the message and saves the message as x variable. then the computer locks and cant be accessed until the owner enters his/her username and password B)/>/>! once the info is entered the name and the message is shown to the owner! Oh and best of all there is NO ctrl+t!
Now for the help that I need:
I need help saving more than one message.
i want it to list the messages kind of like on yahoo… showing unread but maybe automatically deleting read messages?
and really all i want is tips or pointers…
so far thats all i need help with B)/>/> feel free to work on the code… i don't even care if you don't help me out xD i think this is pretty cool.. soyeh here it is…
alrighty..
Run the program. see what you think,
I don't care about distribution so long as i get a little credit B)/>/>! tell me what you think. good/bad i don't care… i'm new to programming and this is my first actual program.. besides my loop-based user/pass login thing that i think i made up… haven't seen anyone else do it so yeah B)/>/> i think its original! if you have any suggestions also feel free to let me know!
.
..
…
KBAI!
when a user boots up the pc it asks for their name and saves the name as y variable. and then it asks for the message and saves the message as x variable. then the computer locks and cant be accessed until the owner enters his/her username and password B)/>/>! once the info is entered the name and the message is shown to the owner! Oh and best of all there is NO ctrl+t!
Now for the help that I need:
I need help saving more than one message.
i want it to list the messages kind of like on yahoo… showing unread but maybe automatically deleting read messages?
and really all i want is tips or pointers…
so far thats all i need help with B)/>/> feel free to work on the code… i don't even care if you don't help me out xD i think this is pretty cool.. soyeh here it is…
Spoiler
function os.pullEvent()
local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
if event == "terminate" then
os.reboot()
end
return event, p1, p2, p3, p4, p5
end
term.clear()
term.setCursorPos(1,1)
write("Hello! Please enter your name.nnName: ")
y = io.read()
term.clear()
term.setCursorPos(1,1)
write("Message: ")
x = io.read()
if x ~= "" then
sleep(1)
term.clear()
term.setCursorPos(1,1)
print("Would you like to send this to OWNER?nn"..x.."nny/nn") -- Replace OWNER with owners name B)/>/>
input = read()
if input == "y" then
term.clear()
term.setCursorPos(1,1)
else
os.reboot()
end
repeat
print("Please login to view mail.")
sleep(2)
term.clear()
term.setCursorPos(1,1)
write("Username: ")
input = read("*")
if input ~= "user" then -- replace user with desired owner username here
print("User not found in database.")
sleep(1)
term.clear()
term.setCursorPos(1,1)
end
until
input == "user" -- Replace user with desired owner username here
term.clear()
term.setCursorPos(1,1)
repeat
write("Password: ")
input = read("*")
if input ~= "pass" then -- Replace pass with desired owner password here
print("Login failed.")
sleep(1)
term.clear()
term.setCursorPos(1,1)
end
until
input == "pass" -- Replace pass with desired owner password here
sleep(1)
term.clear()
term.setCursorPos(1,1)
print(y.." says:nn"..x.."n")
else
print("Blank messages not accepted.")
sleep(1)
os.reboot()
end
alrighty..
Run the program. see what you think,
I don't care about distribution so long as i get a little credit B)/>/>! tell me what you think. good/bad i don't care… i'm new to programming and this is my first actual program.. besides my loop-based user/pass login thing that i think i made up… haven't seen anyone else do it so yeah B)/>/> i think its original! if you have any suggestions also feel free to let me know!
.
..
…
KBAI!