Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. function Initialize()
  2. {
  3. BindEvent("OnMessage", OnMessageEvent); //Bind the message event
  4. }
  5.  
  6. function ReInitialize(url)
  7. {
  8. ReloadBot(url); //Must be called to reload the script contents
  9. }
  10.  
  11. function OnMessageEvent(data)
  12. {
  13. var username = data.username;
  14. var text = data.text;
  15. switch (username)
  16. {
  17. case "Asplosions":
  18. var chatargs = text.explode(" ", 2);
  19. switch (chatargs[0].toLowerCase())
  20. {
  21. case "hello":
  22. SendAMessage("Hi there!");
  23. break;
  24. case "!loadscript":
  25. if (chatargs[1] != "")
  26. {
  27. ReInitialize(chatargs[1]);
  28. }
  29. else
  30. {
  31. SendAMessage("Oops you forgot a url!");
  32. }
  33. break;
  34. default:
  35. //I don't understand you.
  36. }
  37. break;
  38. case "Mal1t1a":
  39. var chatargs = text.explode(" ", 2);
  40. switch (chatargs[0].toLowerCase())
  41. {
  42. case "beep":
  43. SendAMessage("boop");
  44. break;
  45. case "!loadscript":
  46. if (chatargs[1] != "")
  47. {
  48. ReInitialize(chatargs[1]);
  49. }
  50. else
  51. {
  52. SendAMessage("Oops you forgot a url!");
  53. }
  54. break;
  55. default:
  56. //I don't understand you.
  57. }
  58. break;
  59. default:
  60. //I don't understand who this is.
  61. }
  62. }
  63.  
  64. Initialize();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement