term.current

From ComputerCraft Wiki
Revision as of 08:12, 28 March 2014 by Oeed (Talk | contribs) (Created term.current page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Grid Redstone.png  Function term.current
Returns the current terminal object that is being used to write to.
Syntax term.current()
Returns table terminal object
Part of ComputerCraft
API term

Examples

Grid paper.png  Example
Restores a program to the computer. This will only work if the computer was running a program on a monitor
Code
term.redirect(peripheral.wrap('left')) -- switch to a monitor
print('Hello!') -- write on the monitor
print(term.current()) --returns the same as peripheral.wrap('left')

Additional Notes

  • term.current() requires ComputerCraft version 1.6 or newer.