Advertisement
TheRockettek

Untitled

May 28th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. w,h = term.getSize()
  2.  
  3. PRICES = {
  4. ['currency'] = "iron",
  5. ['case'] = {
  6. [1] = 4,
  7. [2] = 8,
  8. [3] = 12,
  9. },
  10. ['ram'] = {
  11. [1] = 1,
  12. [1.5] = 2,
  13. [2] = 3,
  14. [2.5] = 5,
  15. [3] = 7,
  16. [3.5] = 8,
  17. },
  18. ['cpu'] = {
  19. [1] = 2,
  20. [2] = 8,
  21. [3] = 13,
  22. },
  23. ['hdd'] = {
  24. [1] = 2,
  25. [2] = 5,
  26. [3] = 13,
  27. },
  28. ['gpu'] = {
  29. ['a1'] = 6,
  30. ['a2'] = 8,
  31. ['g1'] = 5,
  32. ['g2'] = 8,
  33. ['g3'] = 13,
  34. },
  35. ['misc'] = {
  36. ['floppy'] = 2,
  37. ['openos'] = 4,
  38. ['datac'] = 30,
  39. },
  40. }
  41.  
  42. DEFAULT_SETUP = {
  43. }
  44.  
  45. function caseSTEP()
  46. -- CASE SCREEN
  47. -- http://i.imgur.com/GdW7BUB.png
  48. paintutils.drawFilledBox(1,1,w,3,colours.green)
  49. paintutils.drawFilledBox(1,4,w,h,colours.white)
  50. paintutils.drawFilledBox(2,7,5,9,colours.grey)
  51. paintutils.drawFilledBox(2,11,5,13,colours.yellow)
  52. paintutils.drawFilledBox(2,15,5,17,colours.cyan)
  53. term.setCursorPos(2,2)
  54. local title = "rpe.host's server builder"
  55. term.blit(title,string.rep("0",#title),string.rep("d",#title))
  56. term.setCursorPos(2,5)
  57. term.setTextColour(colours.lightGrey)
  58. term.setBackgroundColour(colours.white)
  59. term.write("Select a case:")
  60. term.setCursorPos(7,7)
  61. term.setTextColour(colours.grey)
  62. term.write("Tier 1: " .. PRICES['case'][1] .. " " .. PRICES['currency'])
  63. term.setCursorPos(7,11)
  64. term.write("Tier 2: " .. PRICES['case'][2] .. " " .. PRICES['currency'])
  65. term.setCursorPos(7,15)
  66. term.write("Tier 3: " .. PRICES['case'][3] .. " " .. PRICES['currency'])
  67. term.setCursorPos(7,9)
  68. term.setTextColour(colours.black)
  69. term.write("Our value package")
  70. term.setCursorPos(7,13)
  71. term.setTextColour(colours.orange)
  72. term.write("Perfect for small apps")
  73. term.setCursorPos(7,17)
  74. term.setTextColour(colours.cyan)
  75. term.write("Ideal for when you need a bit more power")
  76. caseSTEPwait()
  77. end
  78.  
  79. function caseSTEPwait()
  80. while true do
  81. local _,s,x,y = os.pullEvent("mouse_up")
  82. --middle: 3
  83. --left: 1
  84. --right: 2
  85. if y >= 7 and y <= 9 then
  86. -- Tier 1
  87. paintutils.drawFilledBox(1,1,w,3,colours.green)
  88. paintutils.drawFilledBox(1,4,w,h,colours.white)
  89. term.setCursorPos(2,2)
  90. local title = "rpe.host's server builder"
  91. term.blit(title,string.rep("0",#title),string.rep("d",#title))
  92. term.setCursorPos(2,5)
  93. term.setTextColour(colours.lightGrey)
  94. io.read()
  95. caseSTEP()
  96. elseif y >= 11 and y <= 13 then
  97. -- Tier 2
  98. elseif y >= 15 and y <= 17 then
  99. -- Tier 3
  100. end
  101. end
  102. end
  103.  
  104. caseSTEP()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement