http://www.computercraft.info/wiki/api.php?action=feedcontributions&user=67.189.72.22&feedformat=atomComputerCraft Wiki - User contributions [en]2024-03-29T06:42:27ZUser contributionsMediaWiki 1.24.1http://www.computercraft.info/wiki/index.php?title=Template:Keypress&diff=4523Template:Keypress2012-12-03T09:36:10Z<p>67.189.72.22: Fancy up the Keypress template a bit</p>
<hr />
<div><span style="color: #333; padding-bottom: 2px;"><br />
<span style="color: black; border: 1px solid #666; border-top-color: #CECBC7; border-left-color: #CECBC7; background: #F0F0F0; padding: 0.13em 0.33em; white-space: nowrap;">{{{key}}}</span><br />
</span></div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=User_talk:AfterLifeLochie&diff=4520User talk:AfterLifeLochie2012-12-03T09:17:55Z<p>67.189.72.22: /* Why did you revert my changes on the function and example templates? */</p>
<hr />
<div>Diagnostic check for CCWiki. Ignore this.<br />
<br />
== Why did you revert my changes on the function and example templates? ==<br />
<br />
The 24px ones were really small and blurry. --[[Special:Contributions/67.189.72.22|67.189.72.22]] 13:17, 3 December 2012 (MSK)</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=User_talk:AfterLifeLochie&diff=4519User talk:AfterLifeLochie2012-12-03T09:17:42Z<p>67.189.72.22: /* Why did you revert my changes on the function and example templates? */ new section</p>
<hr />
<div>Diagnostic check for CCWiki. Ignore this.<br />
<br />
== Why did you revert my changes on the function and example templates? ==<br />
<br />
The 24px ones were really small and blurry.</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Template:Example&diff=4514Template:Example2012-12-03T09:14:07Z<p>67.189.72.22: Change size because it looks better</p>
<hr />
<div><includeonly><br />
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"><br />
<br />
<tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #DBE5FF; line-height:28px;">[[File:Grid_paper.png]]&nbsp;&nbsp;Example</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td colspan="2" style="padding: .4em; padding-bottom: .8em;">{{{desc|No description provided.}}}</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><br />
<td style="border-top: solid #C9C9C9 1px; border-right: solid #C9C9C9 1px; padding: .4em; padding-right: .5em; width:120px;">'''Code'''</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em; padding-left: .5em;"><br />
{{{code}}}<br />
</td><br />
<br />
</tr><br />
{{#if: {{{output|}}} | <tr><br />
<td style="border-right: solid #C9C9C9 1px; padding: .4em; padding-right: .5em; width:120px;">'''Output'''</td><br />
<td style="padding: .4em; padding-left: .5em;">{{{output}}}</td><br />
</tr>}}<br />
<br />
</table><br />
<br />
<br />
</includeonly><br />
<noinclude><br />
== Wiki code ==<br />
<nowiki>{{Example<br />
|desc=Prints a message<br />
|code=print("Hello world!")<br />
|output=Hello world!<br />
}}</nowiki><br />
<br />
== Result ==<br />
{{Example<br />
|desc=Prints a message<br />
|code=print("Hello world!")<br />
|output=Hello world!<br />
}}<br />
</noinclude></div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Template:Function&diff=4512Template:Function2012-12-03T09:13:15Z<p>67.189.72.22: Testing picture size</p>
<hr />
<div><includeonly><br />
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"><br />
<br />
<tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #DBE5FF; line-height:28px;">[[File:Grid_Redstone.png]]&nbsp;&nbsp;Function {{{name}}}</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td colspan="2" style="padding: .4em; padding-bottom: .8em;">{{{desc|No description provided.}}}</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; border-right: solid #C9C9C9 1px; padding: .4em; width: 10%; font-weight: bold;">Syntax</td><br />
<td style="border-top: solid #C9C9C9 1px; border-color: #C9C9C9; padding: .4em; padding-left: .8em;">{{{name}}}({{{args|}}})</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-right: solid #C9C9C9 1px; padding: .4em; width: 10%; font-weight: bold;">Returns</td><br />
<td style="border-color: #C9C9C9; padding: .4em; padding-left: .8em;">{{{returns|[[nil]]}}}</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-right: solid #C9C9C9 1px; padding: .4em; width: 10%; font-weight: bold;">Part of</td><br />
<td style="border-color: #C9C9C9; padding: .4em; padding-left: .8em;">[[{{{addon|ComputerCraft}}}]]</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-right: solid #C9C9C9 1px; padding: .4em; width: 10%; font-weight: bold;">API</td><br />
<td style="border-color: #C9C9C9; padding: .4em; padding-left: .8em;">{{#if: {{{api}}} | [[{{{api}}} (API)|{{{api}}}]] | none }}</td></tr><br />
<br />
</table><br />
<br />
{{#if:{{{examples|}}}|<br />
== Examples ==<br />
{{{examples|}}}<br />
|}}<br />
<br />
{{#if:{{{notes|}}}|<br />
== Additional Notes ==<br />
{{{notes}}}<br />
|}}<br />
</includeonly><br />
<noinclude><br />
__NOTOC__<br />
== Wiki code ==<br />
<nowiki>{{Function<br />
|name=redstone.setOutput<br />
|args=[[string]] side, [[boolean]] value<br />
|api=redstone<br />
|returns=[[nil]]<br />
|addon=ComputerCraft<br />
|desc=Sets a redstone output<br />
|examples=Examples go here (use [[Template:Example]])<br />
|notes=<br />
* Note 1<br />
* Note 2<br />
}}</nowiki><br />
<br />
Note that ''args'', ''returns'', ''addon'', ''examples'' and ''notes'' are optional.<br />
<br />
== Result ==<br />
{{Function<br />
|name=redstone.setOutput<br />
|args=[[string_(type)|string]] side, [[boolean_(type)|boolean]] value<br />
|api=redstone<br />
|returns=[[nil]]<br />
|addon=ComputerCraft<br />
|desc=Sets a redstone output<br />
|examples=Examples go here (use [[Template:Example]])<br />
|notes=<br />
* Note 1<br />
* Note 2<br />
}}<br />
[[Category:Templates]]<br />
</noinclude></div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Os.computerID&diff=3867Os.computerID2012-11-27T09:18:56Z<p>67.189.72.22: Redirected page to Os.getComputerID</p>
<hr />
<div>#REDIRECT [[Os.getComputerID]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Os.getComputerID&diff=3866Os.getComputerID2012-11-27T09:18:37Z<p>67.189.72.22: </p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=os.getComputerID<br />
|returns=the ID of the Computer<br />
|api=os<br />
|addon=ComputerCraft<br />
|desc=returns the ID of the computer this command is executed on.<br />
|examples=<br />
{{Example<br />
|desc=prints the Computer ID<br />
|code=print(os.getComputerID())<br />
}}<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Floppy_Disk&diff=3795Floppy Disk2012-11-19T08:30:02Z<p>67.189.72.22: </p>
<hr />
<div>The system of disks and floppies in [[ComputerCraft]] were added in version 1.2. How they work and interact with the [[computer]]s is very similar to how they would work in the real world with our real computers: There's a [[Disk Drive]] that we're able to insert removable disks (or floppies) which we're able to place data upon, which, in turn, makes data portable. This brings much potential for things such as servers running ComputerCraft and users of that server wishing to distribute their software for in-game currency.<br />
<br />
The 1.42 update allows floppies to be colored with any kind of dye. This is done by putting a floppy and a dye in your crafting table.<br />
[[File:Floppy.png|frame|right|Dyed Floppy Disks]]<br />
== Recipe ==<br />
{{Crafting grid<br />
|B1=redstone_dust<br />
|B2=paper<br />
|Output=disk<br />
}}<br />
== Usage ==<br />
Like individual computers, each floppy disk has its own folder containing the data that is within that floppy and is easily movable from within the computers in Minecraft using the simple UNIX-like commands such as cp (copy) or mv (move). Just like anywhere else in a computer, you can create, edit, move, copy, etc., any files and do so however you wish.<br />
<br />
To insert a floppy into a [[Disk Drive]] so it can be used, right-click the disk drive and place the floppy into the slot at the top of the drive's inventory menu.<br />
<br />
== Interacting with Computers ==<br />
When a disk is inserted into a disk drive that is in a block and is orthogonally connected (not diagonal) to a computer, a directory is visible in the computer's root directory titled 'disk'. If another disk is inserted into a different drive that is also connected to a computer then that next directory is entitled 'disk2' and so-on for each additional disk that is inserted and connected.<br />
<br />
[[Category:Items]]<br />
<br />
== Release Changes ==<br />
*'''1.3''': Used for [[Turtle]]s' programming.<br />
*'''1.2''': Initial Release</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Floppy_Disk&diff=3794Floppy Disk2012-11-19T08:29:02Z<p>67.189.72.22: </p>
<hr />
<div>The system of disks and floppies in [[ComputerCraft]] were added in version 1.2. How they work and interact with the [[computer]]s is very similar to how they would work in the real world with our real computers: There's a [[Disk Drive]] that we're able to insert removable disks (or floppies) which we're able to place data upon, which, in turn, makes data portable. This brings much potential for things such as servers running ComputerCraft and users of that server wishing to distribute their software for in-game currency.<br />
<br />
The 1.42 update allows floppies to be colored with any kind of dye. This is done by putting a floppy and a dye in your crafting table.<br />
[[File:Floppy.png|frame|right|Dyed Floppy Disks]]<br />
== Recipe ==<br />
{{Crafting grid<br />
|B1=redstone_dust<br />
|B2=paper<br />
|Output=disk<br />
}}<br />
== Usage ==<br />
Like individual computers, each floppy disk has its own folder containing the data that is within that floppy and is easily movable from within the computers in Minecraft using the simple UNIX-like commands such as cp (copy) or mv (move). Just like anywhere else in a computer, you can create, edit, move, copy, etc., any files and do so however you wish.<br />
<br />
To insert a floppy into a [[Disk_Drive|disk drive]] so it can be used, right-click the disk drive and place the floppy into the slot at the top of the drive's inventory menu.<br />
<br />
== Interacting with Computers ==<br />
When a disk is inserted into a disk drive that is in a block and is orthogonally connected (not diagonal) to a computer, a directory is visible in the computer's root directory titled 'disk'. If another disk is inserted into a different drive that is also connected to a computer then that next directory is entitled 'disk2' and so-on for each additional disk that is inserted and connected.<br />
<br />
[[Category:Items]]<br />
<br />
== Release Changes ==<br />
*'''1.3''': Used for [[Turtle]]s' programming.<br />
*'''1.2''': Initial Release</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Term.setBackgroundColor&diff=3790Term.setBackgroundColor2012-11-17T15:23:12Z<p>67.189.72.22: </p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=term.setBackgroundColor<br />
|args= [[Colors#Colors|color]] code<br />
|returns=None<br />
|api=term<br />
|addon=ComputerCraft<br />
|desc=changes the color of the background of your terminal/monitor (For common use add the decimal code of the color) [Does not change previously printed text's background]<br />
|examples=<br />
{{Example<br />
|desc=Makes the background of the monitor grey<br />
|code=term.setBackgroundColor(colors.grey)<br />
}}<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Term.setTextColor&diff=3789Term.setTextColor2012-11-17T15:20:52Z<p>67.189.72.22: </p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=term.setTextColor<br />
|args= [[Colors#Colors|color]] code<br />
|returns=None<br />
|api=term<br />
|addon=ComputerCraft<br />
|desc=changes the color of your font (For common use add the decimal code of the color)<br />
|examples=<br />
{{Example<br />
|desc=Makes the words Hello World! green.<br />
|code=term.setTextColor(colors.green)<br>print("Hello World!")<br />
}}<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Term.setTextColor&diff=3788Term.setTextColor2012-11-17T15:20:18Z<p>67.189.72.22: </p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=Term.setTextColor<br />
|args= [[Colors#Colors|color]] code<br />
|returns=None<br />
|api=term<br />
|addon=ComputerCraft<br />
|desc=changes the color of your font (For common use add the decimal code of the color)<br />
|examples=<br />
{{Example<br />
|desc=Makes the words Hello World! green.<br />
|code=term.setTextColor(colors.green)<br>print("Hello World!")<br />
}}<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Advanced_Monitor&diff=3787Advanced Monitor2012-11-17T15:19:15Z<p>67.189.72.22: </p>
<hr />
<div>The Advanced Monitor is a new, improved version of the [[monitor]]. It has the ability to show coloured text and programs on the screen. It is also golden colored on it's sides, similar to the [[Advanced Computer]]. For available colors, see [http://computercraft.info/wiki/index.php?title=Colors Colors API].<br />
==Recipe==<br />
{{Crafting grid<br />
|A1=Gold_Ingot |B1=Gold_Ingot |C1=Gold_Ingot<br />
|A2=Gold_Ingot |B2=glass_pane |C2=Gold_Ingot<br />
|A3=Gold_Ingot |B3=Gold_Ingot |C3=Gold_Ingot<br />
|Output=Advanced_Monitor<br />
}}<br />
==Using an Advanced Monitor==<br />
''See [[Peripheral (API)#Monitor|Peripheral (API)]] for more details.''<br />
<br />
To use an Advanced Monitor, you need to call a method using the Peripheral API. This is one example:<br />
<br />
peripheral.call("side", "function", var1, var2, ...)<br />
<br />
For example:<br />
<br />
peripheral.call("top", "write", "Hello World!")<br />
<br />
You can also "wrap" the peripheral side to a variable:<br />
<br />
local monitor = peripheral.wrap("top")<br />
<br />
Now, you can call functions that way.<br />
<br />
monitor.write("Hello World!")<br />
<br />
There are two new functions (four including the british-spelled color (colour)):<br />
<br />
[[term.setTextColor|monitor.setTextColor]]([[color (API)|(color)]])<br />
<br />
[[term.setBackgroundColor|monitor.setBackgroundColor]]([[color (API)|(color)]])<br />
<br />
[[Category:Blocks]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Advanced_Monitor&diff=3786Advanced Monitor2012-11-17T15:18:52Z<p>67.189.72.22: Undo revision 3785 by MathManiac0 (talk) monitor is NOT an API. it may be confusing to some people. monitor.setTextColor is the same as term. ,ecxept it's wrapped</p>
<hr />
<div>The Advanced Monitor is a new, improved version of the [[monitor]]. It has the ability to show coloured text and programs on the screen. It is also golden colored on it's sides, similar to the [[Advanced Computer]]. For available colors, see [http://computercraft.info/wiki/index.php?title=Colors Colors API].<br />
==Recipe==<br />
{{Crafting grid<br />
|A1=Gold_Ingot |B1=Gold_Ingot |C1=Gold_Ingot<br />
|A2=Gold_Ingot |B2=glass_pane |C2=Gold_Ingot<br />
|A3=Gold_Ingot |B3=Gold_Ingot |C3=Gold_Ingot<br />
|Output=Advanced_Monitor<br />
}}<br />
==Using an Advanced Monitor==<br />
''See [[Peripheral (API)#Monitor|Peripheral (API)]] for more details.''<br />
<br />
To use an Advanced Monitor, you need to call a method using the Peripheral API. This is one example:<br />
<br />
peripheral.call("side", "function", var1, var2, ...)<br />
<br />
For example:<br />
<br />
peripheral.call("top", "write", "Hello World!")<br />
<br />
You can also "wrap" the peripheral side to a variable:<br />
<br />
local monitor = peripheral.wrap("top")<br />
<br />
Now, you can call functions that way.<br />
<br />
monitor.write("Hello World!")<br />
<br />
There are two new functions (four including the british-spelled color (colour)):<br />
<br />
[[term.setTextColor|setTextColor]]([[color (API)|(color)]])<br />
<br />
[[term.setBackgroundColor|setBackgroundColor]]([[color (API)|(color)]])<br />
<br />
[[Category:Blocks]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Advanced_Monitor&diff=3768Advanced Monitor2012-11-16T15:12:15Z<p>67.189.72.22: </p>
<hr />
<div>The Advanced Monitor is a new, improved version of the [[monitor]]. It has the ability to show coloured text and programs on the screen. It is also golden colored on it's sides, similar to the [[Advanced Computer]]. For available colors, see [http://computercraft.info/wiki/index.php?title=Colors Colors API].<br />
==Recipe==<br />
{{Crafting grid<br />
|A1=Gold_Ingot |B1=Gold_Ingot |C1=Gold_Ingot<br />
|A2=Gold_Ingot |B2=redstone_dust |C2=Gold_Ingot<br />
|A3=Gold_Ingot |B3=glass_pane |C3=Gold_Ingot<br />
|Output=Advanced_Monitor<br />
}}<br />
==Using an Advanced Monitor==<br />
''See [[Peripheral (API)#Monitor|Peripheral (API)]] for more details.''<br />
<br />
To use an Advanced Monitor, you need to call a method using the Peripheral API. This is one example:<br />
<br />
peripheral.call("side", "function", var1, var2, ...)<br />
<br />
For example:<br />
<br />
peripheral.call("top", "write", "Hello World!")<br />
<br />
You can also "wrap" the peripheral side to a variable:<br />
<br />
local monitor = peripheral.wrap("top")<br />
<br />
Now, you can call functions that way.<br />
<br />
monitor.write("Hello World!")<br />
<br />
There are two new functions (four including the british-spelled color (colour)):<br />
<br />
[[term.setTextColor|setTextColor]]([[color (API)|(color)]])<br />
<br />
[[term.setBackgroundColor|setBackgroundColor]]([[color (API)|(color)]])<br />
<br />
[[Category:Blocks]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Talk:Turtle_Tutorial&diff=3757Talk:Turtle Tutorial2012-11-15T08:38:48Z<p>67.189.72.22: </p>
<hr />
<div>==I need help==<br />
i need help,i get this error from my code<br />
<br />
mine:1: attempt to call nil<br />
<br />
PS ( mine is the name of the program) <small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:76.111.25.128|76.111.25.128]] ([[User talk:76.111.25.128|talk]] • [[Special:Contributions/76.111.25.128|contribs]]) 02:04, 23 March 2012</span></small><!-- Template:Unsigned --><br />
:What is your code? <small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:24.20.222.206|24.20.222.206]] ([[User talk:24.20.222.206|talk]] • [[Special:Contributions/24.20.222.206|contribs]]) 18:15, 26 March 2012</span></small><!-- Template:Unsigned --><br />
<br />
<br />
I got the same result as above when using the spiral pattern mentioned I typed it out exactly as it is written.<br />
<br />
Do you have a mining turtle? --[[Special:Contributions/67.189.72.22|67.189.72.22]] 12:38, 15 November 2012 (MSK)</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=CcSensors&diff=3755CcSensors2012-11-14T15:54:13Z<p>67.189.72.22: Undo revision 3754 by Itunes89 (talk) (The MOD is out of date, not the documentation)</p>
<hr />
<div>{{DISPLAYTITLE:ccSensors}}<br />
<br />
'''This mod is 1.2.5 ONLY! It is very out-of-date!'''<br />
<br />
'''ccSensors''' is a user created peripheral by Yoskaz01, which adds sensors to ComputerCraft. It provides readings from the Minecraft surroundings to lua programs.<br />
A reading can be a value a simple as Light level, a isRaining, isDay or as complex as the content of a chest or the temperature of IC2 reactor.<br />
<br />
==Getting Started==<br />
<br />
# place a Sensor Controller next to a computer<br />
# open the sensor Controller GUI and hit the "New" button to register a new freq<br />
# place blank transmitter card in the slot and click "Encode Transmitter" to get an encoded transmitter to be used with the remote sensor.<br />
# Place a Remote Sensor (can be placed anywhere) and put the transmitter card in the bottom slot. (you can rename the Remote Sensor from the default name "Sensor")<br />
# Place a SensorModule card into the top slot.<br />
# open the computer terminal and run: /ccSensors/console to run the sample console program. That's it - you now have a working sensor connected to a computer :)<br />
<br />
==API: sensors==<br />
Note: Documentation is ripped from source code. Information is provided "as-is" with no guarntee of accuracy.<br />
<!-- #################################################################<br />
<br />
TO MOD AUTHOR:<br />
If you fix up the docs, please remove the above sentence.<br />
Thank you.<br />
~~~~<br />
<br />
############################################################## --><br />
{| class="sortable" border="1" cellpadding="2" cellspacing="0"<br />
!style="background:#EEE" width="200px"|Method name<br />
!style="background:#EEE" width="*"|Description<br />
|-<br />
|getVersion()<br />
|sensorAPI version<br />
|-<br />
|getPeripherals()<br />
|returns a dict of attached peripherals : SensorController,monitor,modem<br />
|-<br />
|getController()<br />
|return the side the first controller is attached at<br />
|-<br />
|rIterator( table )<br />
|Intended for internal use only.<br />
|-<br />
|tabtodict( table )<br />
|Intended for internal use only.<br />
|-<br />
|getReadingAsTable( side, sensor, ... )<br />
|return sensor reading as a table instead of a dict<br />
|-<br />
|setTarget( side, sensor, target )<br />
|set the active target for a given sensor<br />
|-<br />
|setSensorRange( side, sensor, range )<br />
|set the sensor range (as long is <= max_sensor_range)<br />
|-<br />
|getAvailableReadings( side, sensor )<br />
|returns names of all readings available for a given sensor<br />
|-<br />
|setActiveReading( side, sensor, reading )<br />
|set the active reading to be used when getReading is called<br />
|-<br />
|getAvailableTargets( side, sensor )<br />
|returns the available targets for a given sensor<br />
|-<br />
|getAvailableTargetsforProbe( side, sensor, probe )<br />
|UNDOCUMENTED<br />
|-<br />
|getAvailableTargetsforProbe2( side, sensor, probe )<br />
|UNDOCUMENTED<br />
|-<br />
|getProbe( side, sensor )<br />
|returns a table of the available probes (eg: TargetInfo, LivingEntities, Players)<br />
|-<br />
|getSensorInfo( side, sensor, ... )<br />
|returns the following information for a given sensor: <br />
cardType, ActiveReadingID, Distance, Name, ActiveReading, ShortName, SensorRange, yCoord, zCoord, xCoord<br />
<!--<br />
old values from someone else<br />
cardType,name,activereading,activereadingid,distance,location,methods,SensorRange<br />
--><br />
|-<br />
|getSensorInfoAsTable( side, sensor, ... )<br />
|same as getSensorInfo, except as a table<br />
|-<br />
|getReading( side, sensor, ... )<br />
|returns sensor reading in a dict of reading,value pairs<br />
|-<br />
|getReading2( side, sensor, probe, target, ... )<br />
|returns sensor reading in a dict of reading,value pairs<br />
|-<br />
|getSensors( side )<br />
|returns the names of all connected sensors<br />
|-<br />
|getSensorReadingAsDict(side,sensor,target,probe,...)<br />
|get a reading while setting the target and reading type for a given sensor. returns a dictionary [working]<br />
|-<br />
|getSensorReadingAsDict2(side, sensor, probe, target, ...)<br />
|Alias for getReading2<br />
|-<br />
|getSensorReadingAsTable( side, sensor, target, reading, ...)<br />
|get a reading while setting the target and reading type for a given sensor<br />
|-<br />
|getItemInfo(name,content)<br />
|return item info from an inventory dictionary<br />
|-<br />
|getItemsInfo(names,content)<br />
|returns a dict for each item in the given names table with .dmg and .qty<br />
|}<br />
<br />
== External links==<br />
*[http://www.computercraft.info/forums2/index.php?/topic/126-mc-125-cc-133-ccsensors-smpssp/ ccSensors]—ComputerCraft Forum Thread<br />
<br />
[[Category:User Created Peripherals]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Hello_World_Tutorial&diff=3700Hello World Tutorial2012-11-13T06:55:20Z<p>67.189.72.22: Undo revision 3691 by 96.235.236.248 (talk)</p>
<hr />
<div>[[Category:Tutorials]]<br />
This tutorial is for those who are just getting started with ComputerCraft.<br />
<br />
== Creating the Program ==<br />
<br />
Creating a Hello World program is a simple task and does not require much knowledge in Lua or ComputerCraft.<br />
The first step is to create the program so we can edit it. Access your computer and type:<br />
edit helloworld<br />
<br />
You will now have a blank program that you can edit.<br />
<br />
We can make the computer print "Hello World!" in three different ways.<br />
<br />
To print it letter by letter, type:<br />
textutils.slowPrint("Hello World!")<br />
Please don't overuse slowprint as it can annoy some users.<br />
<br />
To just print it, type:<br />
print("Hello World!")<br />
<br />
You can also use:<br />
write("Hello World!\n")<br />
Using \n will make the console go to the next line. (print does this automatically!)<br />
<br />
Now, press '''CTRL''' and make sure Save is selected, then press '''ENTER''' or '''RETURN'''.<br />
The program is now completed and saved, so let's exit edit mode.<br />
Press '''CTRL''' and select Exit by using the arrow keys. Once selected press '''ENTER''' or '''RETURN'''.<br />
<br />
To test it, type:<br />
helloworld<br />
<br />
Simple isn't it?<br />
<br />
== What We Learned ==<br />
* How to create a program.<br />
* How to edit a program.<br />
* How to "slow print" text.<br />
* How to print text.<br />
* How to save a program.<br />
* How to run a program.<br />
<br />
== Code ==<br />
textutils.slowPrint("Hello World!")<br />
print("Hello World!")</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Term.isColor&diff=3680Term.isColor2012-11-11T07:56:16Z<p>67.189.72.22: Fix example</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=term.isColor<br />
|returns=If the computer can display colors.<br />
|api=term<br />
|addon=ComputerCraft<br />
|desc=Returns if the computer can display colors.<br />
|examples=<br />
{{Example<br />
|desc=This program verify if the computer can display colors. <br />If it can, the computer set the background lime, otherwise, it shutdowns the computer.<br />
|code=local advanced = term.isColor() <br />if advanced == true then <br />term.setBackgroundColor(colors.lime)<br />else<br />os.shutdown()<br />end<br />
}}<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Advanced_Monitor&diff=3662Advanced Monitor2012-11-09T12:45:57Z<p>67.189.72.22: </p>
<hr />
<div>The Advanced Monitor is a new, improved version of the [[monitor]]. It has the ability to show coloured text and programs on the screen. Besides that they are pretty much the same as the original. It is also golden colored on it's sides, as the advanced computer is.<br />
==Recipe==<br />
{{Crafting grid<br />
|A1=Gold_Ingot |B1=Gold_Ingot |C1=Gold_Ingot<br />
|A2=Gold_Ingot |B2=redstone_dust |C2=Gold_Ingot<br />
|A3=Gold_Ingot |B3=glass_pane |C3=Gold_Ingot<br />
|Output=Advanced_Monitor<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Turtle.attack&diff=3637Turtle.attack2012-11-06T07:34:11Z<p>67.189.72.22: Undo revision 3636 by 204.186.5.98 (talk)</p>
<hr />
<div>{{Function<br />
|name=turtle.attack<br />
|api=turtle<br />
|returns=[[boolean]] whether the turtle succeeded in attacking forward<br />
|addon=ComputerCraft<br />
|desc=Attempts to attack in front of the turtle.<br />
|examples=<br />
{{Example<br />
|desc=Tries to attack in front of the turtle and outputs whether it worked or not.<br />
|code=if turtle.attack() then<br />
[[print]] ("Turtle attacked in front.")<br />
else<br />
[[print]] ("Turtle could not attack.")<br />
end<br />
|output= Turtle attacked in front. or Turtle could not attack.<br />
}}<br />
<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Talk:Printer&diff=3513Talk:Printer2012-10-24T16:53:16Z<p>67.189.72.22: Blanked the page</p>
<hr />
<div></div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Advanced_Computer&diff=3464Advanced Computer2012-10-21T21:17:29Z<p>67.189.72.22: /* Exclusive Functions */</p>
<hr />
<div>[[File:AdvancedComputerPaint.png|frame|right|An advanced computer running Paint, an exclusive program]]The advanced computer is a [[computer]] that have mouse and colour API support. They may have more exclusive features soon. They resemble the traditional computer console, but are golden coloured to match their crafting [[recipes|recipe]].<br />
==Recipe==<br />
{{Crafting grid<br />
|A1=gold_ingot |B1=gold_ingot |C1=gold_ingot<br />
|A2=gold_ingot |B2=redstone_dust |C2=gold_ingot<br />
|A3=gold_ingot |B3=glass_pane |C3=gold_ingot<br />
|Output=advanced_console<br />
}}<br />
==Exclusive Functions==<br />
* term.setTextColour(colours._color)<br />
* term.setBackgroundColour(colours._color)<br />
* (where _color is the color, like blue)<br />
[[Category:Blocks]]<br />
[[Category:Consoles]]<br />
<br />
==Exclusive Programs & APIS==<br />
*Paint<br />
*paintutils (API)<br />
==History==<br />
*1.45 PR1 - Added Advanced Computers<br />
*1.45 PR3 - Changed around the mouse function</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Advanced_Computer&diff=3462Advanced Computer2012-10-21T21:16:29Z<p>67.189.72.22: </p>
<hr />
<div>[[File:AdvancedComputerPaint.png|frame|right|An advanced computer running Paint, an exclusive program]]The advanced computer is a [[computer]] that have mouse and colour API support. They may have more exclusive features soon. They resemble the traditional computer console, but are golden coloured to match their crafting [[recipes|recipe]].<br />
==Recipe==<br />
{{Crafting grid<br />
|A1=gold_ingot |B1=gold_ingot |C1=gold_ingot<br />
|A2=gold_ingot |B2=redstone_dust |C2=gold_ingot<br />
|A3=gold_ingot |B3=glass_pane |C3=gold_ingot<br />
|Output=advanced_console<br />
}}<br />
==Exclusive Functions==<br />
* term.setTextColour( )<br />
* term.setBackgroundColour()<br />
[[Category:Blocks]]<br />
[[Category:Consoles]]<br />
==Exclusive Programs & APIS==<br />
*Paint<br />
*paintutils (API)<br />
==History==<br />
*1.45 PR1 - Added Advanced Computers<br />
*1.45 PR3 - Changed around the mouse function</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Login_with_Roaming_Profiles&diff=3411Login with Roaming Profiles2012-10-14T22:20:48Z<p>67.189.72.22: </p>
<hr />
<div><br />
This tutorial covers how to make a password server and a password client. The server will host a Lua table of usernames and passwords and the client will remotely connect each start up, ask the user for their username and password and compare it to that on the password server.<br />
<br />
__TOC__<br />
<br />
== Setting Up ==<br />
As I'm sure you're aware, writing code directly into the computer terminal can be difficult, slow, and therefore annoying. I highly recommend writing/copying the following code into a Lua editor and then using FTP to transfer the documents across to the computer or disk. Please ensure you do not add the .lua extension. Programs are saved in your minecraft world under the "computer" directory, with one folder for each computer plus the folder "disk" which contains a directory for each disk.<br />
<br />
First craft two or more computers. One will act as your password server, any others will be connecting to that computer. Find the computer ID of your password server. This is important as we don't want to broadcast password requests and replies. In the following code I have also locked the requests to certain computers to ensure security but it is not a needed component of the code. If you decide to take the security as well, make a note of all of the ID's of the client computers. I found it useful to give each computer a label and then search for labels.txt on the server to map it out easily.<br />
<br />
Each computer you craft needs a [[modem|rednet modem]].<br />
<br />
== Server ==<br />
<br />
os.pullEvent = os.pullEventRaw<br />
term.clear()<br />
term.setCursorPos(1,1)<br />
print("This is a password server. There is no user interaction here.")<br />
print("Please find a computer and login there.") <br />
local firstCycle = true<br />
local validSender = false<br />
local modemSide = "left" -- change to the side of the computer your modem is on<br />
local valid = false<br />
users = {"username1", "username2" } --make sure users and passwords line up<br />
passwords = {"password1", "password2" }<br />
senders = { 1, 2, 3, 4 } -- computer ID's of the computers you want to accept requests from<br />
function bootUp()<br />
rednet.open(modemSide)<br />
end<br />
while true do <br />
validSender = false<br />
if firstCycle then<br />
bootUp()<br />
firstCycle = false<br />
end<br />
senderId, message, distance = rednet.receive()<br />
for i,v in ipairs(senders) do<br />
if v == senderId then<br />
validSender = true<br />
break<br />
end<br />
end<br />
if validSender then<br />
for i,v in ipairs(users) do<br />
if message == v then<br />
password = passwords[i]<br />
valid = true<br />
else<br />
valid = false<br />
end<br />
end<br />
if valid then<br />
rednet.send(senderId, password, true)<br />
else<br />
rednet.send(senderId, "Not Valid", true)<br />
end<br />
end<br />
end<br />
<br />
== Client ==<br />
<br />
os.pullEvent = os.pullEventRaw<br />
local locker = true<br />
local failed = true<br />
local attempted_login = true<br />
local password_server = 0 -- change to the ID of your password server computer<br />
rednet.open("left") -- change to the side your rednet modem is on<br />
while locker do<br />
attempted_login = false<br />
term.clear()<br />
term.setCursorPos(1,1)<br />
print("Welcome to a USERS PC : Roaming Profile Enabled")<br />
print("What would you like to do?")<br />
print("[1] Login (*)")<br />
print("[2] Shutdown")<br />
write("> ")<br />
local input = read()<br />
if input == "2" then<br />
os.shutdown()<br />
elseif input == "1" then<br />
attempted_login = true<br />
print("Please login...")<br />
write("Username: ")<br />
local username = read()<br />
write("Password: ")<br />
local password = read("*")<br />
rednet.send(password_server, username, true)<br />
senderId, message, distance = rednet.receive(5)<br />
if password == message then<br />
failed = false<br />
locker = false<br />
term.clear()<br />
term.setCursorPos(1,1)<br />
print("Welcome ", username)<br />
else<br />
print("Invalid Username or Password.")<br />
sleep(3)<br />
end<br />
else<br />
print("Command not recognised...")<br />
sleep(2)<br />
end<br />
end<br />
<br />
== Thoughts and Notes ==<br />
If you change the client code, to "startup" and put it in the root directory, it works very well as a login system.<br />
You may also want to put in the line <br />
os.pullEvent = os.pullEventRaw -- disables Ctrl+T<br />
as if it doesn't work first time it can be difficult to get out of the program.<br />
<br />
If you have either Railcraft or Additional Pipes, find the 'World Anchor' or 'Teleport Tether' block. If your server can afford the resources, place the block within a 3x3 grid of your password server. It will ensure that even if you leave the chunk, the password server still is operational. Otherwise you may find that you cannot login because you've left the chunk and the password server is no longer dealing with requests.<br />
<br />
This is a minor security flaw but it is only if someone has access to a computer that is 'whitelisted' to access the password server. The security flaw is that if they use the password Not Valid on that computer they are allowed access;<br />
<br />
if valid then<br />
--send client password<br />
else<br />
--send client Not Valid<br />
end<br />
<br />
to fix remove the else statement<br />
<br />
<br />
[[Category:User Management]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Getting_Started&diff=3306Getting Started2012-10-06T00:47:23Z<p>67.189.72.22: Update forge link</p>
<hr />
<div>== Prerequisite: Installing the mods ==<br />
'''It is very important to read everything carefully before asking questions.'''<br />
'''Also, the latest version of this mod may not be compatible with the current Minecraft release.'''<br />
<br />
# Install [http://jenkins.minecraftforge.net/job/forge/forge-recommended/ Minecraft Forge Recommended Build]<br />
# Download the latest version of [http://www.minecraftforum.net/topic/892282- ComputerCraft]<br />
# Copy OR extract the .zip file into *minecraft folder*\mods\. (Tip: If on Windows, on the main screen of Minecraft, go to 'Texture Packs' and click on 'Open texture pack folder'. Go up one folder, there's your Minecraft folder. If on Mac, open Finder, hit Command+Shift+G and type ~/Library/ then hit enter, open 'Application Support' then open 'minecraft')<br />
<!-- Both the zip or folder work. Please do not edit this without proof. --><br />
<br />
== Step 1: Crafting your first console ==<br />
The recipe is simple:<br /><br />
{{Crafting grid<br />
|A1=stone |B1=stone |C1=stone<br />
|A2=stone |B2=redstone |C2=stone<br />
|A3=stone |B3=glass pane |C3=stone<br />
|Output=console<br />
}}<br />
<br /><br />
<br />
Right click on the console to use it.<br /><br />
Some important keys to remember:<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
!style="background:#EEE" width="200px"|Shortcut<br />
!style="background:#EEE" width="*"|Usage<br />
|-<br />
|CTRL + T<br />
|Closes the current program.<br />
|-<br />
|CTRL + R<br />
|Reboots the console.<br />
|-<br />
|CTRL + S<br />
|Forcefully shuts down the computer.<br />
|}<br />
NOTE: You have to hold the keyboard shortcuts down for at least 1 second!<br /><br />
These are forced (CRTL+T can be disabled by a program).<br />
<br />
== Step 2: Wiring it all up ==<br />
The console accepts many forms of redstone. For simple structures, such as a password protected door, only a single line of redstone is needed.<br />
However, this mod can do much more. If you need to connect multiple wires to one side, you can just use RedPower's cables. <br />
<br />
== Step 3: Programming your system ==<br />
If you've programmed anything before this shouldn't be hard. It'll feel very comfortable.<br />
<br />
NOTE: You may also want to make a [[Floppy Disk]] or two to use along with your machine<br />
<br />
Type<br />
edit <filename><br />
in the terminal to open the included feature-rich <!-- Save and exit!!! --> text editor. To get the hang of Lua if you're new, use<br />
edit /rom/programs/hello<br />
to view the code of a simple program 'hello'.<br />
<br />
Navigating is easy.<br />
> ls<br />
rom<br />
> cd rom<br />
rom> ls<br />
apis help programs<br />
startup<br />
rom> cd programs<br />
rom/programs> cd /<br />
><br />
To say it in English: ls '''l'''i'''s'''ts the files and folders in a directory, while cd changes the '''c'''urrent '''d'''irectory. '''/''' is the root of the computer.<br />
<br />
== Step 4: Test it ==<br />
Make sure that your program is bug-proof before using it as something important. A system controlling the state of an IndustrialCraft² Mark-III Nuclear Reactor to prevent it from overheating shouldn't crash every now and then with "Too long without yielding".<br />
<br />
== Step 5: Extend it ==<br />
Give back your part to the community. Help others on the forums or improve the wiki. Or, make your own OS or shell to run on the computers and share it with everybody. You can even create your own peripheral blocks using the API to create even a bigger system. A mainframe, for example.</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Getting_Started&diff=3302Getting Started2012-10-04T23:54:38Z<p>67.189.72.22: </p>
<hr />
<div>== Prerequisite: Installing the mods ==<br />
'''It is very important to read everything carefully before asking questions.'''<br />
'''Also, the latest version of this mod may not be compatible with the current Minecraft release.'''<br />
<br />
# Install [http://jenkins.minecraftforge.net:7070/job/forge/forge-recommended/ Minecraft Forge Recommended Build]<br />
# Download the latest version of [http://www.minecraftforum.net/topic/892282- ComputerCraft]<br />
# Copy OR extract the .zip file into *minecraft folder*\mods\. (Tip: If on Windows, on the main screen of Minecraft, go to 'Texture Packs' and click on 'Open texture pack folder'. Go up one folder, there's your Minecraft folder. If on Mac, open Finder, hit Command+Shift+G and type ~/Library/ then hit enter, open 'Application Support' then open 'minecraft')<br />
<!-- Both the zip or folder work. Please do not edit this without proof. --><br />
<br />
== Step 1: Crafting your first console ==<br />
The recipe is simple:<br /><br />
{{Crafting grid<br />
|A1=stone |B1=stone |C1=stone<br />
|A2=stone |B2=redstone |C2=stone<br />
|A3=stone |B3=glass pane |C3=stone<br />
|Output=console<br />
}}<br />
<br /><br />
<br />
Right click on the console to use it.<br /><br />
Some important keys to remember:<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
!style="background:#EEE" width="200px"|Shortcut<br />
!style="background:#EEE" width="*"|Usage<br />
|-<br />
|CTRL + T<br />
|Closes the current program.<br />
|-<br />
|CTRL + R<br />
|Reboots the console.<br />
|-<br />
|CTRL + S<br />
|Forcefully shuts down the computer.<br />
|}<br />
NOTE: You have to hold the keyboard shortcuts down for at least 1 second!<br /><br />
These are forced (CRTL+T can be disabled by a program).<br />
<br />
== Step 2: Wiring it all up ==<br />
The console accepts many forms of redstone. For simple structures, such as a password protected door, only a single line of redstone is needed.<br />
However, this mod can do much more. If you need to connect multiple wires to one side, you can just use RedPower's cables. <br />
<br />
== Step 3: Programming your system ==<br />
If you've programmed anything before this shouldn't be hard. It'll feel very comfortable.<br />
<br />
NOTE: You may also want to make a [[Floppy Disk]] or two to use along with your machine<br />
<br />
Type<br />
edit <filename><br />
in the terminal to open the included feature-rich <!-- Save and exit!!! --> text editor. To get the hang of Lua if you're new, use<br />
edit /rom/programs/hello<br />
to view the code of a simple program 'hello'.<br />
<br />
Navigating is easy.<br />
> ls<br />
rom<br />
> cd rom<br />
rom> ls<br />
apis help programs<br />
startup<br />
rom> cd programs<br />
rom/programs> cd /<br />
><br />
To say it in English: ls '''l'''i'''s'''ts the files and folders in a directory, while cd changes the '''c'''urrent '''d'''irectory. '''/''' is the root of the computer.<br />
<br />
== Step 4: Test it ==<br />
Make sure that your program is bug-proof before using it as something important. A system controlling the state of an IndustrialCraft² Mark-III Nuclear Reactor to prevent it from overheating shouldn't crash every now and then with "Too long without yielding".<br />
<br />
== Step 5: Extend it ==<br />
Give back your part to the community. Help others on the forums or improve the wiki. Or, make your own OS or shell to run on the computers and share it with everybody. You can even create your own peripheral blocks using the API to create even a bigger system. A mainframe, for example.</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Raw_key_events&diff=3301Raw key events2012-10-04T23:54:00Z<p>67.189.72.22: </p>
<hr />
<div>The built-in os has a function to read incoming keystrokes. But it also implements the functions to move the cursor while typing. This is not always a desired feature; imagine a case in which you want to make a menu with a controllable cursor around the menu entries. The current read() function won't let you.<br />
<br />
==Detecting keystrokes==<br />
In case I made you think the OS sucks, it doesn't (all the time). Because this OS is not Windows, we can access lower-level functions, such as os.pullEvent(). And that's the one that we're going to use:<br />
<pre><br />
function rawread()<br />
bRead = true<br />
while(bRead) do<br />
local sEvent, param = os.pullEvent("key")<br />
if(sEvent == "key") then<br />
break<br />
end<br />
end<br />
end<br />
</pre><br />
This function waits for any key, then exits.<br />
<br />
==Figuring out the key==<br />
We can detect any key, but not which key. To find it out, we have to add some further logic to the code:<br />
<pre><br />
function rawread()<br />
while true do<br />
local sEvent, param = os.pullEvent("key")<br />
if sEvent == "key" then<br />
if param == 28 then<br />
print("Enter detected")<br />
break<br />
end<br />
end<br />
end<br />
end<br />
</pre><br />
This function waits for the Enter key to be pressed. If so, it writes "Enter detected" to the screen and exits.<br />
<br />
However, this is only good for checking single keys. Also, what if you don't really want to look up the scan code on this page every time you code?<br />
Fortunately there is a solution: the [[Raw key events/keymapper|keymapper API]]. See page for details.<br />
<br />
==Key scan codes ==<br />
The scan codes are typical DirectX numbers.<br />
{|<br />
|style="vertical-align: top"|<br />
{| border="1" cellpadding="5" cellspacing="0"<br />
|-<br />
! |Key<br />
! |Code<br />
|-<br />
| Escape<br />
| 1<br />
|-<br />
| 1<br />
| 2<br />
|-<br />
| 2<br />
| 3<br />
|-<br />
| 3<br />
| 4<br />
|-<br />
| 4<br />
| 5<br />
|-<br />
| 5<br />
| 6<br />
|-<br />
| 6<br />
| 7<br />
|-<br />
| 7<br />
| 8<br />
|-<br />
| 8<br />
| 9<br />
|-<br />
| 9<br />
| 10<br />
|-<br />
| 0<br />
| 11<br />
|-<br />
| Minus<br />
| 12<br />
|-<br />
| Equals<br />
| 13<br />
|-<br />
| Backspace<br />
| 14<br />
|-<br />
| Tab<br />
| 15<br />
|-<br />
| Q<br />
| 16<br />
|-<br />
| W<br />
| 17<br />
|-<br />
| E<br />
| 18<br />
|-<br />
| R<br />
| 19<br />
|-<br />
| T<br />
| 20<br />
|-<br />
| Y<br />
| 21<br />
|-<br />
| U<br />
| 22<br />
|-<br />
| I<br />
| 23<br />
|-<br />
| O<br />
| 24<br />
|-<br />
| P<br />
| 25<br />
|}<br />
|style="vertical-align: top"|<br />
{| border="1" cellpadding="5" cellspacing="0"<br />
|-<br />
! |Key<br />
! |Code<br />
|-<br />
| Left Bracket<br />
| 26<br />
|-<br />
| Right Bracket<br />
| 27<br />
|-<br />
| Enter<br />
| 28<br />
|-<br />
| Left Control<br />
| 29<br />
|-<br />
| A<br />
| 30<br />
|- <br />
| S<br />
| 31<br />
|-<br />
| D<br />
| 32<br />
|-<br />
| F<br />
| 33<br />
|-<br />
| G<br />
| 34<br />
|-<br />
| H<br />
| 35<br />
|-<br />
| J<br />
| 36<br />
|-<br />
| K<br />
| 37<br />
|-<br />
| L<br />
| 38<br />
|-<br />
| Semicolon<br />
| 39<br />
|-<br />
| Apostrophe<br />
| 40<br />
|-<br />
| Tilde (~)<br />
| 41<br />
|-<br />
| Left Shift<br />
| 42<br />
|-<br />
| Back Slash<br />
| 43<br />
|-<br />
| Z<br />
| 44<br />
|-<br />
| X<br />
| 45<br />
|-<br />
| C<br />
| 46<br />
|-<br />
| V<br />
| 47<br />
|}<br />
|style="vertical-align: top"|<br />
{| border="1" cellpadding="5" cellspacing="0"<br />
|-<br />
! |Key<br />
! |Code<br />
|-<br />
| B<br />
| 48<br />
|-<br />
| N<br />
| 49<br />
|-<br />
| M<br />
| 50<br />
|-<br />
| Comma<br />
| 51<br />
|-<br />
| Period<br />
| 52<br />
|-<br />
| Forward Slash<br />
| 53<br />
|-<br />
| Right Shift<br />
| 54<br />
|-<br />
| Numpad *<br />
| 55<br />
|-<br />
| Left Alt<br />
| 56<br />
|-<br />
| Spacebar<br />
| 57<br />
|-<br />
| Caps Lock<br />
| 58<br />
|-<br />
| F1<br />
| 59<br />
|-<br />
| F2<br />
| 60<br />
|-<br />
| F3<br />
| 61<br />
|-<br />
| F4<br />
| 62<br />
|-<br />
| F5<br />
| 63<br />
|-<br />
| F6<br />
| 64<br />
|-<br />
| F7<br />
| 65<br />
|-<br />
| F8<br />
| 66<br />
|-<br />
| F9<br />
| 67<br />
|-<br />
| F10<br />
| 68<br />
|}<br />
|style="vertical-align: top"|<br />
{| border="1" cellpadding="5" cellspacing="0"<br />
|-<br />
! |Key<br />
! |Code<br />
|-<br />
| Num Lock<br />
| 69<br />
|-<br />
| Scroll Lock<br />
| 70<br />
|-<br />
| Numpad 7<br />
| 71<br />
|-<br />
| Numpad 8<br />
| 72<br />
|-<br />
| Numpad 9<br />
| 73<br />
|-<br />
| Numpad -<br />
| 74<br />
|-<br />
| Numpad 4<br />
| 75<br />
|-<br />
| Numpad 5<br />
| 76<br />
|-<br />
| Numpad 6<br />
| 77<br />
|-<br />
| Numpad +<br />
| 78<br />
|-<br />
| Numpad 1<br />
| 79<br />
|-<br />
| Numpad 2<br />
| 80<br />
|-<br />
| Numpad 3<br />
| 81<br />
|-<br />
| Numpad 0<br />
| 82<br />
|-<br />
| Numpad .<br />
| 83<br />
|-<br />
| F11<br />
| 87<br />
|-<br />
| F12<br />
| 88<br />
|-<br />
| Numpad Enter<br />
| 156<br />
|-<br />
| Right Control<br />
| 157<br />
|-<br />
| Numpad /<br />
| 181<br />
|-<br />
| Right Alt<br />
| 184<br />
|}<br />
|style="vertical-align: top"|<br />
{| border="1" cellpadding="5" cellspacing="0"<br />
|-<br />
! |Key<br />
! |Code<br />
|-<br />
| Home<br />
| 199<br />
|-<br />
| Up Arrow<br />
| 200<br />
|-<br />
| Page Up<br />
| 201<br />
|-<br />
| Left Arrow<br />
| 203<br />
|-<br />
| Right Arrow<br />
| 205<br />
|-<br />
| End<br />
| 207<br />
|-<br />
| Down Arrow<br />
| 208<br />
|-<br />
| Page Down<br />
| 209<br />
|-<br />
| Insert<br />
| 210<br />
|-<br />
| Delete<br />
| 211<br />
|-<br />
|}<br />
|}<br />
Source: [http://wiki.tesnexus.com/index.php/DirectX_Scancodes_And_How_To_Use_Them Nexus Wiki]<br />
<br />
<br />
[[Category:Tutorials]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Making_an_API_(tutorial)&diff=3253Making an API (tutorial)2012-10-01T22:25:02Z<p>67.189.72.22: </p>
<hr />
<div><br />
== MAKING AN API - a tutorial by TheVarmari ==<br />
'''NOTE:''' There is a better tutorial in the [http://www.computercraft.info/forums2/ forums] located [http://www.computercraft.info/forums2/index.php?/topic/145-tutorial-creating-an-api/ here].<br />
Use this if you prefer to use ccwiki.<br />
<br />
<br />
== Introduction ==<br />
Hello, dear Computercraft Wiki user!<br />
Today I will tell you how to make a functional API (Application Programming Interface).<br />
Let's get started!<br />
<br />
<br />
== Making the API file ==<br />
First we need to define what our API will be called.<br />
In this case, I use exampleAPI.<br />
Now edit the file you want your API to be called.<br />
<!--NOTE: If it exists, call it something else--><br />
<br />
=== The code ===<br />
Now, we need to put some functions in it!<br />
Why don't we start with the basics:<br />
<br />
<pre><br />
-- this is the file exampleAPI<br />
-- our first function:<br />
function printMessage(message)<br />
print(message)<br />
end<br />
</pre><br />
Which basically prints "message" when excecuted.<br />
Save the file.<br />
<br />
=== Including the API ===<br />
Now that we have the API done, let's include it in some file!<br />
Because we speak about APIs, we can't directly execute it.<br />
<br />
Edit the file you want to include the API in.<br />
In my case, it is called exampleAPI.<br />
Now, we include the API in it by typing this to the '''first''' row:<br />
<pre><br />
os.loadAPI("exampleAPI")<br />
</pre><br />
This loads the API into the file's memory.<br /><br />
'''NOTE:''' If you want your API to be loaded on every computer, copy your file to ''.minecraft\mods\ComputerCraft\lua\rom\apis\''.<br />
<br />
=== Using the API ===<br />
Now that that's over, let's include the printMessage command from our API.<br />
Lua loads API's as tables, so you have to use api_name.function_name(function_arguments)<br />
<br />
In my case, I use<br />
<code><br />
exampleAPI.printMessage("message")<br />
</code><br />
Ta-da! It printed out "message"!<br />
<br />
== A couple of words ==<br />
Thank you for reading this tutorial, it sure was fun to make!<br />
Correct any mistakes I did! <br />
[[User:TheVarmari|TheVarmari]] 16:59, 22 February 2012 (UTC)<br />
<br />
[[Category:Tutorials]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Making_an_API_(tutorial)&diff=3252Making an API (tutorial)2012-10-01T22:23:50Z<p>67.189.72.22: Undo revision 3251 by 79.102.225.207 (talk)</p>
<hr />
<div><br />
== MAKING AN API - a tutorial by TheVarmari ==<br />
'''NOTE:''' There is a better tutorial in the [http://www.computercraft.info/forums2/ forums] located [http://www.computercraft.info/forums2/index.php?/topic/145-tutorial-creating-an-api/ here].<br />
Use this if you prefer to use ccwiki.<br />
<br />
<br />
== Introduction ==<br />
Hello, dear Computercraft Wiki user!<br />
Today I will tell you how to make a functional API (Application Programming Interface).<br />
Let's get started!<br />
<br />
<br />
== Making the API file ==<br />
First we need to define what our API will be called.<br />
In this case, I use exampleAPI.<br />
Now edit the file you want your API to be called.<br />
<!--NOTE: If it exists, call it something else--><br />
<br />
=== The code ===<br />
Now, we need to put some functions in it!<br />
Why don't we start with the basics:<br />
<br />
<pre><br />
-- this is the file exampleAPI<br />
-- our first function:<br />
function printMessage(message)<br />
print(message)<br />
end<br />
</pre><br />
Which basically prints "message" when excecuted.<br />
Save the file.<br />
<br />
=== Including the API ===<br />
Now that we have the API done, let's include it in some file!<br />
Because we speak about APIs, we can't directly execute it.<br />
<br />
Edit the file you want to include the API in.<br />
In my case, it is called exampleAPI.<br />
Now, we include the API in it by typing this to the '''first''' row:<br />
<pre><br />
os.loadAPI("exampleAPI")<br />
</pre><br />
This loads the API into the file's memory.<br /><br />
'''NOTE:''' If you want your API to be loaded on every computer, copy your file to ''.minecraft\mods\ComputerCraft\lua\rom\apis\''.<br />
<br />
=== Using the API ===<br />
Now that that's over, let's include the printMessage command from our API.<br />
Lua loads API's as tables, so you have to use api_name.function_name(function_arguments)<br />
<br />
In my case, I use<br />
<code><br />
exampleAPI.printMessage()<br />
</code><br />
Ta-da! It printed out "message"!<br />
<br />
== A couple of words ==<br />
Thank you for reading this tutorial, it sure was fun to make!<br />
Correct any mistakes I did! <br />
[[User:TheVarmari|TheVarmari]] 16:59, 22 February 2012 (UTC)<br />
<br />
[[Category:Tutorials]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Printer.setPageTitle&diff=3249Printer.setPageTitle2012-10-01T17:07:46Z<p>67.189.72.22: </p>
<hr />
<div>{{stub}}<br />
<center>'''This page is unfinished.'''</center><br />
<br /><br />
Printer.setPageTitle("Test page")<br />
<br />
results in the item being called:<br />
<br />
Printed Page<br />
Test page<br />
<br />
when you hover over it with your mouse</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Printer.setPageTitle&diff=3248Printer.setPageTitle2012-10-01T17:07:20Z<p>67.189.72.22: </p>
<hr />
<div>{{stub}}<br />
'''This page is unfinished.'''<br />
Printer.setPageTitle("Test page")<br />
<br />
results in the item being called:<br />
<br />
Printed Page<br />
Test page<br />
<br />
when you hover over it with your mouse</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Category:Marked_for_deletion&diff=2944Category:Marked for deletion2012-09-17T20:13:54Z<p>67.189.72.22: Blanked the page</p>
<hr />
<div></div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Template:Version&diff=2886Template:Version2012-09-13T23:38:37Z<p>67.189.72.22: HTML5 :)</p>
<hr />
<div>Current SSP Version: '''1.41''' for Minecraft 1.2.5<br /><br />
Current SMP Version: '''1.41''' for Minecraft Server 1.2.5<br /><br />
Current Bukkit Version: '''1.41''' for Bukkit MCPC build 177+<br />
<br />
<center>'''[[Changelog]]'''</center></div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Turtle.detectDown&diff=2885Turtle.detectDown2012-09-13T23:37:54Z<p>67.189.72.22: Undo revision 2877 by 91.121.27.33 (talk)</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=turtle.detectDown<br />
|args=<br />
|api=turtle<br />
|returns=[[boolean]] If turtle has Detected a Block Below.<br />
|addon=ComputerCraft<br />
|desc=Detects if there is a Block Below.<br />
|examples=<br />
{{Example<br />
|desc=Detects if there is a Block Below.<br />
|code=turtle.detectDown()<br />
}}<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Talk:Turtle_(API)&diff=2752Talk:Turtle (API)2012-08-31T17:06:16Z<p>67.189.72.22: </p>
<hr />
<div>Is there a way to detect a block's type? Preferably without picking it up; it would be nice to be able to write a function to check the block about to be broken against a list of "Do not break" blocks, such as Industrial craft's MFSU, which loses all held power when picked up. <br />
<br />
Also I request a way to set server-wide list of blocks immune to the turtle.dig() functions, such as say personal safes (Industrial Craft again).<small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:50.131.199.48|50.131.199.48]] ([[User talk:50.131.199.48|talk]] • [[Special:Contributions/50.131.199.48|contribs]]) </span></small><!-- Template:Unsigned --><br />
:As far as I know, there's no way to check the block type with the current API. Could be a feature in the future though, never know. {{User:Scarfacial/Signature|22:17 - 8 March 2012}}<br />
::Would be interesting to see if one could write a function for that. {{User:Banane9/Signature|22:43 - 9 March 2012}}<br />
:::i would see it too please. But i dont think that you can make that in a function<br />
:::[[User:Dude|Dude]] 22:13, 9 March 2012 (UTC)<br />
::::You can determine if the block matches the one in its inventory using turtle.select(slot) and then turtle.compare() or turtle.compareUp() or turtle.compareDown()<br />
<br />
== turtle collect ? ==<br />
<br />
i understand that the turtle can drop items from its inventory with turtle.drop( [amount] )<br />
but is there a way to make the turtle collect items (like a player would do) around and store it in inventory ?<br />
(from what i understand right now the turtle collects items taken from a digged block ?<br />
thanks<br />
:Nope they don't collect items that are already dropped --[[User:Banane9|Banane9]] 12:22, 11 July 2012 (UTC)<br />
<br />
== treefarm ==<br />
<br />
i have write a big programm (120 lines) that destory the tree full (with the leaves) when the tree is grown. so the turtle can plant an new tree an beginn at the start. My problem: the programm dont work and i cant find the faults... <small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Dude|Dude]] ([[User talk:Dude|talk]] • [[Special:Contributions/Dude|contribs]]) </span></small><!-- Template:Unsigned --><br />
:Maybe because the leaves of the tree decay and that f*cks up the code? We cant help you without seeing your code ;) --[[User:Banane9|Banane9]] 12:22, 11 July 2012 (UTC)<br />
::On a similar note, I have written a disassembler script which (mostly) disassembles arbitrary things from the top down, but it really gets messed up by doors and other turtles and pistons, it is basically because interacting with blocks only works well if the blocks don't change while you are trying to deal with them/use them for navigating.<br />
<br />
== Turtle API to detect block/item ID? ==<br />
<br />
I have a suggestion, what if you have a function like: turtle.getBlockID() which would return ID, damage value, or simmilar<br />
:Dan doesn't want Block IDs as they'd break the 4th wall. --[[User:Pinkishu|Pinkishu]] 13:12, 16 August 2012 (CEST)<br />
<br />
== More than 1 mover per turtle.up() ==<br />
<br />
is there a way to make a turtle go up more than once for each turtle.up() ? like maybe turtle.up(36) (i tried that but it said attempt to call nil)<br />
<br />
You could use:<br />
<pre><br />
turtleold = turtle.up<br />
function turtlenew(times)<br />
for i=1,times do<br />
turtle.up()<br />
end<br />
end<br />
turtle.up = turtlenew<br />
</pre><br />
Then just use turtle.up(5) and stuff, because it overrides the function.</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Redstone.setOutput&diff=2697Redstone.setOutput2012-08-25T01:10:14Z<p>67.189.72.22: back ^^</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=redstone.setOutput<br />
|args=[[string]] side, [[boolean]] state<br />
|api=redstone<br />
|examples=<br />
{{Example<br />
|desc=Makes the computer output a redstone signal<br />
|code=redstone.setOutput("back", true)<br />
sleep(1)<br />
redstone.setOutput("back", false)<br />
|output=Redstone wire connected to the back of the computer will be powered for one second, then unpowered (unless it's powered by another source)<br />
}}<br />
|notes=<br />
* This function will throw an error if you give it an invalid side.<br />
* List of possible sides: left, right, front, back, bottom, top<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Talk:Floppy_Disk&diff=2340Talk:Floppy Disk2012-07-26T22:02:48Z<p>67.189.72.22: Fixed formatting</p>
<hr />
<div><!--<br />
Please use correct formatting when making topics / posting comments.<br />
--><br />
== How can I move a file from turtle to disk? ==<br />
I programmed a house building in my turtle but i want put it in a disk drive :/<br />
'''sergiogmn'''<br />
--[[Special:Contributions/81.34.113.142|81.34.113.142]] 15:59, 19 May 2012 (UTC)<br />
<br />
<br />
Place the disk in a disk drive directly behind a turtle with your program. Then access the turtle's system and copy the file with the command "copy {turtle program} disk/{turtle program}".<br />
Replace the "{turtle program}" with the appropriate name and location of the program.--[[User:SavinaRoja|SavinaRoja]] 21:31, 26 July 2012 (UTC)</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Making_a_Password_Protected_Door&diff=2299Making a Password Protected Door2012-07-24T20:24:56Z<p>67.189.72.22: Undo revision 2298 by 216.84.104.186 (talk)</p>
<hr />
<div><br />
This tutorial covers on how to make a computer output redstone current when the right password is typed in. The current is then used to trigger an iron door.<br />
<br />
<br />
__TOC__<br />
= How to make it =<br />
<br />
A password protected door is actually pretty easy, if you break it into steps.<br />
<br />
<br />
First, you need to craft a computer, and connect the back to an iron door with redstone. Like this:<br />
<br />
[[File:Tutorial1.png]]<br />
<br />
[[File:cTutorial2.png]]<br />
<br />
Once you're done with the basics, open the computer and edit the "startup" file. (type in 'edit startup')<br />
This will make it so the program will be executed when the computer boots.<br />
<br />
Once you access the startup file, enter in these five lines.<br />
<br />
<pre><br />
while true do<br />
term.clear()<br />
term.setCursorPos(1, 1)<br />
print("Please Enter Password:")<br />
input = read("*")<br />
</pre><br />
<br />
The first line opens a loop that will continue running forever, or until we explicitly exit it with the 'break' keyword. The second and third lines clear the screen of whatever may have been on it, and then set the cursor position to the top-left corner of the screen. This ensures that each time the program loops, the text appears in the same place. The fifth line assigns whatever the user types to the variable 'input'. So for example, if I typed "qwerty", it would be assigning "qwerty" to the 'input' variable. In the read call on the third line ('read("*")'), the asterisk character will be used to replace each letter typed by the user, so that the password stays hidden.<br />
<br />
Here are the next few lines added on:<br />
<br />
<pre><br />
while true do<br />
term.clear()<br />
term.setCursorPos(1, 1)<br />
print("Please Enter Password:")<br />
input = read("*")<br />
if input == "password" then<br />
redstone.setOutput("back", true)<br />
sleep(2)<br />
redstone.setOutput("back", false)<br />
end<br />
end<br />
</pre><br />
<br />
The first line we add, 'if input == "password" then' checks whether or not the 'input' variable contains the string "password". The three lines immediately following are only executed if the password is correct. So if it's correct, 'redstone.setOutput("back", true)' sets the redstone output on the back side to true (on), which opens the door. The program then wait two seconds ('sleep(2)'), and turns the redstone output back off again. The program then reaches the end of the loop and repeats.<br />
<br />
Please note that this is the basic format for a computer protection program as well. We would put this program in the startup file and instead of outputting redstone signals if the password was correct, we would use the break keyword instead to exit the loop and allow access to the rest of the computer.<br />
<br />
Note also that if the program fails somehow, pressing and holding Ctrl + T will terminate it and allow you to edit it, see the [http://computercraft.info/wiki/index.php?title=Making_a_Password_Protected_Door#Stop_people_from_terminating_your_lock No termination section] to stop people from exiting your lock.<br />
<br />
= Alternative Code =<br />
Type 'edit startup' and type in this code: <br />
(Use Ctrl + T to terminate the program, all code is explained in the comments, the --'s. It's good to read the comments, so you actually know what the code does, you do not need to have the comments in your code, of course)<br />
<pre><br />
while true do<br />
local side = "left" -- Change left to whatever side your door / redstone is on, E.G: left, right, front, back, bottom, top. Be sure to leave the "s around it, though<br />
local password = "bacon" -- Change bacon to what you want your password to be. Be sure to leave the "s around it, though<br />
local opentime = 5 -- Change 5 to how long (in seconds) you want the redstone current to be on. Don't put "s around it, though<br />
term.clear() -- Clears the screen<br />
term.setCursorPos(1,1) -- Fixes the cursor position<br />
write("Password: ") -- Prints 'Password: ' to the screen<br />
local input = read("*") -- Makes the variable 'input' have the contents of what the user types in, the "*" part censors out the password<br />
if input == password then -- Checks if the user inputted the correct password<br />
term.clear() -- Already explained up top<br />
term.setCursorPos(1,1)<br />
print("Password correct!") -- Prints 'Password correct!' to the screen<br />
rs.setOutput(side,true) -- Output a redstone current to the side you specified<br />
sleep(opentime) -- Wait the amount of seconds you specifed, then..<br />
rs.setOutput(side,false) -- Stop outputting a redstone current<br />
else -- Checks if the user didn't input the correct password<br />
term.clear()<br />
term.setCursorPos(1,1)<br />
print("Password incorrect!") -- Prints 'Password incorrect!' to the screen<br />
sleep(2) -- Waits 2 seconds<br />
end<br />
end<br />
</pre><br />
<br />
= Stop people from terminating your lock =<br />
<br />
If you don't want people holding CTRL+T and quitting your lock, use this code at the top of your program:<br />
<pre>os.pullEvent = os.pullEventRaw</pre><br />
<br />
<br />
[[Category:Tutorials]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Making_a_Password_Protected_Door&diff=2292Making a Password Protected Door2012-07-24T18:05:47Z<p>67.189.72.22: Change Alternative Code to use loops.</p>
<hr />
<div><br />
This tutorial covers on how to make a computer output redstone current when the right password is typed in. The current is then used to trigger an iron door.<br />
<br />
<br />
__TOC__<br />
= How to make it =<br />
<br />
A password protected door is actually pretty easy, if you break it into steps.<br />
<br />
<br />
First, you need to craft a computer, and connect the back to an iron door with redstone. Like this:<br />
<br />
[[File:Tutorial1.png]]<br />
<br />
[[File:cTutorial2.png]]<br />
<br />
Once you're done with the basics, open the computer and edit the "startup" file. (type in 'edit startup')<br />
This will make it so the program will be executed when the computer boots.<br />
<br />
Once you access the startup file, enter in these five lines.<br />
<br />
<pre><br />
while true do<br />
term.clear()<br />
term.setCursorPos(1, 1)<br />
print("Please Enter Password:")<br />
input = read("*")<br />
</pre><br />
<br />
The first line opens a loop that will continue running forever, or until we explicitly exit it with the 'break' keyword. The second and third lines clear the screen of whatever may have been on it, and then set the cursor position to the top-left corner of the screen. This ensures that each time the program loops, the text appears in the same place. The fifth line assigns whatever the user types to the variable 'input'. So for example, if I typed "qwerty", it would be assigning "qwerty" to the 'input' variable. In the read call on the third line ('read("*")'), the asterisk character will be used to replace each letter typed by the user, so that the password stays hidden.<br />
<br />
Here are the next few lines added on:<br />
<br />
<pre><br />
while true do<br />
term.clear()<br />
term.setCursorPos(1, 1)<br />
print("Please Enter Password:")<br />
input = read("*")<br />
if input == "password" then<br />
redstone.setOutput("back", true)<br />
sleep(2)<br />
redstone.setOutput("back", false)<br />
end<br />
end<br />
</pre><br />
<br />
The first line we add, 'if input == "password" then' checks whether or not the 'input' variable contains the string "password". The three lines immediately following are only executed if the password is correct. So if it's correct, 'redstone.setOutput("back", true)' sets the redstone output on the back side to true (on), which opens the door. The program then wait two seconds ('sleep(2)'), and turns the redstone output back off again. The program then reaches the end of the loop and repeats.<br />
<br />
Please note that this is the basic format for a computer protection program as well. We would put this program in the startup file and instead of outputting redstone signals if the password was correct, we would use the break keyword instead to exit the loop and allow access to the rest of the computer.<br />
<br />
Note also that if the program fails somehow, pressing and holding Ctrl + T will terminate it and allow you to edit it, see the [http://computercraft.info/wiki/index.php?title=Making_a_Password_Protected_Door#Stop_people_from_terminating_your_lock No termination section] to stop people from exiting your lock.<br />
<br />
= Alternative Code =<br />
Type 'edit startup' and type in this code: <br />
(Use Ctrl + T to terminate the program, all code is explained in the comments, the --'s. It's good to read the comments, so you actually know what the code does, you do not need to have the comments in your code, of course)<br />
<pre><br />
while true do<br />
local side = "left" -- Change left to whatever side your door / redstone is on, E.G: left, right, front, back, bottom, top. Be sure to leave the "s around it, though<br />
local password = "bacon" -- Change bacon to what you want your password to be. Be sure to leave the "s around it, though<br />
local opentime = 5 -- Change 5 to how long (in seconds) you want the redstone current to be on. Don't put "s around it, though<br />
term.clear() -- Clears the screen<br />
term.setCursorPos(1,1) -- Fixes the cursor position<br />
write("Password: ") -- Prints 'Password: ' to the screen<br />
local input = read("*") -- Makes the variable 'input' have the contents of what the user types in, the "*" part censors out the password<br />
if input == password then -- Checks if the user inputted the correct password<br />
term.clear() -- Already explained up top<br />
term.setCursorPos(1,1)<br />
print("Password correct!") -- Prints 'Password correct!' to the screen<br />
rs.setOutput(side,true) -- Output a redstone current to the side you specified<br />
sleep(opentime) -- Wait the amount of seconds you specifed, then..<br />
rs.setOutput(side,false) -- Stop outputting a redstone current<br />
else -- Checks if the user didn't input the correct password<br />
term.clear()<br />
term.setCursorPos(1,1)<br />
print("Password incorrect!") -- Prints 'Password incorrect!' to the screen<br />
sleep(2) -- Waits 2 seconds<br />
end<br />
end<br />
</pre><br />
<br />
= Stop people from terminating your lock =<br />
<br />
If you don't want people holding CTRL+T and quitting your lock, use this code at the top of your program:<br />
<pre>os.pullEvent = os.pullEventRaw</pre><br />
<br />
<br />
[[Category:Tutorials]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Making_a_Password_Protected_Door&diff=2291Making a Password Protected Door2012-07-24T18:03:43Z<p>67.189.72.22: Why did you mess up this page?</p>
<hr />
<div><br />
This tutorial covers on how to make a computer output redstone current when the right password is typed in. The current is then used to trigger an iron door.<br />
<br />
<br />
__TOC__<br />
= How to make it =<br />
<br />
A password protected door is actually pretty easy, if you break it into steps.<br />
<br />
<br />
First, you need to craft a computer, and connect the back to an iron door with redstone. Like this:<br />
<br />
[[File:Tutorial1.png]]<br />
<br />
[[File:cTutorial2.png]]<br />
<br />
Once you're done with the basics, open the computer and edit the "startup" file. (type in 'edit startup')<br />
This will make it so the program will be executed when the computer boots.<br />
<br />
Once you access the startup file, enter in these five lines.<br />
<br />
<pre><br />
while true do<br />
term.clear()<br />
term.setCursorPos(1, 1)<br />
print("Please Enter Password:")<br />
input = read("*")<br />
</pre><br />
<br />
The first line opens a loop that will continue running forever, or until we explicitly exit it with the 'break' keyword. The second and third lines clear the screen of whatever may have been on it, and then set the cursor position to the top-left corner of the screen. This ensures that each time the program loops, the text appears in the same place. The fifth line assigns whatever the user types to the variable 'input'. So for example, if I typed "qwerty", it would be assigning "qwerty" to the 'input' variable. In the read call on the third line ('read("*")'), the asterisk character will be used to replace each letter typed by the user, so that the password stays hidden.<br />
<br />
Here are the next few lines added on:<br />
<br />
<pre><br />
while true do<br />
term.clear()<br />
term.setCursorPos(1, 1)<br />
print("Please Enter Password:")<br />
input = read("*")<br />
if input == "password" then<br />
redstone.setOutput("back", true)<br />
sleep(2)<br />
redstone.setOutput("back", false)<br />
end<br />
end<br />
</pre><br />
<br />
The first line we add, 'if input == "password" then' checks whether or not the 'input' variable contains the string "password". The three lines immediately following are only executed if the password is correct. So if it's correct, 'redstone.setOutput("back", true)' sets the redstone output on the back side to true (on), which opens the door. The program then wait two seconds ('sleep(2)'), and turns the redstone output back off again. The program then reaches the end of the loop and repeats.<br />
<br />
Please note that this is the basic format for a computer protection program as well. We would put this program in the startup file and instead of outputting redstone signals if the password was correct, we would use the break keyword instead to exit the loop and allow access to the rest of the computer.<br />
<br />
Note also that if the program fails somehow, pressing and holding Ctrl + T will terminate it and allow you to edit it, see the [http://computercraft.info/wiki/index.php?title=Making_a_Password_Protected_Door#Stop_people_from_terminating_your_lock No termination section] to stop people from exiting your lock.<br />
<br />
= Alternative Code =<br />
Type 'edit startup' and type in this code: <br />
(Use Ctrl + T to terminate the program, all code is explained in the comments, the --'s. It's good to read the comments, so you actually know what the code does, you do not need to have the comments in your code, of course)<br />
<pre><br />
local side = "left" -- Change left to whatever side your door / redstone is on, E.G: left, right, front, back, bottom, top. Be sure to leave the "s around it, though<br />
local password = "bacon" -- Change bacon to what you want your password to be. Be sure to leave the "s around it, though<br />
local opentime = 5 -- Change 5 to how long (in seconds) you want the redstone current to be on. Don't put "s around it, though<br />
term.clear() -- Clears the screen<br />
term.setCursorPos(1,1) -- Fixes the cursor position<br />
write("Password: ") -- Prints 'Password: ' to the screen<br />
local input = read("*") -- Makes the variable 'input' have the contents of what the user types in, the "*" part censors out the password<br />
if input == password then -- Checks if the user inputted the correct password<br />
term.clear() -- Already explained up top<br />
term.setCursorPos(1,1)<br />
print("Password correct!") -- Prints 'Password correct!' to the screen<br />
rs.setOutput(side,true) -- Output a redstone current to the side you specified<br />
sleep(opentime) -- Wait the amount of seconds you specifed, then..<br />
rs.setOutput(side,false) -- Stop outputting a redstone current<br />
os.reboot() -- Reboot the computer, reopening the lock<br />
else -- Checks if the user didn't input the correct password<br />
term.clear()<br />
term.setCursorPos(1,1)<br />
print("Password incorrect!") -- Prints 'Password incorrect!' to the screen<br />
sleep(2) -- Waits 2 seconds<br />
os.reboot() -- Reboot the computer, reopening the lock<br />
end<br />
</pre><br />
<br />
= Stop people from terminating your lock =<br />
<br />
If you don't want people holding CTRL+T and quitting your lock, use this code at the top of your program:<br />
<pre>os.pullEvent = os.pullEventRaw</pre><br />
<br />
<br />
[[Category:Tutorials]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Cobble_Generator&diff=2279Cobble Generator2012-07-24T00:31:07Z<p>67.189.72.22: This is a wiki - names go into the history of the page, not the page itself.</p>
<hr />
<div>== Colors ==<br />
Run Loop: <span style="color:blue">while true do</span><br><br />
If: <span style="color:green">if a==b then</span><br><br />
Action: <span style="color:red">turtle.dig()</span><br><br />
Var: <span style="color:DarkViolet">a = turtle.getItemCount(1)</span><br><br />
Print: <span style="color:OrangeRed">Print("Cobble Farm")</span><br><br />
For: <span style="color:DarkCyan">for i=1,9 do</span><br><br />
== Image ==<br />
[[File:SmallGen.png]]<br />
<br />
== Coding ==<br />
First, you have to make a loop so the machine keeps running:<br />
<span style="color:blue">while true do</span><br />
''''Command<br />
<span style="color:blue">end</span><br />
Now, inside of the loop, you have to add something to detect the block:<br />
<span style="color:blue">while true do</span><br />
<span style="color:green">if turtle.detect() then</span><br />
''''Command<br />
<span style="color:green">end</span><br />
<span style="color:blue">end</span><br />
After that, the block must be mined:<br />
<span style="color:blue">while true do</span><br />
<span style="color:green">if turtle.detect() then</span><br />
<span style="color:red">turtle.dig()</span><br />
<span style="color:green">end</span><br />
<span style="color:blue">end</span><br />
This detects if a block is present, and then mines it.<br />
However, when all the 9 block spaces are filled with blocks (9*64=576 blocks), they must be dropped to collect new blocks:<br />
<span style="color:blue">while true do</span><br />
<span style="color:green">if turtle.detect() then</span><br />
<span style="color:red">turtle.dig()</span><br />
<span style="color:green">end</span><br />
<span style="color:DarkViolet">itemcount = turtle.getItemCount(9)</span><br />
<span style="color:green">if itemcount == 64 then</span><br />
''''Drop all stacks<br />
<span style="color:green">end</span><br />
<span style="color:blue">end</span><br />
To drop all stacks, another loop must be added:<br />
<span style="color:blue">while true do</span><br />
<span style="color:green">if turtle.detect() then</span><br />
<span style="color:red">turtle.dig()</span><br />
<span style="color:green">end</span><br />
<span style="color:DarkViolet">itemcount = turtle.getItemCount(9)</span><br />
<span style="color:green">if itemcount == 64 then</span><br />
<span style="color:DarkCyan">for i=1,9 do</span><br />
''''Select each stack and then drops it<br />
<span style="color:DarkCyan">end</span><br />
<span style="color:green">end</span><br />
<span style="color:blue">end</span><br />
To select each stack and drop it, a <span style="color:red">turtle.select()</span> and a <span style="color:red">turtle.drop()</span> must be added:<br />
<span style="color:blue">while true do</span><br />
<span style="color:green">if turtle.detect() then</span><br />
<span style="color:red">turtle.dig()</span><br />
<span style="color:green">end</span><br />
<span style="color:DarkViolet">itemcount = turtle.getItemCount(9)</span><br />
<span style="color:green">if itemcount == 64 then</span><br />
<span style="color:DarkCyan">for i=1,9 do</span><br />
<span style="color:red">turtle.select(i)<span><br />
<span style="color:red">turtle.drop()<span><br />
<span style="color:DarkCyan">end</span><br />
<span style="color:red">turtle.select(1)<span><br />
<span style="color:green">end</span><br />
<span style="color:blue">end</span><br />
<br />
== Advanced Generator ==<br />
This is the generator I created (for use with (height:4 width:2) monitor):<br />
<br />
function counter()<br />
<span style="color:DarkViolet">local i = 0</span><br />
return function() i = i + 1 return i end<br />
end<br />
function modStr(num)<br />
<span style="color:green">if num < 10 then</span><br />
return "0" .. num<br />
<span style="color:green">else</span><br />
return num<br />
<span style="color:green">end</span><br />
end<br />
<span style="color:blue">while true do</span><br />
<span style="color:green">if turtle.detect() then</span><br />
<span style="color:red">turtle.dig()</span><br />
<span style="color:red">term.clear()</span><br />
<span style="color:red">term.setCursorPos(1,1)</span><br />
<span style="color:DarkViolet">local total = 0</span><br />
<span style="color:DarkCyan">for i=1,9,1 do</span><br />
<span style="color:DarkViolet">total = total + turtle.getItemCount(i)</span><br />
<span style="color:DarkCyan">end</span><br />
<span style="color:DarkCyan">for i=1,9,1 do</span><br />
<span style="color:OrangeRed">print("Row " .. i .. ": " .. turtle.getItemCount(i) .. " (" .. math.floor((turtle.getItemCount(i)/total)*100) .. "%)")</span><br />
<span style="color:DarkCyan">end</span><br />
<span style="color:OrangeRed">print("Total: " .. total)</span><br />
<span style="color:OrangeRed">print("-----------------")</span><br />
<span style="color:DarkViolet">local iterator = counter()</span><br />
<span style="color:OrangeRed">print(" ___ ___ ___ ")</span><br />
<span style="color:OrangeRed">print("|" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |")</span><br />
<span style="color:OrangeRed">print("|___|___|___|")</span><br />
<span style="color:OrangeRed">print("|" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |")</span><br />
<span style="color:OrangeRed">print("|---|---|---|")</span><br />
<span style="color:OrangeRed">print("|" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |" .. modStr(turtle.getItemCount(iterator())) .. " |")</span><br />
<span style="color:OrangeRed">print("|___|___|___|")</span><br />
<span style="color:OrangeRed">print(" ")</span><br />
<span style="color:OrangeRed">print("-----------------")</span><br />
<span style="color:OrangeRed">print("Cobble Farmer")</span><br />
<span style="color:green">end</span><br />
<span style="color:DarkViolet">totalcount = turtle.getItemCount(9)</span><br />
<span style="color:green">if totalcount == 64 then</span><br />
<span style="color:red">term.clear()</span><br />
<span style="color:red">term.setCursorPos(1,1)</span><br />
<span style="color:OrangeRed">print("Dropping Stacks")</span><br />
<span style="color:OrangeRed">print("...Please wait.")</span><br />
<span style="color:red">sleep(1)</span><br />
<span style="color:DarkCyan">for i=1,9 do</span><br />
<span style="color:red">turtle.select(i)</span><br />
<span style="color:red">turtle.drop()</span><br />
<span style="color:DarkCyan">end</span><br />
<span style="color:red">turtle.select(1)</span><br />
<span style="color:DarkCyan">end</span><br />
<span style="color:blue">end</span><br />
Images:<br><br />
[[File:MyCob.png]]<br><br><br />
[[File:MyGen.png]]<br />
<br />
[[Category:Tutorials]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Making_a_Password_Protected_Door&diff=2277Making a Password Protected Door2012-07-23T01:35:07Z<p>67.189.72.22: It*</p>
<hr />
<div><br />
This tutorial covers on how to make a computer output redstone current when the right password is typed in. The current is then used to trigger an iron door.<br />
<br />
<br />
__TOC__<br />
= How to make it =<br />
<br />
A password protected door is actually pretty easy, if you break it into steps.<br />
<br />
<br />
First, you need to craft a computer, and connect the back to an iron door with redstone. Like this:<br />
<br />
[[File:Tutorial1.png]]<br />
<br />
[[File:cTutorial2.png]]<br />
<br />
Once you're done with the basics, open the computer and edit the "startup" file. (type in 'edit startup')<br />
This will make it so the program will be executed when the computer boots.<br />
<br />
Once you access the startup file, enter in these five lines.<br />
<br />
<pre><br />
while true do<br />
term.clear()<br />
term.setCursorPos(1, 1)<br />
print("Please Enter Password:")<br />
input = read("*")<br />
</pre><br />
<br />
The first line opens a loop that will continue running forever, or until we explicitly exit it with the 'break' keyword. The second and third lines clear the screen of whatever may have been on it, and then set the cursor position to the top-left corner of the screen. This ensures that each time the program loops, the text appears in the same place. The fifth line assigns whatever the user types to the variable 'input'. So for example, if I typed "qwerty", it would be assigning "qwerty" to the 'input' variable. In the read call on the third line ('read("*")'), the asterisk character will be used to replace each letter typed by the user, so that the password stays hidden.<br />
<br />
Here are the next few lines added on:<br />
<br />
<pre><br />
while true do<br />
term.clear()<br />
term.setCursorPos(1, 1)<br />
print("Please Enter Password:")<br />
input = read("*")<br />
if input == "password" then<br />
redstone.setOutput("back", true)<br />
sleep(2)<br />
redstone.setOutput("back", false)<br />
end<br />
end<br />
</pre><br />
<br />
The first line we add, 'if input == "password" then' checks whether or not the 'input' variable contains the string "password". The three lines immediately following are only executed if the password is correct. So if it's correct, 'redstone.setOutput("back", true)' sets the redstone output on the back side to true (on), which opens the door. The program then wait two seconds ('sleep(2)'), and turns the redstone output back off again. The program then reaches the end of the loop and repeats.<br />
<br />
Please note that this is the basic format for a computer protection program as well. We would put this program in the startup file and instead of outputting redstone signals if the password was correct, we would use the break keyword instead to exit the loop and allow access to the rest of the computer.<br />
<br />
Note also that if the program fails somehow, pressing and holding Ctrl + T will terminate it and allow you to edit it, see the [http://computercraft.info/wiki/index.php?title=Making_a_Password_Protected_Door#Stop_people_from_terminating_your_lock No termination section] to stop people from exiting your lock.<br />
<br />
= Alternative / Better code =<br />
Type 'edit startup' and type in this code: <br />
(Use Ctrl + T to terminate the program, all code is explained in the comments, the --'s. It's good to read the comments, so you actually know what the code does, you do not need to have the comments in your code, of course)<br />
<pre><br />
local side = "left" -- Change left to whatever side your door / redstone is on, E.G: left, right, front, back, bottom, top. Be sure to leave the "s around it, though<br />
local password = "bacon" -- Change bacon to what you want your password to be. Be sure to leave the "s around it, though<br />
local opentime = 5 -- Change 5 to how long (in seconds) you want the redstone current to be on. Don't put "s around it, though<br />
term.clear() -- Clears the screen<br />
term.setCursorPos(1,1) -- Fixes the cursor position<br />
write("Password: ") -- Prints 'Password: ' to the screen<br />
local input = read("*") -- Makes the variable 'input' have the contents of what the user types in, the "*" part censors out the password<br />
if input == password then -- Checks if the user inputted the correct password<br />
term.clear() -- Already explained up top<br />
term.setCursorPos(1,1)<br />
print("Password correct!") -- Prints 'Password correct!' to the screen<br />
rs.setOutput(side,true) -- Output a redstone current to the side you specified<br />
sleep(opentime) -- Wait the amount of seconds you specifed, then..<br />
rs.setOutput(side,false) -- Stop outputting a redstone current<br />
os.reboot() -- Reboot the computer, reopening the lock<br />
else -- Checks if the user didn't input the correct password<br />
term.clear()<br />
term.setCursorPos(1,1)<br />
print("Password incorrect!") -- Prints 'Password incorrect!' to the screen<br />
sleep(2) -- Waits 2 seconds<br />
os.reboot() -- Reboot the computer, reopening the lock<br />
end<br />
</pre><br />
<br />
= Stop people from terminating your lock =<br />
<br />
If you don't want people holding CTRL+T and quitting your lock, use this code at the top of your program:<br />
<pre>os.pullEvent = os.pullEventRaw</pre><br />
<br />
<br />
[[Category:Tutorials]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Monitor&diff=2117Monitor2012-07-13T03:59:03Z<p>67.189.72.22: /* Recipe */</p>
<hr />
<div>The '''Monitor''' is a block that can display text on its front side. When several screen blocks are placed on the same plane, it will form a single monitor. It is useful for displaying information at a server spawn, showing a program on the monitor, and even showing the status of a IC2 reactor! (provided you have [[CcSensors]] installed)<br />
<br />
===Recipe===<br />
{{Crafting grid<br />
|A1=stone |B1=stone |C1=stone<br />
|A2=stone |B2=glass_pane |C2=stone<br />
|A3=stone |B3=stone |C3=stone<br />
|Output=screen<br />
}}<br />
[[Category:Blocks]]<br />
<br />
===Using the Monitor===<br />
To use a monitor type: monitor <on which side the monitor is(Top,Bottom,Left,Right,Front and Back)> <the name of the program(example "hello")<br />
<br />
So, in this case, if you typed "hello" in the name of the program part, the monitor would display "Hello World"</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Wiki_Todo&diff=1930Wiki Todo2012-07-03T20:32:49Z<p>67.189.72.22: Change todo</p>
<hr />
<div>=== '''This page lists where work is needed to be done on the wiki. If you would like to help, we ask that you please make an account and help wherever you can.''' ===<br />
<br />
''Page currently incomplete, but being worked on.''<br />
<br />
== API Pages (Highest priorities are to finish function/method pages for APIs) ==<br />
<!--<br />
// Finished<br />
*[[HTTP_(API)|HTTP]] (Needs formatting and function pages)<br />
--><br />
<!--<br />
// Finished / nothing wrong with it right now<br />
*[[OS_(API)|OS]] (I'll work on this one)<br />
--><br />
*[[Parallel_(API)|Parallel]] (Needs pages for functions)<br />
*[[Peripheral_(API)|Peripheral]] (Needs pages for functions)<br />
<!--<br />
// Finished / nothing wrong with it right now<br />
*[[Rednet_(API)|Rednet]] (Just minor formatting issues with the links; not urgent)<br />
--><br />
*[[Redstone_(API)|Redstone]] (Needs pages for 3 functions)<br />
*[[Term_(API)|Term]] (Needs function pages)<br />
*[[Textutils_(API)|Textutils]] (Needs function pages)<br />
*[[Vector_(API)|Vector]] (Needs link to page explaining or description explaining what a vector is and function pages)<br />
[[Category:Lists]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Shell.exit&diff=1908Shell.exit2012-07-02T23:55:58Z<p>67.189.72.22: Forgot some stuff</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=shell.exit<br />
|returns=Text written on the screen<br />
|api=shell<br />
|addon=ComputerCraft<br />
|desc=Exits the current program (or shell if no program is open)<br />
|examples=<br />
{{Example<br />
|desc=Exits the current program (or shell if no program is open)<br />
|code=shell.exit()<br />
}}<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Shell.exit&diff=1907Shell.exit2012-07-02T23:55:21Z<p>67.189.72.22: Change to standard function formatting</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=shell.exit<br />
|returns=Text written on the screen<br />
|api=term<br />
|addon=ComputerCraft<br />
|desc=Writes to the screen<br />
|examples=<br />
{{Example<br />
|desc=Exit the current program (or shell if no program is open)<br />
|code=shell.exit()<br />
}}<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Shell_(API)&diff=1905Shell (API)2012-07-02T23:50:27Z<p>67.189.72.22: /* Methods */</p>
<hr />
<div>The shell API allows you to interface with the [http://en.wikipedia.org/wiki/Shell_%28computing%29 shell].<br />
<br />
==Methods==<br />
{| border="1" cellpadding="2" cellspacing="0"<br />
!style="background:#EEE" width="200px"|Method name<br />
!style="background:#EEE" width="*"|Description<br />
|-<br />
|[[shell.exit]]()<br />
|Exits the program (the shell if no program is open)<br />
|-<br />
|[[shell.dir]]()<br />
|Returns the directory<br />
|-<br />
|[[shell.setDir]]( path )<br />
|Sets the directory<br />
|-<br />
|[[shell.path]]()<br />
|Returns the path<br />
|-<br />
|[[shell.setPath]]( path )<br />
|Sets the path<br />
|-<br />
|[[shell.resolve]]( localpath )<br />
|Resolves a local path to an absolute path.<br />
|-<br />
|[[shell.resolveProgram]]( name )<br />
|<no description given><br />
|-<br />
|[[shell.aliases]]()<br />
|Returns aliases.<br />
|-<br />
|[[shell.setAlias]]( alias, command )<br />
|Sets an alias.<br />
|-<br />
|[[shell.clearAlias]]( alias, command )<br />
|Clears an alias.<br />
|-<br />
|[[shell.programs]]()<br />
|Returns programs.<br />
|-<br />
|[[shell.run]]( program, arguments )<br />
|Runs a program.<br />
|-<br />
|[[shell.getRunningProgram]]()<br />
|Returns the absolute path to the currently-executing program.<br />
|-<br />
|}<br />
<br />
[[Category:APIs]]</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Os.reboot&diff=1866Os.reboot2012-06-27T03:15:37Z<p>67.189.72.22: </p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=os.reboot<br />
|returns=None<br />
|api=os<br />
|addon=ComputerCraft<br />
|desc=Restarts the computer<br />
|examples=<br />
{{Example<br />
|desc=Restart<br />
|code=os.reboot()<br />
}}<br />
}}</div>67.189.72.22http://www.computercraft.info/wiki/index.php?title=Os.shutdown&diff=1865Os.shutdown2012-06-27T03:15:01Z<p>67.189.72.22: </p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=os.shutdown<br />
|returns=None<br />
|api=os<br />
|addon=ComputerCraft<br />
|desc=Shuts down the computer<br />
|examples=<br />
{{Example<br />
|desc=shut Down<br />
|code=os.shutdown()<br />
}}<br />
<br />
<br />
Alternatively you could hold ctrl + S for one second to shutdown the computer outside of a program.<br />
}}</div>67.189.72.22