Advertisement
Zebula_The_Scripter

IronMan

May 28th, 2018
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. --Iron Man Armor #CENSORED#
  2.  
  3. mon = peripheral.find("monitor")
  4.  
  5. function drawBackground()
  6. mon.setBackgroundColor(colors.black)
  7. mon.clear()
  8. mon.setTextColor(colors.black)
  9. x,y = mon.getSize()
  10. for yc = 1,15 do
  11. if yc%2 == 1 then
  12. mon.setBackgroundColor(colors.lightBlue)
  13. else
  14. mon.setBackgroundColor(colors.lightGray)
  15. end
  16. for xc = 1,x do
  17. mon.setCursorPos(xc, yc)
  18. mon.write(" ")
  19. end
  20. mon.setCursorPos(1,yc)
  21. mon.write(yc..":")
  22. end
  23. end
  24.  
  25. function inputPage(level)
  26. mon.clear()
  27. mon.setBackgroundColor(colors.lightGray)
  28. mon.setCursorPos(x/2 - 4, y/2-1)
  29. mon.write("Enter label")
  30. mon.setCursorPos(x/2 - 4, y/2+1)
  31. mon.write("in computer")
  32. term.clear()
  33. x,y = term.getSize()
  34. term.setCursorPos(x/2-8, y/2-2)
  35. print("Enter Armor Type")
  36. term.setCursorPos(x/2 - 8, y/2)
  37. print(" ")
  38. term.setCursorPos(x/2 - 8, y/2)
  39. label = read()
  40. term.setBackgroundColor(colors.black)
  41. term.clear()
  42. file = fs.open(tostring(param3), "w")
  43. file.write(label)
  44. file.close()
  45. end
  46.  
  47. function drawButtons()
  48. x,y = mon.getSize()
  49. for i=1,14 do
  50. if fs.exists(tostring(i)) then
  51. file = fs.open(tostring(i), "r")
  52. label = file.readAll()
  53. file.close()
  54. mon.setCursorPos(x/2 - string.len(label)/2, i)
  55. if i%2 == 1 then
  56. mon.setBackgroundColor(colors.lightBlue)
  57. else
  58. mon.setBackgroundColor(colors.lightGray)
  59. end
  60. mon.setTextColor(colors.white)
  61. mon.write(label)
  62. mon.setCursorPos(x-2, i)
  63. mon.setBackgroundColor(colors.black)
  64. mon.setTextColor(colors.white)
  65. mon.write(" X ")
  66. end
  67. end
  68. mon.setBackgroundColor(colors.red)
  69. mon.setCursorPos(x/2 - 5, 15)
  70. mon.write("Unequip Armor")
  71. if unequip then
  72. mon.setBackgroundColor(colors.black)
  73. mon.setTextColor(colors.white)
  74. mon.setCursorPos(x/2 - 10, 17)
  75. mon.write("Ready to unequip armor")
  76. mon.setCursorPos(x/2 - 12, 19)
  77. mon.write("Armor Removal Process Prepared. Enter Transponder Pad.")
  78. end
  79. end
  80.  
  81. while true do
  82. x,y=mon.getSize()
  83. mon.clear()
  84. drawBackground()
  85. drawButtons()
  86. event, param1, param2, param3 = os.pullEvent("monitor_touch")
  87. if param2 < x - 2 and param3 < 15 then
  88. if fs.exists(tostring(param3)) then
  89. rs.setAnalogOutput("back", tonumber(param3))
  90. unequip = false
  91. else
  92. inputPage(param3)
  93. end
  94. elseif param3 == 15 then
  95. rs.setAnalogOutput("back", 15)
  96. unequip = true
  97. else
  98. fs.delete(tostring(param3))
  99. end
  100. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement