From ComputerCraft Wiki
Revision as of 19:27, 16 February 2015 by MKlegoman357 (Talk | contribs) (Improved example)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Grid Redstone.png  Function commandBlock.setCommand
Sets the command in the Command Block. This does not run it.
Syntax commandBlock.setCommand(string command)
Returns nil
Part of ComputerCraft
API Command Block


Grid paper.png  Example
Sets the command in the Command Block on the left side of the computer to time set 0.
local commandBlock = peripheral.wrap("left")

commandBlock.setCommand("time set 0")