sub

try to take over the world!

  1. // ==UserScript==
  2. // @name sub
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3.10
  5. // @description try to take over the world!
  6. // @author cx
  7. // @match https://buy.damai.cn/orderConfirm*
  8. // @run-at document-end
  9. // @grant none
  10. // @require http://code.jquery.com/jquery-1.11.1.min.js
  11. // ==/UserScript==
  12. var time;
  13. (function() {
  14. var url = window.location.href;
  15. if(url.indexOf("umidToken") == -1){
  16. var cookie = getCookie("UUrl");
  17. console.log(cookie);
  18. if(cookie != null && cookie != ''){
  19. window.location.href = cookie;
  20. }
  21. }
  22. $(".next-checkbox-label").click();
  23. sub();
  24.  
  25. function sub() {
  26. if($(".ticket-buyer-detail-item").html()!=''){
  27. $(".submit-wrapper>button").click();
  28. }else{
  29. $(".next-checkbox-label").click();
  30. $(".submit-wrapper>button").click();
  31. }
  32. again();
  33. }
  34.  
  35. function again() {
  36. var txt = $(".opened").closest("div").html();
  37. console.log("+++++++++++:"+txt);
  38. if(txt == undefined || txt.indexOf("请稍后") != -1){
  39. setTimeout(function (e) {
  40. requestAnimationFrame(again);
  41. },200);
  42. }else if(txt.indexOf("您今天下单次数太多啦,休息一下明天再来吧") == -1){
  43. if(txt.indexOf("爆") != -1 || txt.indexOf("休息") != -1 || txt.indexOf("订单") == -1 || txt.indexif("建议您稍后再试") != -1){
  44. window.location.reload();
  45. }
  46. }
  47. }
  48.  
  49.  
  50. // 读取cookie
  51. function getCookie(c_name) {
  52. if (document.cookie.length > 0) {
  53. var c_start = document.cookie.indexOf(c_name + "=");
  54. if (c_start != -1){
  55. c_start = c_start + c_name.length + 1;
  56. var c_end = document.cookie.indexOf(";", c_start);
  57. if (c_end == -1)
  58. c_end = document.cookie.length;
  59. return unescape(document.cookie.substring(c_start, c_end));
  60. }
  61. }
  62. return "";
  63. }
  64. })();