Advertisement
AstolfoFate

inventoryManagement.lua

Jul 26th, 2021 (edited)
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.40 KB | None | 0 0
  1. ---@diagnostic disable: undefined-field
  2. -- initialization
  3. peripheral.wrap("back")
  4. peripheral.wrap("monitor_7")
  5. peripheral.wrap("opernperipheral_bridge_0")
  6. peripheral.wrap("down")
  7. local tableLookup = {
  8.   ["tile_thermalexpansion_cache_resonant_name_0"] = "Oak Sapling",
  9.   ["tile_thermalexpansion_cache_resonant_name_1"] = "Bronze Ingot",
  10.   ["tile_thermalexpansion_cache_resonant_name_2"] = "Lehnori Ingot",
  11.   ["tile_thermalexpansion_cache_resonant_name_3"] = "item.krakentooth.name",
  12.   ["tile_thermalexpansion_cache_resonant_name_4"] = "Rotten Flesh",
  13.   ["tile_thermalexpansion_cache_resonant_name_5"] = "Iron Ingot",
  14.   ["tile_thermalexpansion_cache_resonant_name_6"] = "Miner's Delight",
  15.   ["tile_thermalexpansion_cache_resonant_name_7"] = "item.nightmarescale.name",
  16.   ["tile_thermalexpansion_cache_resonant_name_8"] = "Silver Ingot",
  17.   ["tile_thermalexpansion_cache_resonant_name_9"] = "Rich Slag",
  18.   ["tile_thermalexpansion_cache_resonant_name_10"] = "Nether Brick",
  19.   ["tile_thermalexpansion_cache_resonant_name_11"] = "Shiny Ingot",
  20.   ["tile_thermalexpansion_cache_resonant_name_12"] = "Advanced Computer",
  21.   ["tile_thermalexpansion_cache_resonant_name_13"] = "Wired Modem",
  22.   ["tile_thermalexpansion_cache_resonant_name_14"] = "Redstone",
  23.   ["tile_thermalexpansion_cache_resonant_name_15"] = "Iron Nugget",
  24.   ["tile_thermalexpansion_cache_resonant_name_16"] = "Lapis Lazuli",
  25.   ["tile_thermalexpansion_cache_resonant_name_17"] = "Golden Apple",
  26.   ["tile_thermalexpansion_cache_resonant_name_18"] = "Glass Pane",
  27.   ["tile_thermalexpansion_cache_resonant_name_19"] = "Moss Stone",
  28.   ["tile_thermalexpansion_cache_resonant_name_20"] = "Dilithium Dust",
  29.   ["tile_thermalexpansion_cache_resonant_name_21"] = "item.uranium_nugget.name",
  30.   ["tile_thermalexpansion_cache_resonant_name_22"] = "White anemone",
  31.   ["tile_thermalexpansion_cache_resonant_name_23"] = "Steam Dynamo",
  32.   ["tile_thermalexpansion_cache_resonant_name_24"] = "Birch Wood",
  33.   ["tile_thermalexpansion_cache_resonant_name_25"] = "Pulverized Coal",
  34.   ["tile_thermalexpansion_cache_resonant_name_26"] = "Block of Gold",
  35.   ["tile_thermalexpansion_cache_resonant_name_27"] = "Tin Nugget",
  36.   ["tile_thermalexpansion_cache_resonant_name_28"] = "Gold Nugget",
  37.   ["tile_thermalexpansion_cache_resonant_name_29"] = "Cobblestone Slab",
  38.   ["tile_thermalexpansion_cache_resonant_name_30"] = "Glass",
  39.   ["tile_thermalexpansion_cache_resonant_name_31"] = "Weighted Pressure Plate (Light)",
  40.   ["tile_thermalexpansion_cache_resonant_name_32"] = "Golden Apple",
  41.   ["tile_thermalexpansion_cache_resonant_name_33"] = "item.eggbee.name",
  42.   ["tile_thermalexpansion_cache_resonant_name_34"] = "item.godzillascale.name",
  43.   ["tile_thermalexpansion_cache_resonant_name_35"] = "tile.blockuranium.name",
  44.   ["tile_thermalexpansion_cache_resonant_name_36"] = "Block of Diamond",
  45.   ["tile_thermalexpansion_cache_resonant_name_37"] = "item.ingoturanium.name",
  46.   ["tile_thermalexpansion_cache_resonant_name_38"] = "Emerald",
  47.   ["tile_thermalexpansion_cache_resonant_name_39"] = "Electrum Ingot",
  48.   ["tile_thermalexpansion_cache_resonant_name_40"] = "Rose Gold Ingot",
  49.   ["tile_thermalexpansion_cache_resonant_name_41"] = "Tin Ingot",
  50.   ["tile_thermalexpansion_cache_resonant_name_42"] = "Hyperbolic Time Chamber Floor",
  51.   ["tile_thermalexpansion_cache_resonant_name_43"] = "tile.orepig.name",
  52.   ["tile_thermalexpansion_cache_resonant_name_44"] = "Milk Jug",
  53.   ["tile_thermalexpansion_cache_resonant_name_45"] = "Clover",
  54.   ["tile_thermalexpansion_cache_resonant_name_46"] = "Tech Chip Tier 1",
  55.   ["tile_thermalexpansion_cache_resonant_name_47"] = "item.zookeeper.name",
  56.   ["tile_thermalexpansion_cache_resonant_name_48"] = "Book",
  57.   ["tile_thermalexpansion_cache_resonant_name_49"] = "Flesh",
  58.   ["tile_thermalexpansion_cache_resonant_name_50"] = "Stone Bricks",
  59.   ["tile_thermalexpansion_cache_resonant_name_51"] = "Mushroom",
  60.   ["tile_thermalexpansion_cache_resonant_name_52"] = "Cooked Porkchop",
  61.   ["tile_thermalexpansion_cache_resonant_name_53"] = "Granite",
  62.   ["tile_thermalexpansion_cache_resonant_name_54"] = "Dandelion Yellow",
  63.   ["tile_thermalexpansion_cache_resonant_name_55"] = "Potion of Fire Resistance",
  64.   ["tile_thermalexpansion_cache_resonant_name_56"] = "Bone Meal",
  65.   ["tile_thermalexpansion_cache_resonant_name_57"] = "Andesite",
  66.   ["tile_thermalexpansion_cache_resonant_name_58"] = "Acacia Wood",
  67.   ["tile_thermalexpansion_cache_resonant_name_59"] = "Oak Wood Planks",
  68.   ["tile_thermalexpansion_cache_resonant_name_60"] = "Mushroom",
  69.   ["tile_thermalexpansion_cache_resonant_name_61"] = "tile.blockamethyst.name",
  70.   ["tile_thermalexpansion_cache_resonant_name_62"] = "Ruby",
  71.   ["tile_thermalexpansion_cache_resonant_name_63"] = "Red Stained Glass",
  72.   ["tile_thermalexpansion_cache_resonant_name_64"] = "Item IO Circuit Board",
  73.   ["tile_thermalexpansion_cache_resonant_name_65"] = "Diamond",
  74.   ["tile_thermalexpansion_cache_resonant_name_66"] = "Copper Ingot",
  75.   ["tile_thermalexpansion_cache_resonant_name_67"] = "Sponge",
  76.   ["tile_thermalexpansion_cache_resonant_name_68"] = "Block of Emerald",
  77.   ["tile_thermalexpansion_cache_resonant_name_69"] = "Blitz Rod",
  78.   ["tile_thermalexpansion_cache_resonant_name_70"] = "Blitz Powder",
  79.   ["tile_thermalexpansion_cache_resonant_name_71"] = "Snowball",
  80.   ["tile_thermalexpansion_cache_resonant_name_72"] = "Gold Plate",
  81.   ["tile_thermalexpansion_cache_resonant_name_73"] = "Niter",
  82.   ["tile_thermalexpansion_cache_resonant_name_74"] = "Potato",
  83.   ["tile_thermalexpansion_cache_resonant_name_75"] = "item.titanium_nugget.name",
  84.   ["tile_thermalexpansion_cache_resonant_name_76"] = "tile.blockruby.name",
  85.   ["tile_thermalexpansion_cache_resonant_name_77"] = "item.waterball.name",
  86.   ["tile_thermalexpansion_cache_resonant_name_78"] = "Stick",
  87.   ["tile_thermalexpansion_cache_resonant_name_79"] = "Oak Wood",
  88.   ["tile_thermalexpansion_cache_resonant_name_80"] = "Concrete",
  89.   ["tile_thermalexpansion_cache_resonant_name_81"] = "Block of Quartz",
  90.   ["tile_thermalexpansion_cache_resonant_name_82"] = "Salt",
  91.   ["tile_thermalexpansion_cache_resonant_name_83"] = "Wheat",
  92.   ["tile_thermalexpansion_cache_resonant_name_84"] = "Diorite",
  93.   ["tile_thermalexpansion_cache_resonant_name_85"] = "item.mantisclaw.name",
  94.   ["tile_thermalexpansion_cache_resonant_name_86"] = "Item Frame",
  95.   ["tile_thermalexpansion_cache_resonant_name_87"] = "Sugar",
  96.   ["tile_thermalexpansion_cache_resonant_name_88"] = "Saddle",
  97.   ["tile_thermalexpansion_cache_resonant_name_89"] = "Birch Sapling",
  98.   ["tile_thermalexpansion_cache_resonant_name_90"] = "Torch",
  99.   ["tile_thermalexpansion_cache_resonant_name_91"] = "Acacia Sapling",
  100.   ["tile_thermalexpansion_cache_resonant_name_92"] = "Shrub",
  101.   ["tile_thermalexpansion_cache_resonant_name_93"] = "Nether Wart",
  102.   ["tile_thermalexpansion_cache_resonant_name_94"] = "Spider Eye",
  103.   ["tile_thermalexpansion_cache_resonant_name_95"] = "Feather",
  104.   ["tile_thermalexpansion_cache_resonant_name_96"] = "Steak",
  105.   ["tile_thermalexpansion_cache_resonant_name_97"] = "Stone Slab",
  106.   ["tile_thermalexpansion_cache_resonant_name_98"] = "Ink Sac",
  107.   ["tile_thermalexpansion_cache_resonant_name_99"] = "String",
  108.   ["tile_thermalexpansion_cache_resonant_name_100"] = "Seeds",
  109.   ["tile_thermalexpansion_cache_resonant_name_101"] = "Warenai Crystal",
  110.   ["tile_thermalexpansion_cache_resonant_name_102"] = "Coal",
  111.   ["tile_thermalexpansion_cache_resonant_name_103"] = "Limestone",
  112.   ["tile_thermalexpansion_cache_resonant_name_104"] = "Cobblestone",
  113.   ["tile_thermalexpansion_cache_resonant_name_105"] = "Ladder",
  114.   ["tile_thermalexpansion_cache_resonant_name_106"] = "Lead",
  115.   ["tile_thermalexpansion_cache_resonant_name_107"] = "Computer",
  116.   ["tile_thermalexpansion_cache_resonant_name_108"] = "Dinosaur Meat",
  117.   ["tile_thermalexpansion_cache_resonant_name_109"] = "tile.orechipmunk.name",
  118.   ["tile_thermalexpansion_cache_resonant_name_110"] = "JJay",
  119.   ["tile_thermalexpansion_cache_resonant_name_111"] = "Lead Ingot",
  120.   ["tile_thermalexpansion_cache_resonant_name_112"] = "HeatProof Brick",
  121.   ["tile_thermalexpansion_cache_resonant_name_113"] = "Control Circuit Board",
  122.   ["tile_thermalexpansion_cache_resonant_name_114"] = "Peony",
  123.   ["tile_thermalexpansion_cache_resonant_name_115"] = "Cooked Chicken",
  124.   ["tile_thermalexpansion_cache_resonant_name_116"] = "Stone Bricks Slab",
  125.   ["tile_thermalexpansion_cache_resonant_name_117"] = "Blaze Powder",
  126.   ["tile_thermalexpansion_cache_resonant_name_118"] = "Copper Ingot",
  127.   ["tile_thermalexpansion_cache_resonant_name_119"] = "tile.krakenrepellent.name",
  128.   ["tile_thermalexpansion_cache_resonant_name_120"] = "Rocky Dirt",
  129.   ["tile_thermalexpansion_cache_resonant_name_121"] = "Pumpkin",
  130.   ["tile_thermalexpansion_cache_resonant_name_122"] = "Networking Cable",
  131.   ["tile_thermalexpansion_cache_resonant_name_123"] = "tile.blocktitanium.name",
  132.   ["tile_thermalexpansion_cache_resonant_name_124"] = "Cocoa Beans",
  133.   ["tile_thermalexpansion_cache_resonant_name_125"] = "Oak Leaves",
  134.   ["tile_thermalexpansion_cache_resonant_name_126"] = "Gravel",
  135.   ["tile_thermalexpansion_cache_resonant_name_127"] = "Flint",
  136.   ["tile_thermalexpansion_cache_resonant_name_128"] = "Slimeball",
  137.   ["tile_thermalexpansion_cache_resonant_name_129"] = "Light Blue Dye",
  138.   ["tile_thermalexpansion_cache_resonant_name_130"] = "Block of Coal",
  139.   ["tile_thermalexpansion_cache_resonant_name_131"] = "Stone",
  140.   ["tile_thermalexpansion_cache_resonant_name_132"] = "Bucket",
  141.   ["tile_thermalexpansion_cache_resonant_name_133"] = "Fence",
  142.   ["tile_thermalexpansion_cache_resonant_name_134"] = "Paper",
  143.   ["tile_thermalexpansion_cache_resonant_name_135"] = "Marble",
  144.   ["tile_thermalexpansion_cache_resonant_name_136"] = "Bricks",
  145.   ["tile_thermalexpansion_cache_resonant_name_137"] = "item.salt.name",
  146.   ["tile_thermalexpansion_cache_resonant_name_138"] = "Water Bottle",
  147.   ["tile_thermalexpansion_cache_resonant_name_139"] = "Sign",
  148.   ["tile_thermalexpansion_cache_resonant_name_140"] = "Cooked Dinosaur Meat",
  149.   ["tile_thermalexpansion_cache_resonant_name_141"] = "Leather",
  150.   ["tile_thermalexpansion_cache_resonant_name_142"] = "Algae",
  151.   ["tile_thermalexpansion_cache_resonant_name_143"] = "Button",
  152.   ["tile_thermalexpansion_cache_resonant_name_144"] = "Stone Brick Stairs",
  153.   ["tile_thermalexpansion_cache_resonant_name_145"] = "Sugar Canes",
  154.   ["tile_thermalexpansion_cache_resonant_name_146"] = "Chest",
  155.   ["tile_thermalexpansion_cache_resonant_name_147"] = "Arrow",
  156.   ["tile_thermalexpansion_cache_resonant_name_148"] = "Gunpowder",
  157.   ["tile_thermalexpansion_cache_resonant_name_149"] = "Silicon Wafer",
  158.   ["tile_thermalexpansion_cache_resonant_name_150"] = "Dirt",
  159.   ["tile_thermalexpansion_cache_resonant_name_151"] = "Obsidian",
  160.   ["tile_thermalexpansion_cache_resonant_name_152"] = "item.amethyst.name",
  161.   ["tile_thermalexpansion_cache_resonant_name_153"] = "Compass",
  162.   ["tile_thermalexpansion_cache_resonant_name_154"] = "Quicksand",
  163.   ["tile_thermalexpansion_cache_resonant_name_155"] = "Dirty Cobblestone",
  164.   ["tile_thermalexpansion_cache_resonant_name_156"] = "Apple",
  165.   ["tile_thermalexpansion_cache_resonant_name_157"] = "tile.orecamarasaurus.name",
  166.   ["tile_thermalexpansion_cache_resonant_name_158"] = "Copper Plate",
  167.   ["tile_thermalexpansion_cache_resonant_name_159"] = "Magma Cream",
  168.   ["tile_thermalexpansion_cache_resonant_name_160"] = "Raw Chicken",
  169.   ["tile_thermalexpansion_cache_resonant_name_161"] = "Acacia Wood Planks",
  170.   ["tile_thermalexpansion_cache_resonant_name_162"] = "Aluminum Ingot",
  171.   ["tile_thermalexpansion_cache_resonant_name_163"] = "Copper Dust",
  172.   ["tile_thermalexpansion_cache_resonant_name_164"] = "tile.AntBlock.name",
  173.   ["tile_thermalexpansion_cache_resonant_name_165"] = "Iron Rod",
  174.   ["tile_thermalexpansion_cache_resonant_name_166"] = "Sand",
  175.   ["tile_thermalexpansion_cache_resonant_name_167"] = "Silicon Ingot",
  176.   ["tile_thermalexpansion_cache_resonant_name_168"] = "Disk Drive",
  177.   ["tile_thermalexpansion_cache_resonant_name_169"] = "item.rocksmall.name",
  178.   ["tile_thermalexpansion_cache_resonant_name_170"] = "Titanium Ingot",
  179.   ["tile_thermalexpansion_cache_resonant_name_171"] = "BLT",
  180.   ["tile_thermalexpansion_cache_resonant_name_172"] = "tile.redanttroll.name",
  181.   ["tile_thermalexpansion_cache_resonant_name_173"] = "Ferrous Ingot",
  182.   ["tile_thermalexpansion_cache_resonant_name_174"] = "Strongbox",
  183.   ["tile_thermalexpansion_cache_resonant_name_175"] = "tile.termitetroll.name",
  184.   ["tile_thermalexpansion_cache_resonant_name_176"] = "item.eggmantis.name",
  185.   ["tile_thermalexpansion_cache_resonant_name_177"] = "Senzu Bean",
  186.   ["tile_thermalexpansion_cache_resonant_name_178"] = "item.ingottitanium.name",
  187.   ["tile_thermalexpansion_cache_resonant_name_179"] = "Eye of Ender",
  188.   ["tile_thermalexpansion_cache_resonant_name_180"] = "Slag",
  189.   ["tile_thermalexpansion_cache_resonant_name_181"] = "Nether Quartz",
  190.   ["tile_thermalexpansion_cache_resonant_name_182"] = "Sulfur",
  191.   ["tile_thermalexpansion_cache_resonant_name_183"] = "Cactus Green",
  192.   ["tile_thermalexpansion_cache_resonant_name_184"] = "Wildflower",
  193.   ["tile_thermalexpansion_cache_resonant_name_185"] = "tile.extremetorch.name",
  194.   ["tile_thermalexpansion_cache_resonant_name_186"] = "Lime Dye",
  195.   ["tile_thermalexpansion_cache_resonant_name_187"] = "Flower Pot",
  196.   ["tile_thermalexpansion_cache_resonant_name_188"] = "Dlog Ingot",
  197.   ["tile_thermalexpansion_cache_resonant_name_189"] = "item.deadstinkbug.name",
  198.   ["tile_thermalexpansion_cache_resonant_name_190"] = "Oak Wood Slab",
  199. }
  200.  
  201. local searchView = false
  202. local pagedView = false
  203. local w, h = term.getSize() -- usable lines = h - 1  (19 usable in default so usable = 18), by default only 16 can be used since 1 line is for page, 1 line is linebreak, and 1 line is terminal
  204. local usableLines = h - 1
  205. local usableLinesForRecords = h - 3
  206. local page = 0
  207. local pageDisplay = 1
  208. local innerpagecounter1 = 0
  209. local innerpagecounter2 = 0
  210.  
  211. -- functions
  212. local function tableScan()
  213.   local objects = 1
  214.   for k, v in pairs(tableLookup) do
  215.     objects = objects + 1
  216.   end
  217.   return objects
  218. end
  219.  
  220. local numberOfObjects = tableScan()
  221. local maxPages = math.ceil(numberOfObjects/usableLinesForRecords)
  222.  
  223. local function search(searchTerm)
  224.   for k, v in pairs(tableLookup) do
  225.     local qry = string.find(v ,searchTerm)
  226.     if qry ~= nil then
  227.       local c = peripheral.wrap(k)
  228.       local data = c.getStoredItems()
  229.       local data2 = c.getMaxStoredItems()
  230.       term.clear()
  231.       term.setCursorPos(1, 1)
  232.       print(data["display_name"].." / "..data["qty"].." / "..data2)
  233.       break
  234.     end
  235.   end
  236. end
  237.  
  238.  
  239. -- pregenerated search
  240. -- create a pregenerated search for common ore "iron, copper, platinum, etc."
  241. local function preSearch(num)
  242.   if num == 1 then
  243.     print("this submenu1 isn't done yet")
  244.   elseif num == 2 then
  245.     print("this submenu2 isn't done yet")
  246.   elseif num == 3 then
  247.     print("this submenu3 isn't done yet")
  248.   elseif num == 4 then
  249.     print("this submenu4 isn't done yet")
  250.   elseif num == 5 then
  251.     print("this submenu5 isn't done yet")
  252.   elseif num == 6 then
  253.     print("this submenu6 isn't done yet")
  254.   elseif num == 7 then
  255.     print("this submenu7 isn't done yet")
  256.   end
  257. end
  258.  
  259. local function centerWrite(text)
  260.   local width, height = term.getSize()
  261.   local x, y = term.getCursorPos()
  262.   term.setCursorPos(math.ceil((width / 2) - (text:len() / 2)), y)
  263.   term.write(text)
  264. end
  265.  
  266. local function changePage()
  267.   local event, key = os.pullEvent("key")
  268.   if key == keys.right then
  269.     page = page + 1
  270.     pageDisplay = pageDisplay + 1
  271.     if page >= maxPages - 1 then
  272.       page = maxPages - 1
  273.     end
  274.     term.clear()
  275.     term.setCursorPos(1, 1)
  276.     centerWrite("Page "..pageDisplay.." of "..maxPages)
  277.     term.setCursorPos(1, 3)
  278. -- Don't let page display 0 or negative numbers
  279. elseif key == keys.left then
  280.   page = page - 1
  281.   pageDisplay = pageDisplay - 1
  282.   if page <= -1 or pageDisplay <= 0 then
  283.     page = 0
  284.     pageDisplay = 1
  285.   end
  286.   term.clear()
  287.   term.setCursorPos(1, 1)
  288.   centerWrite("Page "..pageDisplay.." of "..maxPages)
  289.   term.setCursorPos(1, 3)
  290. elseif key == keys.q then
  291.   pagedView = false
  292.   MENU = true
  293. else
  294.   page = page
  295.   pageDisplay = pageDisplay
  296.   changePage()
  297.   end
  298. end
  299.  
  300.  
  301. -- Main Menu
  302. MENU = true
  303. while MENU == true do
  304.   print("1. Search\n2. Paged View\n3.Pregenerated Search")
  305.   write("Enter a number: ")
  306.   local menuChoice = read()
  307.   menuChoice = tonumber(menuChoice)
  308.   if menuChoice == 1 then
  309.     searchView = true
  310.     MENU = false
  311.     break
  312.   elseif menuChoice == 2 then
  313.     pagedView = true
  314.     MENU = false
  315.     break
  316.   elseif menuChoice == 3 then
  317.     local submenu = true
  318.     MENU = false
  319.     if submenu == true then
  320.       print("1.Ore\n2.Intermediate Products\n3. Machines/Production\n4.Logistics\n5.Tools\n6.Combat\n7.Utility")
  321.       write("Enter a number: ")
  322.       local submenuChoice = read()
  323.       submenuChoice = tonumber(submenuChoice)
  324.       if submenuChoice == 1 then
  325.         submenu = false
  326.         preSearch(1)
  327.       elseif submenuChoice == 2 then
  328.         submenu = false
  329.         preSearch(2)
  330.       elseif submenuChoice == 3 then
  331.         submenu = false
  332.         preSearch(3)
  333.       elseif submenuChoice == 4 then
  334.         submenu = false
  335.         preSearch(4)
  336.       elseif submenuChoice == 5 then
  337.         submenu = false
  338.         preSearch(5)
  339.       elseif submenuChoice == 6 then
  340.         submenu = false
  341.         preSearch(6)
  342.       elseif submenuChoice == 7 then
  343.         submenu = false
  344.         preSearch(7)
  345.       end
  346.     end
  347.   else
  348.     print("Invalid input. Enter either 1 or 2.")
  349.     MENU = false
  350.     MENU = true
  351.   end
  352. end
  353.  
  354. -- Search
  355. while searchView == true do
  356.   write("Search Inventory for: ")
  357.   local query = read()
  358.   search(query)
  359.   searchView = false
  360.   MENU = true
  361. end
  362.  
  363. --pagination
  364. while pagedView == true do
  365.   term.clear()
  366.   term.setCursorPos(1, 1)
  367.   centerWrite("Page "..pageDisplay.." of "..maxPages)
  368.   term.setCursorPos(1, 3)
  369.     repeat
  370.       if pageDisplay > 1 then
  371.         innerpagecounter1 = usableLines * pageDisplay - usableLines - 2
  372.         innerpagecounter2 = usableLines * pageDisplay - 2 - usableLines
  373.       else
  374.         innerpagecounter1 = 0
  375.         innerpagecounter2 = 0
  376.       end
  377.       local i1 = 0 + innerpagecounter1
  378.       local i2 = usableLines + innerpagecounter2 - 3
  379.       for i = i1, i2 do
  380.         local c = peripheral.wrap("tile_thermalexpansion_cache_resonant_name_"..tostring(i))
  381.         local data = c.getStoredItems()
  382.         local data2 = c.getMaxStoredItems()
  383.         print(data["display_name"].." / "..data["qty"].." / "..data2)
  384.       end
  385.       changePage()
  386.     until pagedView == false
  387. end
  388.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement