Command Block (API)

From ComputerCraft Wiki
Revision as of 06:02, 30 March 2013 by Negamartin (Talk | contribs) (Created the page)

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

The Command Block API allows you to run commands in a Command Block, using it as a peripheral. (The peripheral can only be used if allowed in the config, which is default to false)

Grid disk.png   Command Block (API)

command.getCommand() Returns the command in the Command Block as a string.
command.setCommand(string command) Sets the command currently in the Command Block.
command.runCommand() Runs the command currently in the Command Block.

Note

All Command Block functions are to be used after wrapping the block in a peripheral. example: command = peripheral.wrap("left")