Advertisement
Guest User

streamdefensebots

a guest
Jan 16th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.30 KB | None | 0 0
  1. var tmi = require("tmi.js");
  2.  
  3. var channel = "archonthewizard";
  4. var myname = "syLph96" //------------------change this
  5. var hmyname = "#sylph96" //------------------change this
  6.  
  7. const notifier = require('node-notifier');
  8.  
  9. var followme = "";
  10.  
  11. var options = {
  12. options: {
  13. debug: true
  14. },
  15. connection: {
  16. cluster: "aws",
  17. reconnect: true
  18. },
  19. identity: {
  20. username: "Phycoery", //------------------change this
  21. password: "oauth:its_a_secret" //------------------change this
  22. },
  23. channels: [channel]
  24. }
  25.  
  26. var client = new tmi.client(options);
  27. client.connect();
  28.  
  29. var listentoanyone = true;
  30. var followothers = true;
  31.  
  32. client.on('connected', function(address, port) {
  33. //client.action(myname, "hi")
  34. });
  35.  
  36. client.on("whisper", function (from, userstate, message, self) {
  37. // Don't listen to my own messages..
  38. if (message.startsWith("say ") && from == hmyname){
  39. client.say(channel, message.split("say ")[1]);
  40. return;
  41. }
  42. if (self || message.includes("kick") || (message.includes("learn") && !(from == hmyname))) return;
  43. if (from == "#ttdbot") client.say(channel, message);
  44. if (!message.includes("!socket") && (!message.includes("!spec") || message == "!specs") && from != "#ttdbot") client.whisper("ttdbot", message);
  45. });
  46.  
  47. client.on('chat', function(channel, user, message, self){
  48. if (self || message.includes("xx") || message.includes("kick") || message.includes("learn") || message.includes("hire")) return;
  49. if (message.includes(myname)) notifier.notify('you were mentioned');
  50. if ((!message.includes("!socket") && !message.includes("!spec")) || user['display-name'] == myname){
  51. if (message == "?dontfollowme" && followme == user['display-name']) {
  52. followme = "";
  53. } else if(user['display-name'] == followme) {
  54. client.whisper("ttdbot", message);
  55. }
  56. if(message.startsWith("?altars")){
  57. client.say(channel, "http://www.streamdefense.com/altars/");
  58. }
  59. else if(message.startsWith("?panic")){
  60. client.say(channel, "@ArchonTheWizard @ArchonTheWizard @ArchonTheWizard panicBasket panicBasket panicBasket panicBasket panicBasket panicBasket");
  61. }
  62. else if(message.startsWith("?classes")){
  63. client.say(channel, "http://www.streamdefense.com/classes/");
  64. }
  65. else if(message.startsWith("?essence")){
  66. client.say(channel, "https://docs.google.com/spreadsheets/d/16I4alWO2cqC2BzFbw_TGASTH_QcdRfM0jfHNen8bl1I/edit#gid=0");
  67. }
  68. else if(message.startsWith("?gems")){
  69. client.say(channel, "http://www.streamdefense.com/gems");
  70. }
  71. else if(message.startsWith("?classdata")){
  72. client.say(channel, "https://docs.google.com/spreadsheets/d/1-8EfwrWsItJKr7wEfs4PuoLaO1hpE3JdUsCU9u66qTw/edit#gid=0");
  73. }
  74. else if(message.startsWith("?trapper")){
  75. client.say(channel, "http://www.streamdefense.com/trapper/");
  76. }
  77. else if(message.startsWith("?howtoplay")){
  78. client.say(channel, "http://www.streamdefense.com/how-to-play/");
  79. }
  80. else if(message.startsWith("?rebirth")){
  81. client.say(channel, "When a player visits the Rebirth Altar, their experience will be drained, taking them back to level 1. However, for the rest of the game, they will receive 5% of the experience drained after every wave. Players can revisit the altar as often as they'd like - increasing how much experience they earn at the end of each wave.");
  82. }
  83. else if(message.startsWith("?wisdom")){
  84. client.say(channel, "The Altar of Wisdom is very powerful, but can only be used ONCE per player (per game). Upon visiting the altar, the player's level will increase dramatically. Their level will be increased by 50% + 10. Therefore: A level 1 visiting the altar would become level 12. A level 25 visiting the altar would become level 48. To balance this dramatic increase in levels, the experience required to level-up is doubled (on this map only).");
  85. }
  86. else if(message.startsWith("?challenge")){
  87. client.say(channel, "Only one player can enter the Challenge Altar at a time. Upon entering, a small wave of enemies will spawn and walk towards the tower. If the player can defeat all the enemies before they reach the tower, they will be rewarded with a large sum of XP.");
  88. }
  89. else if(message.startsWith("?lava")){
  90. client.say(channel, "When a player visits the Lava Altar their power will be drained very quickly. While their power is drained, the path will turn into lava, dealing damage to all enemies on the screen. If one or more of the crystals is glowing red, the player also has a chance to summon lava elementals. If the large crystal at the top of the map is glowing red, you might summon the big golem instead of an elemental.");
  91. }
  92. else if(message.startsWith("?controller")) {
  93. client.say(channel, "http://www.streamdefense.com/stream-defense-controller/");
  94. }
  95. else if(message.startsWith("?highpriest")) {
  96. client.say(channel, "http://www.streamdefense.com/highpriest/");
  97. }
  98. else if(message.startsWith("?commands")){
  99. client.say(channel, "?howtoplay ?progression ?bounty ?altars (?lava ?rebirth ?wisdom ?challenge) ?classes ?highpriest ?trapper ?essence ?gems ?classdata ?expstats ?controller");
  100. }
  101. else if(message.includes("p!") && !message.includes("!p!")) {
  102. if(listentoanyone || user['display-name'] == myname) client.whisper("TTDBot", "!" + message.split("p!")[1]);
  103. }
  104. else if(message == "?followme" && followothers) {
  105. followme = user['display-name'];
  106. }
  107. else if(message == "?listentoanyone" && user['display-name'] == myname) {
  108. listentoanyone = true;
  109. }
  110. else if(message == "?dontlistentoothers" && user['display-name'] == myname) {
  111. listentoanyone = false;
  112. }
  113. else if(message == "?followothers" && user['display-name'] == myname) {
  114. followothers = true;
  115. }
  116. else if(message == "?dontfollowothers" && user['display-name'] == myname) {
  117. followothers = false;
  118. followme = "";
  119. }
  120. else if(message == "BOSS INCOMING! Type !fill to move to the closest tower!" && user.mod) {
  121. notifier.notify('boss coming');
  122. }
  123. else if(message.includes("NEXT WAVE #1:") && user.mod) {
  124. notifier.notify('new game started');
  125. }
  126. else if(message.includes("?idiots")) {
  127. client.say(channel, "guuuuys... I CANT EEEEBEN BrokeBack NotLikeThis FailFish BrokeBack NotLikeThis FailFish BrokeBack NotLikeThis FailFish");
  128. }
  129. else if(message.startsWith("?progression")) {
  130. client.say(channel, "http://www.streamdefense.com/huge-class-progression-update-details/");
  131. }
  132. else if(message.startsWith("?bounty")) {
  133. client.say(channel, "http://www.streamdefense.com/bounties/");
  134. }
  135. else if(message.startsWith("?expstats")) {
  136. client.say(channel, "https://docs.google.com/spreadsheets/d/1f6oyKASgX48UNNSbk2vtNG2MqmTPWgWQFAftBV7ufmw/edit?usp=sharing");
  137. }
  138. }
  139. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement