京东金融-小游戏

京东金融里面的一些小游戏. 实际上就猪和鹅可以挂挂。有可能会出现“提示抱歉,您暂时无法参加此活动”/“请使用金融APP”这个就不能用了。F12调试模式手机模式:https://prodev.m.jd.com/jdjr/active/4VE6AewA8CFAiLtykFc2wEjbWaVy/index.html

  1. // ==UserScript==
  2. // @name 京东金融-小游戏
  3. // @namespace https://greasyfork.org/zh-CN/scripts/400136
  4. // @match https://prodev.m.jd.com/jdjr/active/4VE6AewA8CFAiLtykFc2wEjbWaVy/index.html
  5. // @match https://*.jr.jd.com/uc-fe-wxgrowing/cloudpig/index/*
  6. // @match https://*.jr.jd.com/uc-fe-wxgrowing/moneytree/index/*
  7. // @match https://active.jd.com/forever/btgoose/*
  8. // @grant GM_getValue
  9. // @grant GM_setValue
  10. // @version 1.7
  11. // @author Lucas(?????????@qq.com)
  12. // @update Lucas(?????????@qq.com)
  13. // @description 京东金融里面的一些小游戏. 实际上就猪和鹅可以挂挂。有可能会出现“提示抱歉,您暂时无法参加此活动”/“请使用金融APP”这个就不能用了。F12调试模式手机模式:https://prodev.m.jd.com/jdjr/active/4VE6AewA8CFAiLtykFc2wEjbWaVy/index.html
  14. // ==/UserScript==
  15.  
  16. (function() {
  17. setTimeout(function(){
  18. reloadpage();
  19. Everyoneisplaying();
  20. goodapple();
  21. pig();
  22. goose();
  23. }, 4000);
  24. })();
  25.  
  26. function log() {
  27. var text = '%c';
  28. for(var i=0;i<arguments.length;i++){
  29. text += arguments[i]+' ';
  30. }
  31. console.log(text, 'color: #43bb88;font-size: 14px;font-weight: bold');
  32. }
  33.  
  34. function reloadpage() {
  35. let timeid = setInterval(function() {
  36. var myDate = new Date();
  37. var hours=myDate.getHours();
  38. var reload_page = GM_getValue("reload_page");
  39. if (typeof(reload_page)=="undefined") {
  40. GM_setValue("reload_page","start");
  41. }
  42.  
  43. //每4小时刷新一下当前页面
  44. var reload=(hours%4);
  45. if (reload==0&&reload_page=="start") {
  46. GM_setValue("reload_page","stop")
  47. window.location.reload();
  48. };
  49. if (reload!=0&&reload_page=="stop") {
  50. GM_setValue("reload_page","start")
  51. };
  52. log("reload_page",reload_page,"reload",reload)
  53. }, 10000);
  54. }
  55.  
  56. function Everyoneisplaying() {
  57. log('奥利给!!!大家都在玩,开干~');
  58. log(new Date());
  59.  
  60. let timeid = setInterval(function() {
  61. var myDate = new Date();
  62. var hours=myDate.getHours();
  63. var mins=myDate.getMinutes();
  64. var secs=myDate.getSeconds();
  65. var url=window.location.href;
  66.  
  67. var uua="https://uua.jr.jd.com/uc-fe-wxgrowing/moneytree/index/?Channel=jhy"
  68. var u="https://u.jr.jd.com/uc-fe-wxgrowing/moneytree/index/?channelLV=dao"
  69.  
  70. //判断是否在任务中心
  71. var reg = RegExp(/prodev.m.jd.com\/jdjr\/active/);
  72. if (url.match(reg)){
  73. //每5小时跳转到金果页面看看
  74. var jump=(hours%5);
  75. if (jump==0&&mins==0&&secs<10) {
  76. window.location.replace(uua);
  77. };
  78. }
  79. }, 60000);
  80. }
  81.  
  82.  
  83. function goodapple() {
  84. log('奥利给!!!种摇钱树,开干~');
  85. log(new Date());
  86.  
  87. let timeid = setInterval(function() {
  88. var myDate = new Date();
  89. var hours=myDate.getHours();
  90. var mins=myDate.getMinutes();
  91. var secs=myDate.getSeconds();
  92.  
  93. //金果==========================================
  94. if (document.getElementsByClassName("modal-btn")[0]) {
  95. log("需要APP,退出");
  96. setTimeout(function() {
  97. document.getElementsByClassName("modal-close")[0].click();
  98. },4000);
  99. //返回到主页
  100. window.location.replace("https://prodev.m.jd.com/jdjr/active/4VE6AewA8CFAiLtykFc2wEjbWaVy/index.html");
  101. }
  102. else {
  103. if (document.getElementsByClassName("tree-volume")[0]) {
  104. var s = document.getElementsByClassName("tree-volume")[0].innerText;
  105. var num = document.getElementsByClassName("tree-curnum")[0].innerText;
  106. var numup= s.replace(/[^0-9]/ig,"");
  107. num = num.replace(/[^0-9]/ig,"");
  108. numup = parseFloat(numup);
  109. num = parseFloat(num);
  110. log("金果 ->> " + num + "/" + numup );
  111. if (num >= 20) {
  112. log("金果到" + num);
  113. document.getElementsByClassName("tree-btn")[0].children[0].click();
  114. //返回到主页
  115. window.location.replace("https://prodev.m.jd.com/jdjr/active/4VE6AewA8CFAiLtykFc2wEjbWaVy/index.html");
  116. };
  117. };
  118. }
  119.  
  120. }, 10000);
  121. }
  122.  
  123.  
  124.  
  125.  
  126.  
  127. function pig() {
  128. log('奥利给!!!全民养小猪,开干~');
  129. log(new Date());
  130.  
  131. GM_setValue("sign","签到")
  132.  
  133. let timeid = setInterval(function() {
  134. var myDate = new Date();
  135. var hours=myDate.getHours();
  136. var mins=myDate.getMinutes();
  137. var secs=myDate.getSeconds();
  138.  
  139. //0:6:0~0:0:10刷新一次
  140. if (hours==6&&mins==0&&(secs>=0&&secs<=10)) {
  141. window.location.reload();
  142. }
  143.  
  144. //小猪礼盒
  145. if (document.getElementsByClassName("precious precious-one precious-pos-1 springback")[0]) {
  146. log("小猪礼盒1");
  147. document.getElementsByClassName("precious precious-one precious-pos-1 springback")[0].click();
  148. };
  149. if (document.getElementsByClassName("precious precious-one precious-pos-2 springback")[0]) {
  150. log("小猪礼盒2");
  151. document.getElementsByClassName("precious precious-one precious-pos-2 springback")[0].click();
  152. };
  153. //签到
  154. var sign=GM_getValue("sign");
  155. if (hours==7&&sign=="签到") {
  156. if ( document.getElementsByClassName("main-icon main-icon-sign")[0]) {
  157. document.getElementsByClassName("main-icon main-icon-sign")[0].click();
  158. };
  159. if (document.getElementsByClassName("sign-btn-disable")[0]) {
  160. GM_setValue("sign","已签");
  161. }
  162. if (document.getElementsByClassName("sign-btn")[0]) {
  163. document.getElementsByClassName("sign-btn")[0].click();
  164. GM_setValue("sign","已签");
  165. };
  166. if ( document.getElementsByClassName("sign-close")[0]) {
  167. document.getElementsByClassName("sign-close")[0].click();
  168. };
  169. } else if(hours!=7) {
  170. GM_setValue("sign","签到")
  171. }
  172. //30分钟查看一下能否免费抽奖
  173. var Min=parseInt(myDate.getMinutes());
  174. if ( Min%30 === 0&&document.getElementsByClassName("cloud-foot")[0] ) {
  175. document.getElementsByClassName("cloud-foot")[0].children[0].click();
  176. var str = document.getElementsByClassName("luck-btngroup")[0].children[0].innerText;
  177. var reg = RegExp(/免费/);
  178. var reg1 = RegExp(/金币/);
  179. if(str.match(reg)){
  180. log("免费抽");
  181. document.getElementsByClassName("luck-btngroup")[0].children[0].click();
  182. if (document.getElementsByClassName("precious-btn")[0]) {
  183. document.getElementsByClassName("precious-btn")[0].click();
  184. };
  185. }
  186. else if (str.match(reg1)){
  187. log("要金币,退出");
  188. document.getElementsByClassName("luck-close")[0].click();
  189. if (document.getElementsByClassName("precious-btn")[0]) {
  190. document.getElementsByClassName("precious-btn")[0].click();
  191. };
  192. }
  193. }
  194. //小猪吃完了么,看看能否喂食了
  195. if (document.getElementsByClassName("draw-feed-btn")[0]) {
  196. log("喂小猪吃食啦!");
  197. setTimeout(function(){
  198. document.getElementsByClassName("draw-trough-img")[0].click();
  199. //document.getElementsByClassName("feed-list")[0].children[0].click();
  200. document.getElementsByClassName("feed-item-btn")[0].click();
  201. document.getElementsByClassName("feed-close")[0].click();
  202. }, 1000);
  203. };
  204. }, 2000);
  205. }
  206.  
  207.  
  208. function goose() {
  209.  
  210. log('奥利给!!!天天提鹅 ,开干~');
  211. log(new Date());
  212.  
  213. let timeid = setInterval(function() {
  214. var myDate = new Date();
  215. var hours=myDate.getHours();
  216. var mins=myDate.getMinutes();
  217. var secs=myDate.getSeconds();
  218.  
  219. //鹅=========================================
  220. if (document.getElementsByClassName("stage-num udc-bold")[0]) {
  221. var egg=document.getElementsByClassName("stage-num udc-bold")[0].innerText
  222. egg=parseFloat(egg);
  223. log("鹅蛋->>" + egg );
  224. if (egg>=30) {
  225. log("收鹅蛋了");
  226. if (document.getElementsByClassName("main-stage")[0].children[0]) {
  227. document.getElementsByClassName("main-stage")[0].children[0].click();
  228. };
  229. };
  230. };
  231.  
  232. if (document.getElementsByClassName("dialog-btn-area")[0]) {
  233. document.getElementsByClassName("dialog-btn-area")[0].children[0].click();
  234. };
  235.  
  236.  
  237.  
  238. }, 60000);
  239. }