Advertisement
kolton

Untitled

Jun 11th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. function test() {
  2. var action;
  3.  
  4. function chat(nick, msg) {
  5. if (nick === "bla") {
  6. action = msg;
  7. }
  8. }
  9.  
  10. addEventListener("chatmsg", chat);
  11.  
  12. while (true) {
  13. switch (action) {
  14. case "a":
  15. do something
  16. break;
  17. case "b":
  18. do something else
  19. break;
  20. }
  21.  
  22. action = "";
  23.  
  24. delay(200);
  25. }
  26.  
  27. return true;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement