橙光无限鲜花

使用说明:进入游戏后右上角点击启用

// ==UserScript==
// @name         橙光无限鲜花
// @version      1.0.0.3
// @namespace    http://tampermonkey.net/
// @description  使用说明:进入游戏后右上角点击启用
// @author       希尔顿
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @match        https://*.66rpg.com/h5/*
// ==/UserScript==
;(function () {
  'use strict'

  var e = document.createElement('button')
  var c = document.createElement('button')
  function d(b) {
    console.log(b)
  }
  function b(b) {
    d('Node 1 test passed')
    d('Executing commands:', b)
    eval(b)
  }
  function f(e, a, g = 10) {
    setTimeout(function () {
      if (typeof GloableData !== 'undefined') {
        b(e)
      } else if (g > 0) {
        d(
          'GloableData is not defined yet. Retrying in 1 second. Retry count: ' +
            (10 - g)
        )
        setTimeout(function () {
          f(e, a, g - 1)
        }, a)
      } else {
        d('Failed to retrieve GloableData.')
      }
    }, 450)
  }
  let g = false
  const h = () => {
    if (!g) {
      a()
    } else {
      j()
    }
  }
  const a = () => {
    const b = document.documentElement
    g = true
    e.style.display = 'none'
    if (b.requestFullscreen) {
      b.requestFullscreen()
    } else if (b.mozRequestFullScreen) {
      b.mozRequestFullScreen()
    } else if (b.webkitRequestFullscreen) {
      b.webkitRequestFullscreen()
    }
    if (screen.orientation?.lock('landscape')) {
    }
  }
  const j = () => {
    g = false
    e.style.display = 'block'
    if (document.exitFullscreen) {
      document.exitFullscreen()
    } else if (document.mozCancelFullScreen) {
      document.mozCancelFullScreen()
    } else if (document.webkitExitFullscreen) {
      document.webkitExitFullscreen()
    }
    if (screen.orientation?.unlock()) {
    }
  }
  const k = () => {
    if (
      document.fullscreenElement ||
      document.mozFullScreenElement ||
      document.webkitFullscreenElement
    ) {
      g = true
      e.style.display = 'none'
      l()
    } else {
      g = false
      e.style.display = 'block'
      l()
    }
  }
  const l = () => {
    if (g) {
      c.style.display = 'block'
    } else {
      c.style.display = 'none'
    }
  }
  var m = XMLHttpRequest.prototype.open
  XMLHttpRequest.prototype.open = function (c, a) {
    // 屏蔽
    if (a.match(/^https:\/\/www\.66rpg\.com\/ajax\/TryPlay\/get_try_play_/)) {
      console.log('Blocked AJAX request:', a)
      return
    }
    m.apply(this, arguments)
  }
  function n() {
    var c = ''
    for (let a = 1; a <= 40; a++) {
      c +=
        'GloableData.getInstance().mallBuyItem[' +
        a +
        '] = { id: ' +
        a +
        ', count: -666666666, max: 66666 }; '
    }
    f(c, 100)
  }
  function o() {
    for (let d = 0; d < localStorage.length; d++) {
      const a = localStorage.key(d)
      const b = localStorage.getItem(a)
      console.log('Key: ' + a + ', Value: ' + b)
    }
  }
  function p() {
    Object.defineProperty(window, 'debugger', {
      get: function () {
        return undefined
      },
      set: function () {},
    })
    d('Node 2 test passed')
    n()
  }
  ;(function () {
    Function.prototype.__constructor_back = Function.prototype.constructor
    Function.prototype.constructor = function () {
      if (arguments && typeof arguments[0] === 'string') {
        if (arguments[0] === 'debugger') {
          return
        }
      }
      return Function.prototype.constructor_back.apply(this, arguments)
    }
  })()
  document.addEventListener('fullscreenchange', k)
  document.addEventListener('webkitfullscreenchange', k)
  document.addEventListener('mozfullscreenchange', k)
  setTimeout(function () {
    var d = localStorage.getItem('lastInputValue')
    if (d !== null) {
      f(parseInt(d))
    }
    e.textContent = '自定义鲜花数'
    e.style.backgroundColor = 'rgba(128, 128, 128, 0.5)'
    e.style.color = '#ffffff'
    e.style.border = 'none'
    e.style.zIndex = '9999'
    e.style.borderRadius = '50%'
    e.style.padding = '10px'
    e.style.position = 'fixed'
    e.style.top = '20px'
    e.style.right = '20px'
    e.style.select = 'none'
    e.style.border = 'none'
    e.style.cursor = 'pointer'
    document.body.appendChild(e)
    e.addEventListener('click', function () {
      var b = prompt('请输入数值', localStorage.getItem('lastInputValue'))
      b = parseInt(b)
      if (!isNaN(b) && b > 0) {
        localStorage.setItem('lastInputValue', b)
        f(b)
        h()
      } else if (b === null) {
        var d = localStorage.getItem('lastInputValue')
        if (d !== null) {
          f(parseInt(d))
        }
        h()
      } else {
        alert('输入有效正数,需把null叉掉')
      }
    })
    c.style.position = 'fixed'
    c.style.zIndex = '9999'
    c.style.top = '10px'
    c.style.left = '10px'
    c.textContent = '退出'
    c.style.userSelect = 'none'
    c.style.display = 'none'
    c.addEventListener('click', j)
    document.body.appendChild(c)
    function f(b) {
      p()
      if (typeof userData !== 'undefined') {
        // 鲜花数量
        userData.totalFlower = b
      }
      if (typeof gIndex !== 'undefined') {
        // 发布新游戏,商品设置24个0鲜花,填入游戏ID
        gIndex = '1670380'
      }
    }
  }, 100)
})()