Advertisement
k_goos

PowerControl

Jun 24th, 2013
52
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local side = "right"
  2. local mobSpawner = "back"
  3. local sortingSystem = "back"
  4. local registerMessage = "PowerComputer"
  5. local server = 33
  6.  
  7. rednet.open(side)
  8. rednet.send(server, registerMessage)
  9. while true do
  10.     local senderId, message = rednet.receive()
  11.    
  12.     if senderId == server then
  13.         Print("Message received from server")
  14.         if message == "MobSpawner" then
  15.             local state = redstone.getOutput(mobSpawner)
  16.             redstone.setOutput(mobSpawner, !state)
  17.         elseif message == "SortingSystem" then
  18.             local state = redstone.getOutput(sortingSystem)
  19.             redstone.setOutput(sortingSystem, !state)
  20.         end
  21.     end
  22. end
Advertisement
RAW Paste Data Copied
Advertisement