Daniel_I_Am

Nexus Project

Dec 20th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.55 KB | None | 0 0
  1. io = require("io")
  2. os = require("os")
  3. component = require("component")
  4. term = require("term")
  5. sides = require("sides")
  6. colors = require("colors")
  7. fs = require("filesystem")
  8. event = require("event")
  9.  
  10. gpu = component.gpu
  11. transposer = component.transposer
  12.  
  13. function resetVariables()
  14.     chestSide = sides.top
  15.     portalSide = sides.north
  16. end
  17.  
  18. function checkVariables()
  19.     if chestSide == portalSide then throwError("Variables chestSide and PortalSide are the same.") end
  20. end
  21.  
  22. function checkChestContents()
  23.     local list = {}
  24.     for i = 1, transposer.getInventorySize(chestSide) do
  25.         local slot = transposer.getStackInSlot(chestSide, i)
  26.         if slot == nil then
  27.             slot = {label = "Slot Open"}
  28.         end
  29.         slot = slot.label
  30.         string.insert(list, tostring(slot))
  31.     end
  32.     return list
  33. end
  34.  
  35. function updateButtonList()
  36.     local itemList = checkChestContents
  37.    
  38.    
  39. end
  40.  
  41. function addRect(x1,y1,x2,y2,color)
  42.   temp = gpu.getBackground()
  43.   gpu.setBackground(color)
  44.   gpu.fill(x1,y1,x2-x1+1,y2-y1+1," ")
  45.   gpu.setBackground(temp)
  46. end
  47.  
  48. function GUI()
  49.    
  50. end
  51.  
  52. function updateScreen()
  53.    
  54. end
  55.  
  56. function update(buttonsPressed)
  57.     buttonPressed = buttonsPressed[1]
  58.     if buttonPressed == nil then return nil end
  59.     transposer.transferItem(chestSide, portalSide, 1, buttonPressed, 1)
  60.     os.sleep(10)
  61.     transposer.transferItem(portalSide, chestSide, 1, 1, buttonPressed)
  62.     return nil
  63. end
  64.  
  65. function init()
  66.     resetVariables()
  67.     GUI()
  68. end
  69.  
  70. function main()
  71.     local buttonsPressed = BA.updateAll(event.pull("touch"))
  72.     update(buttonsPressed)
  73. end
  74.  
  75. init()
  76. repeat
  77.     main()
  78. until false
Advertisement
Add Comment
Please, Sign In to add comment