diff --git a/eCash.lua b/eCash.lua index 9d587d2..86dbfaa 100644 --- a/eCash.lua +++ b/eCash.lua @@ -243,21 +243,16 @@ local loginButton = login:addButton() username = usernameInput:getText() - if not fs.exists("/.usrcache") then - local file = fs.open("/.usrcache","w") - file.write(username) - file.close() - end - login:setVisible(false) appFrame:setVisible(true) refresh_ui() end) -if fs.exists("/.usrcache") then - local file = fs.open("/.usrcache","r") - local username = file.readLine() +if fs.exists("/config.json") then + local file = fs.open("/config.json","r") + local file_content = file.readAll() + local username = textutils.unserialiseJSON(file_content).username file.close() usernameInput:setText(username) end