Advertisement
AnonGaming

asd

Mar 2nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.11 KB | None | 0 0
  1.  
  2. sideOut = "right"
  3. sideIn = "back"
  4.  
  5.  
  6. mon = peripheral.wrap("top")
  7.  
  8.  
  9. local inputs = {}
  10.  
  11. inputs[colors.orange] = "bay1"
  12. inputs[colors.white] = "bay2"
  13. inputs[colors.brown] = "nuclear"
  14.  
  15.  
  16. local outputs = {}
  17.  
  18. outputs["bay1"] = {}
  19. outputs["bay1"]["cat"] = "engines"
  20. outputs["bay1"]["col"] = colors.white
  21.  
  22. outputs["bay2"] = {}
  23. outputs["bay2"]["cat"] = "engines"
  24. outputs["bay2"]["col"] = colors.brown
  25.  
  26.  
  27.  
  28. outputs["nuclear"] = {}
  29. outputs["nuclear"]["cat"] = "ic2"
  30. outputs["nuclear"]["col"] = colors.black
  31.  
  32.  
  33.  
  34. local catagories = {}
  35.  
  36. catagories["ic2"] = {}
  37. catagories["ic2"]["x"] = 25
  38. catagories["ic2"]["y"] = 3
  39. catagories["ic2"]["cX"] = 25
  40. catagories["ic2"]["cY"] = 3
  41.  
  42. catagories["engines"] = {}
  43. catagories["engines"]["x"] = 1
  44. catagories["engines"]["y"] = 3
  45. catagories["engines"]["cX"] = 1
  46. catagories["engines"]["cY"] = 3
  47.  
  48.  
  49. function enable(side,col)
  50.     redstone.setBundledOutput(side,colors.combine(redstone.getBundledInput(side),col))
  51. end
  52.  
  53. function disable(side,col)
  54.     redstone.setBundledOutput(side,colors.subtract(redstone.getBundledInput(side),col))
  55. end
  56.  
  57.  
  58.  
  59. while true do
  60.    
  61.    
  62.     local imp = redstone.getBundledInput(sideIn)
  63.     mon.clear()
  64.     mon.setCursorPos(1,1)
  65.     local cursorY = 10
  66.     mon.write("Engine Interface")
  67.    
  68.     for k,v in pairs(catagories) do
  69.         catagories[k]["cX"] = catagories[k]["x"]
  70.         catagories[k]["cY"] = catagories[k]["y"] + 1
  71.        
  72.         mon.setCursorPos(catagories[k]["x"],catagories[k]["y"])
  73.         mon.write(k)
  74.        
  75.     end
  76.    
  77.    
  78.     for i,val in pairs(inputs) do
  79.    
  80.         local out = outputs[val]
  81.         local cat = catagories[out["cat"]]
  82.         mon.setCursorPos(cat["cX"],cat["cY"])
  83.         if colors.test(imp,i) then
  84.             --Enable/Display mon
  85.             --enable(sideOut,out["col"])
  86.             mon.write(val..": Enabled")
  87.         else
  88.             --Disable/Display Mon
  89.             --disable(sideOut,out["col"])
  90.             mon.write(val..": Disabled")
  91.         end
  92.          
  93.         catagories[out["cat"]]["cY"]  = catagories[out["cat"]]["cY"] + 1
  94.        
  95.     end
  96.    
  97.  
  98. sleep(1)
  99. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement