Guest User

startup

a guest
Feb 23rd, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. term.clear()
  2. username = ""
  3. password = ""
  4. boxW = 32
  5. boxH = 8
  6. w, h = term.getSize()
  7. midW, midH = w/2, h/2
  8. paintutils.drawBox(
  9. midW-(boxW/2),
  10. midH-(boxH/2),
  11. midW+(boxW/2),
  12. midH+(boxH/2),
  13. colours.white)
  14. term.setBackgroundColour(colours.black)
  15. term.setTextColour(colours.lightGrey)
  16.  
  17. function cursorPos(x, y)
  18.   term.setCursorPos(
  19.   midW-(boxW/2)+x,
  20.   midH-(boxH/2)+y)
  21. end
  22.  
  23. function boxData(title)
  24.   print(title)
  25. end
  26.  
  27. cursorPos(3, 3)
  28. boxData("ID: ")
  29.  
  30. cursorPos(3, 5)
  31. boxData("Password: ")
  32.  
  33. cursorPos(7, 3)
  34. username = tostring(read())
  35. cursorPos(string.len("Password: ")+3, 5)
  36. password = read("*")
  37.  
  38. channel1 = 4826
  39. channel2 = 3984
  40. receiveChannel1 = 38274
  41. receiveChannel2 = 57593
  42.  
  43. function openPort(port)
  44. modem = peripheral.wrap("left")
  45. if not modem.isOpen(port) then modem.open(port) end
  46. end
  47.  
  48. openPort(channel1)
  49. modem.transmit(channel1, receiveChannel1, username)
  50.  
  51. openPort(channel2)
  52. modem.transmit(channel2, receiveChannel2, password)
Advertisement
Add Comment
Please, Sign In to add comment