Finished a working model of the terminal application if you want to take a look. Its also published to Node's package manager registry, so anyone with Node.JS installed can install it and run it from their terminal.
A nice side effect of modularization is also that it makes it easier for people to submit new commands. I think your current code due to it's simplicity is an excellent example for demonstrating the benefits of modular structures.
I'm still quite a beginner with developing modular code of this kind, at least in javascript, I had a php based webapp a while ago that featured a virtual cmd using javascript and a little REST api
each command being a PHP file that registered it's functions in a cmd array
I was wondering about how to manage features like the autoMiner properly, given that it's currently very linear in it's implementation. Maybe a concept where you can buy threads/workers that you can assign tasks to would be an idea
I was thinking about the "buy threads/workers" idea as well. The only problem with the autoMiner system is that JavaScript isn't very multithreaded. setInterval would be our best bet, but if not that, then I guess a promise? Idk. Right now I'm working on moving the github pages demo to an angular system with a terminal directive that I found.
Say there is a limit of 6 workers, you can assign 1 command per worker, this essentially just adds the command to an array which gets looped through in a single thread
For the end users it essentially ends up the same, doesn't it?
So, for example, if you had 2 workers, and somehow your increment is set to 100, you could set the first worker to mineData, and the second to sellData 100?
That could be useful. What if, for each command (excluding commands such as help) there was a worker "type". Max quantity of workers could be expanded through upgrades, and each worker type has a different price?
It wouldn't have much use at the game's current stage, but if more upgrades are implemented that the user might need to do repeatedly, it could definitely be useful.
It would probably be game breaking if any kind of command was possible in the worker thread, example, mineData after a few upgrades would be very powerful
But something along those lines would be interesting
How about giving workers a storage capacity? If we were to imagine a mineData worker, that one would only be able to "carry" a limited amount of data at once
PHP was my first main language. I was building a system to track parts, equipment, and workorders in an engineering company. Nearly failed a couple of classes in highschool because I was always working on the system on my school laptop lol
I used angular 1, but I'm completely impartial to either of them. I'm not very experienced in either, I just used it to use the terminal directive. If you want to take a look, I've merged all the changes on the GitHub page