turtle5204

Chattr Get gold

Oct 16th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. local u = ""
  2. local p = ""
  3. while true do
  4. term.setBackgroundColor(colors.white)
  5. term.setTextColor(colors.black)
  6. term.clear()
  7. center("Get Chattr Gold - Login")
  8. term.setCursorPos(2, 5)
  9. write("Username: ")
  10. term.setCursorPos(2, 7)
  11. write("Password: ")
  12. term.setCursorPos(12, 5)
  13. local username = read()
  14. term.setCursorPos(12, 7)
  15. local password = read("*")
  16. local m = firewolf.query("login", {user=username, pass=password})
  17. term.setTextColor(colors.red)
  18. term.setCursorPos(1, 15)
  19. if m == "valid" then
  20. term.setTextColor(colors.green)
  21. center("Success.")
  22. u = username
  23. p = password
  24. sleep(1)
  25. break
  26. --firewolf.redirect("chattr.net/chat")
  27. elseif m == "invalid" then
  28. center("Wrong username and/or password.")
  29. sleep(1)
  30. elseif m == false then
  31. center("Query failed! Refreshing...")
  32. sleep(1)
  33. firewolf.redirect("chattr.net/gold")
  34. else
  35. center("Unknown error...")
  36. sleep(1)
  37. end
  38. end
  39.  
  40.  
  41. while true do
  42. term.setBackgroundColor(colors.white)
  43. term.setTextColor(colors.black)
  44. term.clear()
  45. center("Get Chattr Gold - Pay (50 LBC)")
  46. term.setCursorPos(2, 5)
  47. write("Address: ")
  48. term.setCursorPos(2, 7)
  49. write("PIN: ")
  50. term.setCursorPos(12, 5)
  51. local ad = read()
  52. term.setCursorPos(12, 7)
  53. local pin = read("*")
  54. local m = firewolf.query("getgold", {user=u, pass=p, addr=ad, pin=pin})
  55. term.setTextColor(colors.red)
  56. term.setCursorPos(1, 15)
  57. center(tostring(m))
  58. end
Advertisement
Add Comment
Please, Sign In to add comment