mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
fix tiem compression
This commit is contained in:
parent
925bed4430
commit
feb2a651f6
@ -13,20 +13,22 @@ function tampering(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function timeCompression(): void {
|
function timeCompression(): void {
|
||||||
|
const timer = 1000 * 15;
|
||||||
if (Player.exploits.includes(Exploit.TimeCompression)) return;
|
if (Player.exploits.includes(Exploit.TimeCompression)) return;
|
||||||
// Time compression
|
// Time compression
|
||||||
let last = new Date().getTime();
|
let last = performance.now();
|
||||||
function minute(): void {
|
function minute(): void {
|
||||||
const now = new Date().getTime();
|
const now = performance.now();
|
||||||
|
console.log(now - last);
|
||||||
if (now - last < 500) {
|
if (now - last < 500) {
|
||||||
// time has been compressed.
|
// time has been compressed.
|
||||||
Player.giveExploit(Exploit.TimeCompression);
|
Player.giveExploit(Exploit.TimeCompression);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
last = now;
|
last = now;
|
||||||
window.setTimeout(minute, 1000 * 60);
|
window.setTimeout(minute, timer);
|
||||||
}
|
}
|
||||||
window.setTimeout(minute, 1000 * 60);
|
window.setTimeout(minute, timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function startExploits(): void {
|
export function startExploits(): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user