Difference between revisions of "CommandBlock.setCommand"
From ComputerCraft Wiki
MKlegoman357 (Talk | contribs) (Added commandBlock.setCommand) |
MKlegoman357 (Talk | contribs) (Improved example) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
− | |name=commandBlock.setCommand | + | |name=''commandBlock''.setCommand |
|args={{type|string}} command | |args={{type|string}} command | ||
|api=Command Block | |api=Command Block | ||
Line 8: | Line 8: | ||
|examples={{Example | |examples={{Example | ||
|desc=Sets the command in the Command Block on the left side of the computer to ''time set 0''. | |desc=Sets the command in the Command Block on the left side of the computer to ''time set 0''. | ||
− | |code=local commandBlock = [[peripheral.wrap]]("left") | + | |code=local commandBlock = [[peripheral.wrap]]("left") |
+ | |||
+ | '''commandBlock.setCommand("time set 0")''' | ||
|output= | |output= | ||
}} | }} |
Latest revision as of 19:27, 16 February 2015
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 |
Examples
Example | |
Sets the command in the Command Block on the left side of the computer to time set 0. | |
Code |
local commandBlock = peripheral.wrap("left") commandBlock.setCommand("time set 0") |