Advertisement
Guest User

Untitled

a guest
May 26th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. public
  2. OnFilterScriptInit()
  3. {
  4. // Wait 5 seconds for the first bot
  5. SetTimerEx("IRC_ConnectDelay", 5000, 0, "d", 1);
  6. // Wait 10 seconds for the second bot
  7. SetTimerEx("IRC_ConnectDelay", 10000, 0, "d", 2);
  8. SetTimerEx("IRC_ConnectDelay", 15000, 0, "d", 3);
  9. // Create a group (the bots will be added to it upon connect)
  10. gGroupID = IRC_CreateGroup();
  11. }
  12.  
  13.  
  14.  
  15. forward
  16. IRC_ConnectDelay(tempid);
  17.  
  18. public
  19. IRC_ConnectDelay(tempid)
  20. {
  21. switch (tempid)
  22. {
  23. case 1:
  24. {
  25. // Connect the first bot
  26. gBotID[0] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_1_NICKNAME, BOT_1_REALNAME, BOT_1_USERNAME);
  27. }
  28. case 2:
  29. {
  30. // Connect the second bot
  31. gBotID[1] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_2_NICKNAME, BOT_2_REALNAME, BOT_2_USERNAME);
  32. }
  33. case 3:
  34. {
  35. // Connect the second bot
  36. gBotID[2] = IRC_Connect(IRC_SERVER, IRC_PORT, BOT_3_NICKNAME, BOT_3_REALNAME, BOT_3_USERNAME);
  37. }
  38. }
  39. return 1;
  40. }
  41.  
  42.  
  43. public
  44. OnFilterScriptExit()
  45. {
  46. // Disconnect the first bot
  47. IRC_Quit(gBotID[0], "Client Exited");
  48. // Disconnect the second bot
  49. IRC_Quit(gBotID[1], "Client Exited");
  50. IRC_Quit(gBotID[2], "Broken Pipe");
  51. // Destroy the group
  52. IRC_DestroyGroup(gGroupID);
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement