Advertisement
Blackhome

oeffnen

Apr 5th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. rednet.open("top")
  2. -- tuer
  3. local sid = 14
  4. local m = "a"
  5. print("Was ergibt 3 x 3?\n")
  6. m = io.read()
  7. rednet.send(sid, m)
  8. id = 1
  9. while id ~= sid do
  10.     id, m = rednet.receive()
  11. end
  12. print(m)
  13. local o = "2"
  14. if m == "die Tuer ist nun offen!" then
  15.     while o == "2" do
  16.         print("Schliessen Sie die Tuer!")
  17.         print("Geben Sie dazu  zu  ein!\n")
  18.         m = io.read()
  19.         rednet.send(sid, m)
  20.         id, o = rednet.receive()
  21.         if id == sid and o == "1" then
  22.             print("Die Tuer wurde geschlossen")
  23.             sleep(2)
  24.         elseif o == "2" then
  25.             print("falsches Wort\n\n")
  26.         end
  27.     end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement