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

[Solved] Launching a multishell from within a multishell in CC 1.76

Started by PleaseDeleteMe, 01 January 2016 - 06:58 PM
PleaseDeleteMe #1
Posted 01 January 2016 - 07:58 PM
I'm currently having an issue with a computer that's using multishell quite a bit for taking care of all it's actions and I currently have 3 manager scripts which I'd like to start all at once in the startup via multishell as well.

The problem is that when I launch a manager script directly it works as expected but when it's launched via the startup script in it's own multishell that the entire multishell and shell objects are null and thus it can't create new shell windows.

The managers themselves will both launch external shells and run their own main loop so I can't use os.run() since that blocks the thread until the script has finished.

Is it possible to launch a multishell from within another multishell or am I better off having multiple creative computers to do this? (I'd rather have this just in 1 creative computer though)
Edited on 03 January 2016 - 11:51 AM
Lupus590 #2
Posted 01 January 2016 - 09:59 PM
have you looked at the parallel api?
PleaseDeleteMe #3
Posted 01 January 2016 - 10:12 PM
No I hadn't and it looked promising but unfortunately it yielded the same result with the multishell and shell object being nil

Welp I've decided to just use multiple computers instead of trying to get it done with just one. Doesn't change much about the code since I've already separated it in different folders from the beginning, just adds some more computers to the game
Edited on 02 January 2016 - 10:48 AM
Bomb Bloke #4
Posted 02 January 2016 - 03:04 AM
You're using multishell.launch() from within your startup script, yeah? That operates much like os.run(): You have to supply an environment table. Eg:

multishell.launch( {multishell = multishell, shell = shell}, "someScript" )

You would be better off with shell.openTab(), which does the above for you (like shell.run() does):

shell.openTab( "someScript" )
Edited on 02 January 2016 - 02:07 AM
PleaseDeleteMe #5
Posted 02 January 2016 - 10:42 AM
multishell.launch( {multishell = multishell, shell = shell}, "someScript" )

That works! Thanks!