This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Iredstone7648's profile picture

A couple quick questions...

Started by Iredstone7648, 26 September 2016 - 10:18 PM
Iredstone7648 #1
Posted 27 September 2016 - 12:18 AM
Hello everyone! I am currently making a multitasking operating system and I need some help. Here are my questions.

1. Is there any way that I can list all the programs running? I was thinking something like shell.getRunningProgram() but that is for the current one.

2. I need a coroutine manager that can add, remove, and update a coroutine without breaking the rest.

3. How do I make a pastebin installer. Do I have to upload every single of my 90 files to pastebin and then download each one in the installer?

Thanks for looking at my post! :)/>
KingofGamesYami #2
Posted 27 September 2016 - 12:46 AM
1. You can probably use multishell.getTitle for 1 through multishell.getCount() to get a list of programs. I'm not certain if the title is set to the program name, though. This also assumes you aren't using your own coroutine manager and are running everything through multishell.

2. What do you mean by update? Coroutines are one of the most (if not the most) advanced topics in ComputerCraft. You shouldn't be using them if you don't understand what they are, and how they work. I recommend reading this tutorial.

3. No, you don't. You can look into the http API to get data from websites. I would recommend putting your code in a github repository.
Lupus590 #3
Posted 27 September 2016 - 02:44 PM
I have some comments for the OP in responce to this post

1. I'm not certain if the [multishell] title is set to the program name, though.

2. What do you mean by update? Coroutines are one of the most (if not the most) advanced topics in ComputerCraft. You shouldn't be using them if you don't understand what they are, and how they work. I recommend reading this tutorial.

3. I would recommend putting your code in a github repository.
  1. It defaults to the program name but the multishell API provides a function to set it as well. http://computercraft.info/wiki/Multishell_(API)
  2. have a look at this - http://www.computercraft.info/forums2/index.php?/topic/10540-
  3. I have a tutorial for that, some of it may not be relevant to your needs. The section you want is "Making a Big Project" but you may want to check prior sections too http://www.computercraft.info/forums2/index.php?/topic/26002-
Iredstone7648 #4
Posted 30 September 2016 - 12:36 AM
Thanks for responding! For courotines,I didn't mean update. I meant I need to add and remove them without breaking other. I tried parallel API but it does exactly what I don't want it do.
hbomb79 #5
Posted 30 September 2016 - 02:11 AM
You could take a gander at the parallel API to see how it works, it is a built in coroutine manager

https://github.com/a...m/apis/parallel

Needless to say, multitasking operating systems are very difficult to create well and as a result many OSes posted often lack many features and aren't worthy of the name OS. Not to say you can't do it, I don't know how much experience you have, this question and your post count leads me to believe you are a beginner and you may want to invest time in learning Lua in its entirety. Good luck regardless.
Edited on 30 September 2016 - 12:21 AM