Advertisement
Guest User

chatcontrol_CC2

a guest
Jul 30th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.50 KB | None | 0 0
  1. p = peripheral.wrap("bottom")
  2. Chatbox="bottom"
  3. sside="top"
  4. term.clear()
  5. term.setCursorPos(1,1)
  6. print("-------------------------\n")
  7. print("       Chatcontrol\n")
  8. print("-------------------------\n")
  9. write("Chatbox = ") print(Chatbox)
  10. print("Scrap         an/aus |yellow\nLicht         an/aus |white\nSolar         an/aus |purple\n")
  11.  
  12. write("Outputs: ")
  13. print(sside)
  14.  
  15.  
  16. while true do
  17.   event, player, message =os.pullEvent("chat")
  18.   if string.find(message, "Scrap") and string.find(message, "aus") then
  19.     redstone.setBundledOutput(sside, colors.combine(redstone.getBundledOutput(sside),colors.yellow))
  20.   end
  21.   if string.find(message, "Scrap") and string.find(message, "an") then
  22.     redstone.setBundledOutput(sside,colors.subtract(redstone.getBundledOutput(sside),colors.yellow))
  23.   end
  24.   if string.find(message, "Licht") and string.find(message, "an") then
  25.     redstone.setBundledOutput(sside,colors.combine(redstone.getBundledOutput(sside),colors.white))
  26.   end
  27.   if string.find(message, "Licht") and string.find(message, "aus") then
  28.     redstone.setBundledOutput(sside,colors.subtract(redstone.getBundledOutput(sside),colors.white))  
  29.   end
  30.   if string.find(message, "Solar") and string.find(message, "aus") then
  31.     redstone.setBundledOutput(sside,colors.combine(redstone.getBundledOutput(sside),colors.purple))
  32.   end
  33.   if string.find(message, "Solar") and string.find(message, "an") then
  34.     redstone.setBundledOutput(sside,colors.subtract(redstone.getBundledOutput(sside),colors.purple))
  35.   end    
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement