Jump to content




readLine ?


  • You cannot reply to this topic
1 reply to this topic

#1 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 11 April 2012 - 01:52 AM

How do you correctly readLine() ??
I'm making a login for my OS and it has a file that has the username and password on it.
There is a Username and Password on the one file.
How do I get it to read where it says User = "" and pass = "" ?

#2 Luanub

    Lua Nub

  • Members
  • 1,135 posts
  • LocationPortland OR

Posted 11 April 2012 - 02:00 AM

Probably the best way to match them up would be to read the contents on each file into a string, then split the string and covert it into a table then run a check like..

if username == userfile[x] then
do stuff
end

You will have to do this for each line in the table. You can do table.maxn(tablename) to get the count and do a for loop like..

local a = table.maxn(userfile)
for x=1, a do
if username == userfile[x] then
do stuff
end
end






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users