Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Themeing--
- function setpos1()
- term.setCursorPos(6,4)
- end
- function setpos2()
- term.setCursorPos(6,6)
- end
- function reset()
- term.setCursorPos(6,4)
- term.setTextColor(colors.white)
- end
- --Commandblock Commands--
- function withdraw_cmd()
- if username == stored_username() then
- commands.exec( "sudo pay @p[" .. amount .. "]")
- else
- print("You don't have permission to withdraw from this account")
- end
- end
- --Authentication--
- function user_func()
- local username = ""
- term.setCursorPos(1,1)
- term.write("Please enter your username")
- end
- function login_func(loginread)
- reset()
- term.setCursorPos(10,4)
- print("Login")
- setpos2()
- term.write("Username:")
- login_input = read()
- loginread = string.lower(login_input)
- term.clear()
- peripheral.wrap("right")
- setpos1()
- print("Please right click the peripheral")
- local event, players = os.pullEvent( "player" )
- term.clear()
- if players == loginread then
- term.setTextColor(colors.green)
- setpos1()
- textutils.slowPrint("Authentication accepted!")
- sleep(2)
- term.clear()
- return loginread
- else
- term.clear()
- setpos1()
- term.setTextColor(colors.red)
- textutils.slowPrint("Authentication denied.")
- sleep(3)
- term.clear()
- login_func()
- return loginread
- end
- end
- --Reset balance--
- --Create/Read balance accounts--
- --[Read]--
- login_func(loginread)
- print(loginread)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement