Update scripts/update.js, scripts/lib/utils.js
This commit is contained in:
		@@ -5,8 +5,8 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
export async function downloadPrint(ns, file) {
 | 
					export async function downloadPrint(ns, file) {
 | 
				
			||||||
	const speed = ~~(Math.random() * 100) / 10;
 | 
						const speed = ~~(Math.random() * 100) / 10;
 | 
				
			||||||
	const spacing = Array(40 - file.length || 1).fill(' ').join('');
 | 
						const spacing = Array((40 - file.length) || 1).fill(' ').join('');
 | 
				
			||||||
	await slowPrint(ns, `${file}${spacing}[==================>] 100% \t (${speed} MB/s)`);
 | 
						await slowPrint(ns, `${file}${spacing}[==================>] 100%\t(${speed} MB/s)`);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -160,8 +160,8 @@ export async function main(ns) {
 | 
				
			|||||||
        await slowPrint(ns, 'Restarting...');
 | 
					        await slowPrint(ns, 'Restarting...');
 | 
				
			||||||
        const pid = ns.exec(`${dest}${updateFile}`, args['device'], 1, 278024);
 | 
					        const pid = ns.exec(`${dest}${updateFile}`, args['device'], 1, 278024);
 | 
				
			||||||
		if(pid == 0) ns.tprint('Failed');
 | 
							if(pid == 0) ns.tprint('Failed');
 | 
				
			||||||
		else ns.tprint('Done!');
 | 
							else ns.tprint('Complete');
 | 
				
			||||||
		return ns.tprint('');
 | 
							return await slowPrint(ns, '');
 | 
				
			||||||
    } else { // Update everything else
 | 
					    } else { // Update everything else
 | 
				
			||||||
        await slowPrint(ns, 'Downloading scripts:');
 | 
					        await slowPrint(ns, 'Downloading scripts:');
 | 
				
			||||||
        for(let file of fileList) {
 | 
					        for(let file of fileList) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user