MCPcopy Create free account
hub / github.com/Semporia/Scripts / Wait

Function Wait

JD_DailyBonus.js:1607–1620  ·  view source on GitHub ↗
(readDelay, ini)

Source from the content-addressed store, hash-verified

1605}
1606
1607function Wait(readDelay, ini) {
1608 if (!readDelay || readDelay === '0') return 0
1609 if (typeof(readDelay) == 'string') {
1610 var readDelay = readDelay.replace(/"|"|'|'/g, ''); //prevent novice
1611 if (readDelay.indexOf('-') == -1) return parseInt(readDelay) || 0;
1612 const raw = readDelay.split("-").map(Number);
1613 const plan = parseInt(Math.random() * (raw[1] - raw[0] + 1) + raw[0], 10);
1614 if (ini) console.log(`\n初始化随机延迟: 最小${raw[0]/1000}秒, 最大${raw[1]/1000}秒`);
1615 // else console.log(`\n预计等待: ${(plan / 1000).toFixed(2)}秒`);
1616 return ini ? readDelay : plan
1617 } else if (typeof(readDelay) == 'number') {
1618 return readDelay > 0 ? readDelay : 0
1619 } else return 0
1620}
1621
1622function CookieMove(oldCk1, oldCk2, oldKey1, oldKey2, newKey) {
1623 let update;

Callers 2

allFunction · 0.85
JD_DailyBonus.jsFile · 0.85

Calls 1

logMethod · 0.45

Tested by

no test coverage detected