NyQuery

Makes Money

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.gf.qytechs.cn/scripts/33763/222759/NyQuery.js

  1. // ==UserScript==
  2. // @name NyQuery
  3. // @namespace https://gf.qytechs.cn/users/144229
  4. // @version 1.1.5
  5. // @description Makes Money
  6. // @author MasterNyborg
  7. // @icon http://i.imgur.com/wS1IQwd.jpg
  8. // @require http://code.jquery.com/jquery-latest.min.js
  9. // ==/UserScript==
  10.  
  11. function hotKey(element, input){ //Adds click hotkey for given element(s) based on direct keyboard input (not event codes)
  12. $(document).keypress(function(event){
  13. if (String.fromCharCode(event.which) == input){
  14. $(element).click();
  15. }
  16. });
  17. }
  18.  
  19. function clickText(text, input){ //Adds click hotkey for any element containing given text (case sensitive) based on direct keyboard input
  20. $(document).keypress(function(event){
  21. if (String.fromCharCode(event.which) == input){
  22. $(':contains('+text+')').click();
  23. }
  24. });
  25. }
  26.  
  27. function randNum(min, max) { //returns a random integer between min and max
  28. return Math.floor(Math.random() * (max - min + 1)) + min;
  29. }
  30.  
  31. function newPic(href, w = "auto", h = "auto"){ //returns and img html object
  32. return `<img src=${href} style="width:${w}px;height:${h}px;"></img>`;
  33. }
  34.  
  35. function afterPic(obj, href, w = "auto", h = "auto"){ // adds an image after object. Object, url
  36. $(obj).after(newPic(href, w, h));
  37. }
  38.  
  39. function beforePic(obj, href, w = "auto", h = "auto"){ // adds an image before object. Object, url
  40. $(obj).before(newPic(href, w, h));
  41. }
  42.  
  43. function noRules(){ //replaces instructions with a hide/show button
  44. if($('.panel.panel-primary').length){ $('.panel.panel-primary').hide().before('<div><button id="toggle" style="background-color:#008CBA; border: none; color: white;" type="button">Show Instructions</button></div>');}
  45. $('#toggle').click(function () {
  46. $(this).text($(this).text() === 'Show Instructions' ? 'Hide Instructions' : 'Show Instructions');
  47. $('.panel-heading').toggle();
  48. $('.panel.panel-primary').toggle();
  49. });
  50. }
  51.  
  52. function newButt(id, text=id, cl="nybutt", bg="green"){ //returns an html button
  53. return `<button id=${id} class=${cl} style="background:${bg}; border: none; color: white; vertical-align:middle;" type="button">${text}</button>`;
  54. }
  55.  
  56. function clickButt(obj, func=$()){ //creates a click function for button (or anything really) functions purpose is for readability.
  57. $(obj).click(func);
  58. }
  59.  
  60. function gmGet(name) { //get local variable
  61. var theValue = GM_getValue(name);
  62. return theValue;
  63. }
  64.  
  65. function gmSet(name, valuee) { //set local variable
  66. GM_setValue(name, valuee);
  67. }
  68.  
  69. function newStyle(pop) { //changes style of html element
  70. var div = $('<div />', {
  71. html: '&shy;<style>' + pop + '</style>'
  72. } ).appendTo('body');
  73. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址