text 创世纪

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 创世纪相关的知识,希望对你有一定的参考价值。

/* This script doing rush run 1;2;3;4;5....10
*/
const baseBet = 100        // how many satoshis to bet initially
const target = 10          // target multiplier
const betMultiplier = 1.2  // what to multiply the bet size by when we lose a wager

let skipCount = 0
let loseFirst = 0
let maximumBet = 10000     // in satoshi, maximum bet could be made, until reset bet

let losesCount = 0
let lossCount = 0
let engine = this
/*if (loseFirst >= 0 ) { // make the bet and wait for the result
   const{multiplier} = await this.skip()

    if (target >= multiplier){
        loseFirst = -1
        this.log(`Target found,${multiplier} playing`)
    } else {
      skipCount++
      this.log(`skipped ${multiplier}`)
      losesCount = 0
      lossCount = 0
    }
    continue
  } else{} */

this.log(`Starting bet ${baseBet/100} bits.`)
while (true){
    const {multiplier, value}  = await makeBet() 
    if (lossCount > 2 && multiplier > 2){
       for (let i = 0; i < target / 2; i++) {let result = await this.skip()
        continue}
     }
    if (multiplier < target && value < maximumBet) { // loss
       lossCount++

       this.log(`Lost bet. Multiplying bet size by ${betMultiplier} for new bet size of ${betSize(lossCount)} satoshis.`)
    }
    else{ // win
      gong()
      await generateSeed()
      lossCount = 0
      losesCount = 0
      loseFirst = 0
      this.log(`Won bet. Setting bet size to ${baseBet/100} bits.`)
    }
  }
//}
async function makeBet() {
   collectSound()
   const{ multiplier, value} = await engine.bet(betSize(lossCount), target)

   engine.log(multiplier, value)
   return { multiplier, value}
}
function betSize(lossCount) {
  let bet = baseBet * Math.pow(betMultiplier, lossCount)
  if (bet >= maximumBet){
  bet = maximumBet
  }
  return Math.round(bet / 100) * 100
}

function sleep(ms){return new Promise(resolve => setTimeout(resolve, ms))}

function gong() {
  const audio = new Audio("https://bustadice.com/5bb187b7ef764e76fb519939f77288c1.mp3")
  audio.play()
  return new Promise(resolve => audio.onended = resolve)
}
function collectSound(){
    const audio = new Audio ("http://kz-developer.ru/sounds/chipsHandle6.wav")
    audio.play()
    return new Promise(resolve => audio.onended = resolve)
}
async function generateSeed(){
    const { server_seed_hash } = await engine.newSeedPair()
    engine.log(`Server seed: ${server_seed_hash}`)
    try {
        const clientSeed = randomSeed()
        await engine.setClientSeed(clientSeed)
        engine.log(`Seed was set to: ${clientSeed}`)
    }
    catch(e){
        engine.log(`Client seed already was reset and not used`)
    }
}
function randomSeed(){
    const words = ['Ze3foA1gAlpha ','Zefo3AG3B2r2a3qtwvo ','Zefo3AG313Charlie ','ZefoA22G3Delta ','Zef3o1GEcho ','ZefoA22G5oxtrot ','ZefoAG34G223tewlf ','Ze1o5A3GHotel ','ZefoA3dda ','Ze5f3Auliet ','ZefoAGK3agalo ','ZefoAG24rqwima ',
    'Zef5oAG2Mrhe ','ZefoAG52ovember ','Ze67foGOscar ','Zefo3A45apayww ','Zef44A2Quebec ','ZefoAG433omeo ','ZefoA4GSierra ','ZefoA41GTngo ','ZefoA445GUniorm ','Ze37oGVictor ','ZefoA33W4hiskey ','ZefA3G4oXay ','Zef4Gpooper ','ZefoA3GZulu ']

    return words[Math.floor(words.length * Math.random())] + words[Math.floor(words.length * Math.random())] + words[Math.floor(words.length * Math.random())]}

async function stopGame(){
  await engine.stop()
}
function checkConditions(balance){
    if(balance / 100 >= TargetProfit){
        engine.log(`You reached target profit of ${TargetProfit}`)
        stopGame()
    }
    if(balance / 100 <= dontLoseThan){
        engine.log(`Your balance limit of ${dontLoseThan}, was reached. Stopping script`)
        stopGame()
    }
}

以上是关于text 创世纪的主要内容,如果未能解决你的问题,请参考以下文章

text 创世纪

text 新主页小部件代理主题创世纪

text 创世纪中的横向子菜单

世纪佳缘登录之二,修改

那些最近工作中遇到的插件(上个世纪版)

9张图总结一下阿里云的2019