Advertisement
Sir_Popsilots

ShulkSystemServer

Jul 10th, 2021 (edited)
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.10 KB | None | 0 0
  1. print()
  2. local colortable = {colors.red,colors.lightBlue,colors.orange,
  3.                     colors.pink,colors.green,colors.lime,
  4.                     colors.blue,colors.cyan,colors.purple}
  5. local shulkerboxcolor = {"red","lightblue","orange",
  6.                          "pink","green","lime",
  7.                          "blue","cyan","purple"}
  8. local function printmat(num)
  9.     if num==10 then
  10.         for i = 1 ,9 do
  11.             write("|")
  12.             term.setTextColor(colortable[i])
  13.             write(i)
  14.             term.setTextColor(1)
  15.             if i%3==0 then
  16.                 write("|\n")
  17.             end
  18.         end
  19.     else
  20.         local highlight = false
  21.         for i = 1,9 do
  22.             if i == num then
  23.                 term.setTextColor(16)
  24.                 write("|")
  25.                 term.setTextColor(colortable[i])
  26.                 write(i)
  27.                 term.setTextColor(16)
  28.                 write("|")
  29.                 term.setTextColor(1)
  30.                 highlight = true
  31.                 if i%3==0 then
  32.                     write("\n")
  33.                     highlight = false
  34.                 end
  35.             else
  36.                 if highlight==false then
  37.                     write("|")
  38.                 else
  39.                     highlight = false
  40.                 end
  41.                 term.setTextColor(colortable[i])
  42.                 write(i)
  43.                 term.setTextColor(1)
  44.                 if i%3==0 then
  45.                     write("|\n")
  46.                 end
  47.             end
  48.            
  49.         end
  50.     end
  51. end
  52.  
  53. printmat()
  54. if pocket then
  55.     while true do
  56.         local event, button, x, y = os.pullEvent("mouse_click")
  57.         --term.clear()
  58.         shell.execute("clear")
  59.         if y<6 and (x==2 or x == 4 or x == 6) then
  60.             local num = x/2
  61.             if y == 4 then
  62.                 num = num + 3
  63.             elseif y == 5 then
  64.                 num = num + 6
  65.             end
  66.             term.setTextColor(colortable[num])
  67.             print(shulkerboxcolor[num],"shulker box")
  68.             term.setTextColor(1)
  69.             print("[Return] [Retrive] [X]")
  70.             printmat(num)
  71.             event, button, x, y = os.pullEvent("mouse_click")
  72.             if y == 2 then
  73.                 if x<9 then
  74.                     local ReturnOrRetrive = true
  75.                     write("Returning the ")
  76.                     term.setTextColor(colortable[num])
  77.                     print(shulkerboxcolor[num]," shulker box")
  78.                     term.setTextColor(1)
  79.                 elseif x>9 and x<19 then
  80.                     local ReturnOrRetrive = false
  81.                     write("Retriving the ")
  82.                     term.setTextColor(colortable[num])
  83.                     print(shulkerboxcolor[num]," shulker box")
  84.                     term.setTextColor(1)
  85.                 end
  86.             else
  87.                 shell.execute("clear")
  88.                 print("Please choose a shulker Box")
  89.                 printmat(10)
  90.             end
  91.         else
  92.             print("Please choose a shulker Box")
  93.             printmat(10)
  94.         end
  95.     end
  96. end
  97. redstone.setOutput("right",true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement