gril002

controler Beta 2.1

Sep 8th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | None | 0 0
  1. --NOTE this is a computercraft code for 2 computers to control the MFR auto-spawners--
  2. --THIS omputer DOSEN'T need to be an ADVANCED one the FIRST one DOES--
  3. --NOTE in order for this to work you will also need controler Alpha (first computer)--
  4. --http://pastebin.com/xTj02yqc--
  5. local function redstone1()
  6.     if enderman1 == 1 then
  7.         redstone.setAnalogOutput("left", 15)
  8.         enderman1 = 0 else
  9.         redstone.setAnalogOutput("left", 0)
  10.         enderman1 = 1
  11.     end
  12.  end
  13. local function redstone2()
  14.     if essence2 == 1 then
  15.         redstone.setAnalogOutput("top", 15)
  16.         essence2 = 0 else
  17.         redstone.setAnalogOutput("top", 0)
  18.         essence2 = 1
  19.     end
  20.  end
  21. local function redstone3()
  22.     if custom3 == 1 then
  23.         redstone.setAnalogOutput("back", 15)
  24.         custom3 = 0 else
  25.         redstone.setAnalogOutput("back", 0)
  26.         custom3 = 1
  27.     end
  28.  end
  29. local function update()
  30.     rednet.open("right")
  31.     while true do
  32.         id,message = rednet.receive()
  33.         if message == "enderman" then
  34.             redstone1()
  35.         elseif message == "essence" then
  36.             redstone2()
  37.         elseif message == "custom" then
  38.             redstone3()
  39.         end
  40.     end
  41.  end
  42. enderman1 = 1
  43. essence2 = 1
  44. custom3 = 1
  45. update()
Advertisement
Add Comment
Please, Sign In to add comment