CommandBlock.getCommand

From ComputerCraft Wiki
Revision as of 20:08, 31 March 2014 by MKlegoman357 (Talk | contribs) (Added CommandBlock.getCommand)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Grid Redstone.png  Function commandBlock.getCommand
Returns a string containing the command currently inside the Command Block.
Syntax commandBlock.getCommand()
Returns string command
Part of ComputerCraft
API Command Block

Examples

Grid paper.png  Example
Prints current command of a command block attached on the right side of the computer (assuming the command set is time set 0).
Code
local commandBlock = peripheral.wrap("right")

print(commandBlock.getCommand())
Output time set 0