Guest User

Untitled

a guest
Aug 3rd, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. // ==UserScript==
  2. // @name CSGO Lounge Autobump
  3. // @namespace http://steamcommunity.com/profiles/76561198065785055/
  4. // @version 1.6
  5. // @description Bumps trades on CSGO Lounge
  6. // @include http://csgolounge.com/mytrades*
  7. // @run-at document-end
  8. // @copyright 2014+, Sir Campsalot
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.  
  13. /*********** SETTINGS ***********/
  14.  
  15. var CSGOLoungeBumpOnePerReload = false; //bump only one trade per reload on CSGO Lounge?
  16. var CSGOLoungeWaitBetweenBump = false; //wait a few seconds between each trade bump? doesn't work with CSGOLoungeBumpOnePerReload
  17. var CSGOLoungeTimeBetweenEachBump = 10; //seconds between each bump when CSGOLoungeWaitBetweenBump is true
  18.  
  19. var CSGOLoungeRandomReloadTimes = false; //random page reload times on CSGOLounge?
  20. var CSGOLoungeReloadIfNotRandom = 1; //if not random page reload time, reload time for all trade bump on CSGO Lounge
  21. var CSGOLoungeMaxReloadTime = 5; //max random reload time for all trade bump on CSGO Lounge
  22. var CSGOLoungeMinReloadTime = 1; //minimum random reload time for all trade bump on CSGO Lounge
  23.  
  24. /******** END OF SETTINGS *******/
  25.  
  26. function randominrange(low,high) {return Math.round(Math.random()*(high-low)+low);}
  27.  
  28. function notify(notify) {
  29. var divid = "stab"; //lol the acronym for steam trade autobump is stab
  30. var div = document.getElementById(divid);
  31. if (!div) {
  32. var trades = document.getElementById("main");
  33. var div = document.createElement("div");
  34. div.id = divid;
  35. trades.insertBefore(div, trades.childNodes[0]);
  36. }
  37. div.innerHTML = notify;
  38. }
  39.  
  40. function showstatus() {
  41. reload_time -= 1;
  42. if (reload_time <= 0) {
  43. clearInterval(counter);
  44. location.reload();
  45. return;
  46. }
  47. var min = Math.floor(reload_time/60);
  48. var sec = reload_time - min*60;
  49. if (sec<10) notify("CSGO Lounge AutoBump: Reloading page in "+min+":0"+sec);
  50. else notify("CSGO Lounge AutoBump: Reloading page in "+min+":"+sec);
  51. }
  52.  
  53. function bump_trades() {
  54. xpr = document.evaluate(".//div[@class='tradepoll']/div[@class='tradeheader']/a[@class='buttonright']", document, null, XPathResult.ANY_TYPE, null);
  55. anchor = xpr.iterateNext();
  56. if (anchor && anchor.getAttribute('onclick')) {
  57. anchor.click();
  58. if (!CSGOLoungeBumpOnePerReload) {
  59. if (CSGOLoungeWaitBetweenBump) setTimeout(bump_trades,(CSGOLoungeTimeBetweenEachBump*1000));
  60. else setTimeout(bump_trades,5);
  61. }
  62. }
  63. reload_time = RELOAD_MINUTES*60;
  64. counter = setInterval(showstatus, 1000);
  65. }
  66.  
  67. var reload_time, counter, RELOAD_MINUTES;
  68. if (CSGOLoungeRandomReloadTimes) RELOAD_MINUTES = randominrange(CSGOLoungeMinReloadTime,CSGOLoungeMaxReloadTime);
  69. else RELOAD_MINUTES = CSGOLoungeReloadIfNotRandom;
  70. bump_trades();
  71. }).call(this);
Add Comment
Please, Sign In to add comment