Advertisement
Guest User

startup

a guest
Sep 2nd, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local name = "AE";
  2. local isCell = true;
  3. local side = "bottom";
  4.  
  5. rednet.open("front");
  6.  
  7. print("Server running ... Name : "..name);
  8. while true do
  9.     local sId, message = rednet.receive();
  10.     print("Message : "..message.." ("..sId..")");
  11.     if message == "name" then
  12.         rednet.send(sId,name);
  13.     elseif message == "close" then
  14.         if not isCell then
  15.             redstone.setOutput(side,true);
  16.         end
  17.     elseif message == "open" then
  18.         if not isCell then
  19.             redstone.setOutput(side, false);
  20.         end
  21.     elseif message == "cellLevel" then
  22.         if isCell then
  23.             rednet.send(sId,"10");
  24.         end
  25.     elseif message == "type" then
  26.         if isCell then
  27.             rednet.send(sId,"cell");
  28.         else
  29.             rednet.send(sId,"cable");
  30.         end
  31.     else
  32.         print("Unknow ...");
  33.     end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement