Advertisement
guitarplayer616

Pastebin - User Edition

Jun 22nd, 2015
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. shell.run("clr")
  2. term.setTextColor(colors.orange)
  3.  
  4. textutils.slowWrite("Welcome SpaceCat")
  5. write("\n")
  6. term.setTextColor(colors.yellow)
  7.  
  8. print("Enter Username [please]")
  9. term.setTextColor(colors.green)
  10. local username = read()
  11.  
  12. print(nil)
  13.  
  14. term.setTextColor(colors.yellow)
  15. print("Enter Password [please]")
  16. print("don't worry, im totally not saving it somewhere")
  17. term.setTextColor(colors.green)
  18. local password = read("*")
  19.  
  20. print(nil)
  21.  
  22. term.setTextColor(colors.yellow)
  23. if username and password then
  24.     print("Great, now let's see if it worked")
  25. end
  26.  
  27.  
  28. print(nil)
  29. term.setTextColor(colors.green)
  30. write("result: ")
  31.  
  32.  
  33. local conkey = '996a06d80a378f151e589ac86c83e865'
  34.  
  35. local userkey = http.post(
  36.     "http://pastebin.com/api/api_login.php",
  37.     "api_option=login&"..
  38.     "api_dev_key="..conkey.."&"..
  39.     "api_user_name="..textutils.urlEncode(username).."&"..
  40.     "api_user_password="..textutils.urlEncode(password)
  41. )
  42.    
  43. local postdata = userkey.readAll()
  44. term.setTextColor(colors.red)
  45. print(postdata)
  46. userkey.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement