Guest User

Untitled

a guest
Jul 27th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Bulk Set Buyer
  3. // @namespace http://tampermonkey.net/
  4. // @version Alpha
  5. // @description Automatically buy all cards for a Set
  6. // @author Alphabeta_g
  7. // @website
  8. // @match *://steamcommunity.com/*/gamecards/*
  9. // @require https://code.jquery.com/jquery-3.1.1.min.js
  10. // @grant GM_addStyle
  11. // ==/UserScript==
  12.  
  13.  
  14. $(".gamecards_inventorylink").append("<button class='btn_grey_grey btn_medium' style='padding:5px 20px;float:left;margin: 5px 10px' id='Buy'>Mass BUY</button>");
  15. $('#Buy').click(function(){
  16. var cards=[];
  17. var i=0;
  18. $(".badge_detail_tasks .badge_card_set_text").each(function(){
  19. cards[i]=$(this).text().replace(/\s+/g, " ");
  20. i++;
  21. });
  22. for(i=0;i<cards.length;i=i+2)
  23. {
  24.  
  25. var s=cards[i].trim();
  26. var j=0;
  27. if(s[0]=='(')
  28. {
  29. while(s[j]!=')')
  30. {
  31. j++;
  32. }
  33. s=s.substring(j+1,s.length);
  34. }
  35. else
  36. {
  37.  
  38. }
  39. cards[i]=s.trim().replace(/ /g,"%20");
  40.  
  41. console.log(cards[i]);
  42. }
  43. var gid2=window.location.pathname.split("/");
  44. var url="https://steamcommunity.com/market/multibuy?appid=753";
  45. var gid=gid2[4];
  46. var url2="";
  47. for(i=0;i<cards.length;i=i+2)
  48. {
  49. url2=url2+"&items[]="+gid+"-"+cards[i];
  50. }
  51. var url3=url+url2
  52. window.open(url3);
  53.  
  54.  
  55. })
Add Comment
Please, Sign In to add comment