This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
ConspiracyCrime's profile picture

[Lua] How to save text input?

Started by ConspiracyCrime, 09 July 2012 - 12:22 PM
ConspiracyCrime #1
Posted 09 July 2012 - 02:22 PM
I am trying to make a register program,
where players enter their name and the name got save somewhere in the program.

problem is write doesn't save text. How should I go about doing it?
ardera #2
Posted 09 July 2012 - 02:32 PM
you can use read()
simple to use:

print("Please enter text:")
text=read()
print("You entered: "..text)
ConspiracyCrime #3
Posted 09 July 2012 - 02:46 PM
that will not work…
but i figure out..


local file = io.open("Text", "w")
file:write("Name")
file:close()

but now theres problem reading the file
ConspiracyCrime #4
Posted 09 July 2012 - 03:05 PM
ok nvm I solve my own problem :)/>/> to read from that file