Advertisement
9551

indented code lol

Jun 16th, 2021
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.58 KB | None | 0 0
  1. local component = require("component")
  2. local term = require("term")
  3. local RUNNING = true
  4. local sides = require("sides")
  5.  
  6. function helpdisplay()
  7.     print("type 1-10   for redstone block switch")
  8.     print("stop   for stopping")
  9. end
  10.  
  11. one = component.proxy("abc7f50e-4a30-433d-8a56-2e4a19d146fa") --when you want to let this script work you need to change this addres
  12. two = component.proxy("c4383ff5-d127-4554-b8a7-059fa201ab99")
  13.  -- you need to do that by all you can use ctrl right click with the analyzer
  14. three = component.proxy("a71b79bf-01bb-49f2-8083-175a9dda6352")
  15.  -- to get the addres and copy it
  16. four = component.proxy("bb2f54f2-84af-4d96-a2a4-1a29aa222269")
  17.  -- than you can use middel mouse button to paste it
  18. five = component.proxy("d29ebad3-fedf-49c5-ad9a-f3ea66b49b7b")
  19. six = component.proxy("aff2ef21-6c6a-483d-9a63-d3e4fae59c3b")
  20. seven = component.proxy("610e5d88-ee9e-4c19-b84c-c970ebf49ed9")
  21. eight = component.proxy("fa436d04-feda-4ff0-8782-dab9482dd31d")
  22. nine = component.proxy("89393a35-319e-4a28-9dcf-b68ee460d086")
  23. ten = component.proxy("0391f089-2ba8-4620-89e1-f5edd472ce3a")
  24.  
  25. while RUNNING do
  26.     term.clear()
  27.     helpdisplay()
  28.     user = nil
  29.     user = io.read()
  30.     if user == "stop" then
  31.         print("STOPPING...")
  32.         os.sleep(0.1)
  33.         RUNNING = false
  34.         term.clear()
  35.     end
  36.  
  37.     if user == "1" then
  38.         if one.getOutput(sides.up) == 15 then
  39.             do
  40.                 one.setOutput(sides.up, 0)
  41.             end
  42.         else
  43.             one.setOutput(sides.up, 15)
  44.         end
  45.     end
  46.     if user == "2" then
  47.         if two.getOutput(sides.up) == 15 then
  48.             do
  49.                 two.setOutput(sides.up, 0)
  50.             end
  51.         else
  52.             two.setOutput(sides.up, 15)
  53.         end
  54.     end
  55.  
  56.     if user == "3" then
  57.         if three.getOutput(sides.up) == 15 then
  58.             do
  59.                 three.setOutput(sides.up, 0)
  60.             end
  61.         else
  62.             three.setOutput(sides.up, 15)
  63.         end
  64.     end
  65.  
  66.     if user == "4" then
  67.         if four.getOutput(sides.up) == 15 then
  68.             do
  69.                 four.setOutput(sides.up, 0)
  70.             end
  71.         else
  72.             four.setOutput(sides.up, 15)
  73.         end
  74.     end
  75.  
  76.     if user == "5" then
  77.         if five.getOutput(sides.up) == 15 then
  78.             do
  79.                 five.setOutput(sides.up, 0)
  80.             end
  81.         else
  82.             five.setOutput(sides.up, 15)
  83.         end
  84.     end
  85.  
  86.     if user == "6" then
  87.         if six.getOutput(sides.up) == 15 then
  88.             do
  89.                 six.setOutput(sides.up, 0)
  90.             end
  91.         else
  92.             six.setOutput(sides.up, 15)
  93.         end
  94.     end
  95.  
  96.     if user == "7" then
  97.         if seven.getOutput(sides.up) == 15 then
  98.             do
  99.                 seven.setOutput(sides.up, 0)
  100.             end
  101.         else
  102.             seven.setOutput(sides.up, 15)
  103.         end
  104.     end
  105.  
  106.     if user == "8" then
  107.         if eight.getOutput(sides.up) == 15 then
  108.             do
  109.                 eight.setOutput(sides.up, 0)
  110.             end
  111.         else
  112.             eight.setOutput(sides.up, 15)
  113.         end
  114.     end
  115.  
  116.     if user == "9" then
  117.         if nine.getOutput(sides.up) == 15 then
  118.             do
  119.                 nine.setOutput(sides.up, 0)
  120.             end
  121.         else
  122.             nine.setOutput(sides.up, 15)
  123.         end
  124.     end
  125.  
  126.     if user == "10" then
  127.         if ten.getOutput(sides.up) == 15 then
  128.             do
  129.                 ten.setOutput(sides.up, 0)
  130.             end
  131.         else
  132.             ten.setOutput(sides.up, 15)
  133.         end
  134.     end
  135. end
  136.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement