Advertisement
Guest User

CSGOL Auto Clicker

a guest
Nov 27th, 2014
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.17 KB | None | 0 0
  1. // ==UserScript==
  2. // @name LoungeSpammer
  3. // @namespace LoungeSpammer
  4. // @author mreq http://github.com/mreq
  5. // @include http://csgolounge.com/*
  6. // @include http://dota2lounge.com/*
  7. // @version 0.2.7
  8. // @downloadURL http://cdn.mreq.eu/LoungeSpammer.user.js
  9. // @updateURL http://cdn.mreq.eu/LoungeSpammer.user.js
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. var Base, BetSpammer, BotsChecker, ReturnsSpammer, Spammer, init,
  14. __hasProp = {}.hasOwnProperty,
  15. __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
  16.  
  17. Base = (function() {
  18. function Base() {}
  19.  
  20. Base.prototype.initNotifications = function() {
  21. if (!('Notification' in window)) {
  22. return this.notify = function() {
  23. return console.log('Notifications not supported.');
  24. };
  25. } else if ((window.Notification.permission !== 'granted') && (window.Notification.permission !== 'denied')) {
  26. return this.permitNotifications();
  27. }
  28. };
  29.  
  30. Base.prototype.permitNotifications = function() {
  31. return window.Notification.requestPermission((function(_this) {
  32. return function(p) {
  33. if (!('permission' in window.Notification)) {
  34. window.Notification.permission = p;
  35. }
  36. if (p !== 'granted') {
  37. _this.notify = function() {
  38. return console.log('Notifications not allowed.');
  39. };
  40. }
  41. return _this.notify('Success! LoungeSpammer can now use notifications.');
  42. };
  43. })(this));
  44. };
  45.  
  46. Base.prototype.notify = function(body) {
  47. var options;
  48. options = {
  49. body: body,
  50. icon: 'http://i.imgur.com/bWiPLuy.png'
  51. };
  52. return new window.Notification('LoungeSpammer', options);
  53. };
  54.  
  55. return Base;
  56.  
  57. })();
  58.  
  59. BotsChecker = (function(_super) {
  60. __extends(BotsChecker, _super);
  61.  
  62. function BotsChecker() {
  63. this.createBox();
  64. this.check();
  65. this.autoChecking = false;
  66. this.bindButton();
  67. }
  68.  
  69. BotsChecker.prototype.createBox = function() {
  70. this.wrap = $('');
  71. $('#submenu').prepend(this.wrap);
  72. this.content = this.wrap.find('#loungespammer-status');
  73. return this.button = this.wrap.find('#loungespammer-status-spam');
  74. };
  75.  
  76. BotsChecker.prototype.check = function() {
  77. return $.get('status', (function(_this) {
  78. return function(data) {
  79. var old;
  80. old = _this.online;
  81. _this.online = data.match('BOTS ARE ONLINE') !== null;
  82. _this.offline = data.match('BOTS ARE ONLINE') !== null;
  83. if (!(_this.online || _this.offline)) {
  84. clearInterval(_this.interval);
  85. _this.content.text('UNKNOWN').css('color', 'yellow');
  86. return _this.button.hide().after('<div style="width: 100%;">The <a href="/status" target="_blank" style="background: none; padding: 0; display: inline; float: none; text-decoration: none; border: 0;">Bots status</a> page is either disabled or doesn\'t load.</div>');
  87. } else {
  88. if (old !== _this.online) {
  89. _this.correctContent();
  90. }
  91. if (_this.autoChecking && _this.online) {
  92. clearInterval(_this.interval);
  93. return _this.notify('Bots are now online!');
  94. }
  95. }
  96. };
  97. })(this));
  98. };
  99.  
  100. BotsChecker.prototype.autoCheck = function() {
  101. this.autoChecking = true;
  102. this.i = 0;
  103. this.interval = setInterval(((function(_this) {
  104. return function() {
  105. _this.i++;
  106. _this.check();
  107. return _this.button.text("Bots still offline, checking every 10 seconds. Last checked at " + (Date().match(/\d+:\d+:\d+/)[0]) + ".");
  108. };
  109. })(this)), 10000);
  110. this.i++;
  111. this.check();
  112. return this.button.css('color', '').text("Bots still offline, checking every 10 seconds. Last checked at " + (Date().match(/\d+:\d+:\d+/)[0]) + ".");
  113. };
  114.  
  115. BotsChecker.prototype.bindButton = function() {
  116. return this.button.one('click', (function(_this) {
  117. return function() {
  118. _this.initNotifications();
  119. return _this.autoCheck();
  120. };
  121. })(this));
  122. };
  123.  
  124. BotsChecker.prototype.correctContent = function() {
  125. if (this.online) {
  126. this.content.text('ONLINE').css('color', 'green');
  127. return this.button.hide();
  128. } else {
  129. this.content.text('OFFLINE').css('color', 'red');
  130. return this.button.show();
  131. }
  132. };
  133.  
  134. return BotsChecker;
  135.  
  136. })(Base);
  137.  
  138. Spammer = (function(_super) {
  139. __extends(Spammer, _super);
  140.  
  141. function Spammer() {
  142. this.overwriteAlert();
  143. this.addButton();
  144. }
  145.  
  146. Spammer.prototype.createBox = function() {
  147. this.box = $("<section class=\"box\" style=\"display: none;\">\n <div class=\"title\">Status</div>\n <article class=\"standard\" style=\"margin-top: 50px; margin-bottom: 0;\" id=\"loungespammer\"></article>\n <article class=\"standard\" style=\"margin-top: 19px;\"><em>Does this script help you?</em> Be kind and say <a href=\"http://steamcommunity.com/tradeoffer/new/?partner=16222794&token=BOqXsQwB\" target=\"_blank\">thanks to the author</a> &lt;3.</article>\n</section>");
  148. $('#main > .box').first().after(this.box);
  149. this.box.next('.box').css('float', 'right');
  150. return this.content = this.box.find('#loungespammer');
  151. };
  152.  
  153. Spammer.prototype.overwriteAlert = function() {
  154. this.i = 0;
  155. this.messages = [];
  156. this.createBox();
  157. return window.alert = (function(_this) {
  158. return function(c) {
  159. _this.box.show();
  160. if (_this.messages.indexOf(c) === -1) {
  161. _this.messages.push(c);
  162. }
  163. return _this.content.html("<strong>" + c + "</strong><br><br>\nTried " + _this.i + " times over the last " + (Math.floor((Date.now() - _this.startTime) / 60000)) + " minute(s).<br><br>\nMessages so far:<br>\n<ul style=\"padding-left: 30px;\">\n <li style=\"padding-top: 5px;\">" + (_this.messages.join('</li><li style="padding-top: 5px;">')) + "</li>\n</ul>");
  164. };
  165. })(this);
  166. };
  167.  
  168. Spammer.prototype.startSpamming = function() {
  169. this.startTime = Date.now();
  170. this.spamLounge();
  171. return setInterval(((function(_this) {
  172. return function() {
  173. return _this.spamLounge();
  174. };
  175. })(this)), 1000);
  176. };
  177.  
  178. Spammer.prototype.addButton = function() {
  179. return this.spamButton.one('click', (function(_this) {
  180. return function() {
  181. _this.initNotifications();
  182. return _this.startSpamming();
  183. };
  184. })(this));
  185. };
  186.  
  187. Spammer.prototype.spamLounge = function() {
  188. this.i++;
  189. return this.button.click();
  190. };
  191.  
  192. return Spammer;
  193.  
  194. })(Base);
  195.  
  196. BetSpammer = (function(_super) {
  197. __extends(BetSpammer, _super);
  198.  
  199. function BetSpammer() {
  200. this.button = $('#placebut');
  201. BetSpammer.__super__.constructor.apply(this, arguments);
  202. }
  203.  
  204. BetSpammer.prototype.addButton = function() {
  205. this.spamButton = $('<a class="buttonright" style="margin-left: 5px;" id="loungespammer-button">Spam place bet</a>');
  206. BetSpammer.__super__.addButton.apply(this, arguments);
  207. return this.button.before(this.spamButton);
  208. };
  209.  
  210. return BetSpammer;
  211.  
  212. })(Spammer);
  213.  
  214. ReturnsSpammer = (function(_super) {
  215. __extends(ReturnsSpammer, _super);
  216.  
  217. function ReturnsSpammer() {
  218. this.button = $('#freezebutton');
  219. ReturnsSpammer.__super__.constructor.apply(this, arguments);
  220. }
  221.  
  222. ReturnsSpammer.prototype.addButton = function() {
  223. this.spamButton = $('<a class="button" style="margin-left: 5px;" id="loungespammer-button">Spam request returns</a>');
  224. ReturnsSpammer.__super__.addButton.apply(this, arguments);
  225. return this.button.after(this.spamButton);
  226. };
  227.  
  228. ReturnsSpammer.prototype.startSpamming = function() {
  229. ReturnsSpammer.__super__.startSpamming.apply(this, arguments);
  230. return this.spamLounge();
  231. };
  232.  
  233. return ReturnsSpammer;
  234.  
  235. })(Spammer);
  236.  
  237. init = function() {
  238. var url;
  239. url = window.location.href;
  240. if (url.match('mybets') !== null) {
  241. new ReturnsSpammer;
  242. } else if (url.match('match') !== null) {
  243. new BetSpammer;
  244. }
  245. return new BotsChecker;
  246. };
  247.  
  248. init();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement