Multishell API

From ComputerCraft
Jump to navigation Jump to search
FunctionFunctionmultishell.getCurrent
Returns the ID of the current Tab.
Syntax multishell.getCurrent()
Returns number ID
Part of CC:Tweaked (source)
API multishell
ExampleExampleGet the current Tab ID.
Get the current Tab ID and print it.
Code
print(multishell.getCurrent())
Output
1


FunctionFunctionmultishell.getCount
Get the number of Multishell Tabs
Syntax multishell.getCount()
Returns number count
Part of CC:Tweaked (source)
API multishell
ExampleExampleGet the number of Multishell Tabs.
Get the number of Multishell Tabs and print it.
Code
print(multishell.getCount())
Output
5


FunctionFunctionmultishell.getFocus
Returns the id of the focused tab.
Syntax multishell.getFocus()
Returns number id
Part of CC:Tweaked (source)
API multishell
ExampleExampleGet the focused tab id.
Get the focused tab id and print it.
Code
print(multishell.getFocus())
Output
1


FunctionFunctionmultishell.getTitle
Returns the title of a multishell tab. I the tab doesn't exists, it will return nil.
Syntax multishell.getTitle()
Returns string title
Part of CC:Tweaked (source)
API multishell
ExampleExampleGet the title of tab 1.
Get the title of tab 1 and print it.
Code
print(multishell.getTitle(1))
Output
shell


FunctionFunctionmultishell.launch
Run a Program in a new multishell tab.
Syntax multishell.launch()
Returns number tabid
Part of CC:Tweaked (source)
API multishell
ExampleExampleLaunch a program in a new tab.
Open the shell in a new tab.
Code
multishell.launch({},"/rom/programs/shell.lua")


FunctionFunctionmultishell.setFocus
Switch the focus to another multishell tab.
Syntax multishell.setFocus()
Returns boolean success
Part of CC:Tweaked (source)
API multishell
ExampleExampleSwitch the focus.
Switch the focus to tab 1.
Code
multishell.setFocus(1)


FunctionFunctionmultishell.setTitle
Set the title of a multishell tab.
Syntax multishell.setTitle()
Returns nil
Part of CC:Tweaked (source)
API multishell
ExampleExampleSet the title.
Set the title of tab 1 to "Computercraft".
Code
multishell.setTitle(1,"Computercraft")