Closed makandz closed 8 years ago
Psst @Cr4xy You should really add another collaborator to this repo so they don't have to make pull requests every time. wink wink :smile:
@MastaCoder he added us as collaborators, yes.... but that doesnt mean we can control the repo.. We need write access to be able to merge our own PRs.. So @Cr4xy it would be nice that only the verified devs. (So that nothing stupid happens) that are helping and collaborating get the write access.. And also add Mastacoder as collabotator
// Live console developed by MastaCoder! (simplified by SALVATION)
if (config.liveConsole == true) {
process.stdout.write("\033[K\rSpawned: " + spawnedCount + " | Total: " + totalScore + " | Average: " + avgScore + " | Highest: " + highestScore + " | Time: " + currentSeconds);
} else {
console.log(debugObj);
}
}, config.statusDelay);
instead of
// Live console developed by MastaCoder!
if (config.liveConsole == true) {
if (consoleFix != true) {
process.stdout.write("\rSpawned: " + spawnedCount + " | Total: " + totalScore + " | Average: " + avgScore + " | Highest: " + highestScore + " | Time: " + currentSeconds);
} else {
process.stdout.write("\rSpawned: " + spawnedCount + " | Total: " + totalScore + " | Average: " + avgScore + " | Highest: " + highestScore + " | Time: " + currentSeconds + " ");
consoleFix = false;
}
} else {
console.log(debugObj);
}
}, config.statusDelay);
also remove this
setInterval(function() {
consoleFix = true;
}, 10000);
and this
` var consoleFix = false; // Adds spaces to remove extra numbers.
`
that would reduce some of the code
Erase to end of line: \033[K 9 lines of fewer code...
@Salvationdk I can't remove it because it will cause some issues. I actually added these lines on purpose.
process.stdout.write
writes out the thing we want, it is basically console.log but without formatting. \r
just overwrites that one line that it was on. But then this issue comes in, since it only replaces the characters that are there.
So if your bot goes from 1000 mass down to 44, there will be extra numbers at the end of the line because it hasn't removed those in the line remove. When the 10 second interval runs, it will add a couple spaces a the end of the line so it will remove those numbers. Why didn't I just keep the spaces there forever? Idk, possibly for future expanding ideas this will help :+1:
process.stdout.write("\033[K\rSpawned: " + spawnedCount + " | Total: " + totalScore + " | Average: " + avgScore + " | Highest: " + highestScore + " | Time: " + currentSeconds);
this will overwrite the entire line and also the extra trailing numbers each time it is written to console.. that is why i added the \033[K
it is tested, and works..
Ah shit I probably should have read it more. Sorry!
:)
i have trouble setting up my fork and github to commit pulls. so i just type the changes here :)
@Salvationdk Done :)
sweet.
10 fewer lines :)
how is that for your OCD :p
two tumbs up bitch :D
Another better PR was made for this :)
Removed
== true
from two lines. Nothing else left to do :+1: