Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- CC MeatCoin
- -- First Time Setup
- fileUserdataName = "userdata"
- term.clear()
- term.setCursorPos(1,1)
- if fs.exists(fileUserdataName) == false then
- file = fs.open(fileUserdataName,"w")
- file.writeLine(os.getComputerID())
- print("Hello! Let's get your account set up.")
- print("Please enter your name: ")
- local name = io.read()
- file.writeLine(name)
- print("Now please enter a new PIN: ")
- local pin = io.read()
- term.clear()
- term.setCursorPos(1,1)
- print("Thank you, "..name.." Your account will now be created.")
- -- Ping to Server for Account Creation
- file.close()
- end
- local file = fs.open(fileUserdataName,"r")
- local id = file.readLine()
- local name = file.readLine()
- options = {"Send","Receive","Balance"}
- selected = 1
- while true do
- print("Welcome back "..name.."\n")
- if selected == 1 then
- print("["..options[1].."]")
- else
- print(options[1])
- end
- if selected == 2 then
- print("["..options[2].."]")
- else
- print(options[2])
- end
- if selected == 3 then
- print("["..options[3].."]")
- else
- print(options[3])
- end
- local event, key = os.pullEvent("key")
- if key == keys.down then
- if selected == 3 then
- selected = 1
- else
- selected = selected + 1
- end
- end
- if key == keys.up then
- if selected == 1 then
- selected = 3
- else
- selected = selected - 1
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement