Advertisement
b3xus

bomparty.sparklinlabs.com code + bot

Jan 8th, 2020
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.51 KB | None | 0 0
  1. AUTOJOIN : javascript:channel.socket.on("endGame", function (e){channel.socket.emit("join");});
  2. ----------------------------------------------------------------------------------------------------------------
  3. AUTOKICK : whitelist = ["twitter:2612276544", "ID"] //add or remove id players
  4. channel.socket.on("addActor", function (e)
  5. {
  6. if(whitelist.indexOf(e.authId) == -1)
  7. channel.socket.emit("banUser", {authId:e.authId, displayName:e.displayName});
  8. setTimeout(function(){}, 2000);
  9. channel.socket.emit("unbanUser", e.authId);
  10. });
  11. -----------------------------------------------------------------------------------------------------------------
  12. AUTOMOD : channel.socket.on("addUser", function (user) { channel.socket.emit("modUser", {authId:user.authId, displayName:user.displayName}); });
  13. -----------------------------------------------------------------------------------------------------------------
  14. DEBAN : for(var id in channel.data.bannedUsersByAuthId){channel.socket.emit("unbanUser",id)}
  15. -----------------------------------------------------------------------------------------------------------------
  16. UNMOD: for(var i =0; i < channel.data.users.length; i ++){
  17. if(channel.data.users[i].role === 'moderator'){
  18. channel.socket.emit("unmodUser", channel.data.users[i].authId)
  19. }
  20. }
  21.  
  22. ------------------------------------------------------------------------------------------ ceci est un bot après la ligne
  23. function writeChat(text){
  24. var line = document.createElement('li');
  25. line[(typeof document.body.style.WebkitAppearance=="string")?"innerText":"innerHTML"] = text;
  26. document.getElementById("ChatLog").appendChild(line);
  27. }
  28.  
  29. function updateStatus(text){
  30. currentStatus[(typeof document.body.style.WebkitAppearance=="string")?"innerText":"innerHTML"] = text;
  31. }
  32.  
  33. function setWord(w, i){
  34. channel.socket.emit("setWord", {word: w.substring(0,i),validate: (w.length == i)});
  35. if (i<w.length && injector.canWrite) {
  36. setTimeout(function(){setWord(w,++i);},rand(75,175));
  37. }
  38. }
  39.  
  40. function rand(min, max){
  41. return Math.trunc(Math.random()*(max-min)+min);
  42. }
  43.  
  44. channel.socket.on("setActivePlayerIndex", function (a) {
  45. if(channel.data.actors[channel.data.activePlayerIndex].authId === app.user.authId){
  46. injector.canWrite = true
  47. if (injector.autoInject) {
  48. setTimeout(injector.inject,rand(400,1100));
  49. }
  50. } else {
  51. injector.canWrite = false;
  52. }
  53. });
  54. channel.socket.on("failWord", function (a) {
  55. if(channel.data.actors[channel.data.activePlayerIndex].authId === app.user.authId && injector.autoInject){
  56. setTimeout(injector.inject,rand(400,1100));
  57. }
  58. });
  59.  
  60. var injector = {
  61. lastWord: 0,
  62. autoInject: false,
  63. canWrite: false,
  64.  
  65. toggleAutoInject: function(){
  66. if(injector.autoInject){
  67. injector.autoInject = false;
  68. autoInjectIndicator[(typeof document.body.style.WebkitAppearance=="string")?"innerText":"innerHTML"] = 'Auto Inject Off';
  69. } else {
  70. injector.autoInject = true;
  71. autoInjectIndicator[(typeof document.body.style.WebkitAppearance=="string")?"innerText":"innerHTML"] = 'Auto Inject On';
  72. }
  73. },
  74.  
  75. inject: function() {
  76. if(window.app.user.authId == channel.data.actors[channel.data.activePlayerIndex].authId){
  77. updateStatus("Injecting normally");
  78. var q = new RegExp(channel.data.wordRoot,"i");
  79. var i = injector.lastWord;
  80. while(i != ++injector.lastWord && injector.canWrite){
  81. if(injector.lastWord==french.length){
  82. injector.lastWord = 0;
  83. }
  84. if(french[injector.lastWord].match(q)){
  85. for(var j = 0;j<channel.data.actorsByAuthId[window.app.user.authId].lockedLetters.length;j++){
  86. if(french[injector.lastWord].match(new RegExp(channel.data.actorsByAuthId[window.app.user.authId].lockedLetters[j],"i"))) {
  87. setWord(french[injector.lastWord],1);
  88. return;
  89. }
  90. }
  91. }
  92. }
  93. injector.lastWord = 0;
  94. updateStatus("Normal Inject Failed");
  95. }
  96. }
  97. };
  98.  
  99. function createInLine(parent,newThingType){
  100. var line = document.createElement('li');
  101. var thing = document.createElement(newThingType);
  102. parent.appendChild(line);
  103. line.appendChild(thing);
  104. return thing;
  105. }
  106.  
  107. parentThing = document.getElementById("SettingsTab");
  108. parentThing.align = "left";
  109. injectButton = createInLine(parentThing,'button');
  110. injectButton[(typeof document.body.style.WebkitAppearance=="string")?"innerText":"innerHTML"] = 'Inject';
  111. injectButton.addEventListener('click',injector.inject);
  112. autoButton = createInLine(parentThing,'button');
  113. autoButton[(typeof document.body.style.WebkitAppearance=="string")?"innerText":"innerHTML"] = 'Auto ';
  114. autoButton.addEventListener('click',injector.toggleAutoInject);
  115. var autoInjectIndicator = document.createElement('li');
  116. parentThing.appendChild(autoInjectIndicator);
  117. var currentStatus = document.createElement('li');
  118. parentThing.appendChild(currentStatus);
  119. var frenchcript = document.createElement("script");
  120. frenchcript.src = "https:/dl.dropboxusercontent.com/s/71g8piyztu7qytf/DictionnaireFinal.js";
  121. document.head.appendChild(frenchcript);
  122. -----------------------------------------------------------------------------------------------------------
  123. http://bombparty.sparklinlabs.com/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement