DMCFaucetBot in it's current state


SUBMITTED BY: Guest

DATE: Oct. 17, 2013, 5:06 p.m.

FORMAT: JavaScript

SIZE: 1.6 kB

HITS: 1056

  1. var io = require('socket.io-client');
  2. socket = io.connect("https://coinchat.org", {
  3. secure: true
  4. });
  5. var username = "DMCFaucetBot";
  6. var outputBuffer = [];
  7. socket.on('connect', function () {
  8. socket.emit('login', {
  9. session: "removed"
  10. });
  11. socket.on('loggedin', function (data) {
  12. username = data.username;
  13. setTimeout(function () {
  14. socket.emit("getcolors", {});
  15. }, 1000);
  16. setInterval(function () {
  17. if (outputBuffer.length > 0) {
  18. var chat = outputBuffer.splice(0, 1)[0];
  19. socket.emit("chat", {
  20. room: chat.room,
  21. message: chat.message
  22. });
  23. }
  24. }, 600);
  25. });
  26. socket.emit('joinroom', {
  27. join: 'dmcfaucet'
  28. });
  29. socket.emit('joinroom', {
  30. join: 'offtopic'
  31. });
  32. socket.on('chat', function (data) {
  33. if (data.message === "!dmc admin terminate: faucet" && (data.room === "offtopic" || data.room === "dmcfaucet" ) && (data.user === "DiamondCardz" || data.user === "admin")) {
  34. throw new Error();
  35. }
  36. });
  37. socket.on('disconnect', function () {});
  38. });
  39. function contains(string, terms) {
  40. for (var i = 0; i < terms.length; i++) {
  41. if (string.toLowerCase().indexOf(terms[i].toLowerCase()) == -1) {
  42. return false;
  43. }
  44. }
  45. return true;
  46. }

comments powered by Disqus