http://www.computercraft.info/wiki/api.php?action=feedcontributions&user=Oeed&feedformat=atomComputerCraft Wiki - User contributions [en]2024-03-28T10:36:32ZUser contributionsMediaWiki 1.24.1http://www.computercraft.info/wiki/index.php?title=Turtle.dig&diff=6827Turtle.dig2014-12-19T00:47:08Z<p>Oeed: Added second return value</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=turtle.dig<br />
|args=<br />
|api=turtle<br />
|returns={{Type|boolean}} whether the turtle succeeded in digging, {{type|string}} error message<br />
|addon=ComputerCraft<br />
|desc=Attempts to dig the block in front of the turtle. If successful, [[Turtle.suck|suck()]] is automatically called, placing the item in turtle inventory in the selected slot if possible (block type matches and the slot is not a full stack yet), or in the next available slot.<br />
|examples=<br />
{{Example<br />
|desc=Digs the block in front of the turtle.<br />
|code=[[print]](turtle.dig())<br />
|output=true if the turtle could dig the block, false if it could not or no block present.<br />
}}<br />
{{Example<br />
|desc=Digs the block in front of the turtle, but only if there is a block to dig (saves time).<br />
|code=if [[turtle.detect]]() then<br />
turtle.dig()<br />
end<br />
|output=the turtle digs if there is a block in front.<br />
}}<br />
}}<br />
<br />
[[Category:Lua_Core_Functions]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Turtle.digDown&diff=6826Turtle.digDown2014-12-19T00:47:06Z<p>Oeed: Added second return value</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=turtle.digDown<br />
|args=<br />
|api=turtle<br />
|returns={{Type|boolean}} whether the turtle succeeded in digging, {{type|string}} error message<br />
|addon=ComputerCraft<br />
|desc=Attempts to dig the block below the turtle.<br />
|examples=<br />
{{Example<br />
|desc=Attempts to dig the block below the turtle.<br />
|code=print(turtle.digDown())<br />
|output=true if the turtle could dig the block, false if it could not or no block present.<br />
}}<br />
}}<br />
<br />
[[Category:Lua_Core_Functions]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Turtle.digUp&diff=6825Turtle.digUp2014-12-19T00:47:03Z<p>Oeed: Added second return value</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=turtle.digUp<br />
|api=turtle<br />
|returns={{Type|boolean}} whether the turtle succeeded in digging, {{type|string}} error message<br />
|addon=ComputerCraft<br />
|desc=Attempts to dig the block above of the turtle.<br />
|examples=<br />
{{Example<br />
|desc=Digs the block above the turtle.<br />
|code=print('''turtle.digUp()''')<br />
|output=true if the turtle could dig the block, false if it could not or no block present.<br />
}}<br />
}}<br />
<br />
[[Category:Lua_Core_Functions]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Textutils.urlEncode&diff=6774Textutils.urlEncode2014-10-14T06:41:21Z<p>Oeed: Removed a pointless, incorrect and confusing example.</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=textutils.urlEncode<br />
|args={{type|string}} text<br />
|returns={{type|string}} safe for use on the internet<br />
|api=textutils<br />
|addon=ComputerCraft<br />
|desc=Replaces certain characters in a string to make it safe for use on the internet. Note that it is a string function and will even replace characters that are allowed in URLs. Use this only for text to be inserted in an URL, not the URL itself.<br />
|examples=<br />
{{Example<br />
|desc=Create a safe URL from a base URL and a string to be inserted.<br />
|code= local unsafeString = "€ @!! 3-g_dvv[gf"<br />
local baseUrl = "http<nowiki/>://example.com/?view="<br />
local safeString = '''textutils.urlEncode'''(unsafeString)<br />
<br />
[[print]](baseUrl .. safeString)<br />
|output=http<nowiki/>://example.com/?view=Œ84+%40%21%21+3%2Dg%5Fdvv%5Bgf<br />
}}<br />
}}<br />
<br />
[[Category:API_Functions]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Colors_(API)&diff=6658Colors (API)2014-07-12T00:44:21Z<p>Oeed: Updated hex colours to 1.6</p>
<hr />
<div>The Colors API allows you to manipulate sets of colors. This is useful in conjunction with Bundled Cables from the RedPower mod, RedNet Cables from the MineFactory Reloaded mod, and colors on [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor|Advanced Monitors]].<br />
<br />
For the non-American English version just replace 'colors' with 'colours' and it will use the other API, colours—which is exactly the same, except in non-American English (e.g. gray is spelt grey and lightGray is spelt lightGrey).<br />
<br />
{{API table|Colors|image=Grid_disk.png|2=<br />
<br />
{{API table/row|[[colors.combine]]({{Type|number}} color1, {{Type|number}} color2, ...)|{{type|number}} value|<br />
Combines one or more colors (or sets of colors) into a larger set.<br />
|odd}}<br />
<br />
{{API table/row|[[colors.subtract]]({{Type|number}} colors, {{Type|number}} color1, {{Type|number}} color2, ...)|{{type|number}} value|<br />
Removes one or more colors (or sets of colors) from an initial set.<br />
|}}<br />
<br />
{{API table/row|[[colors.test]]({{type|number}} colors, {{type|number}} color)|{{type|boolean}} contained|<br />
Tests whether ''color'' is contained within '''colors'''.<br />
|odd}}<br />
<br />
}}<br />
<br />
<br />
'''Note:''' The standard addition (+) and subtraction (-) operators while able to be used on colors instead of colors.combine and colors.subtract should be avoided due to the nature of the colour format. For example<pre>print(colors.white + colors.white)</pre>will output 2 which is orange as opposed to<pre>print(colors.combine(colors.white, colors.white))</pre>will output 1 which is white.<br />
<br />
Furthermore, the [[Bit (API)]] may be used on sets of colors. For example, <br />
<pre><br />
bCableLeft = rs.getBundledInput("left")<br />
bCableRight = rs.getBundledInput("right")<br />
<br />
-- Get a number representing colors on in both right and left bundled cables<br />
commonColors = bit.band(bCableLeft, bCableRight)<br />
<br />
-- Get all the colors active on either right or left<br />
totalColors = bit.bor(bCableLeft, bCableRight)<br />
<br />
-- Get the colors which are active on right, or left, but not both at the same time<br />
exclusiveColors = bit.bxor(bCableLeft, bCableRight)<br />
<br />
-- Get the colors that are not active on the left<br />
offColorsA = bit.bnot(bCableLeft)<br />
</pre><br />
<br />
==Colors==<br />
The following table includes; the variable name to use in ComputerCraft programs, the decimal, hexadecimal, and binary values of the color, the number used in the 'paint' programs save files, and the actual color used to display in the ComputerCraft mod (provided in web hexadecimal format).<br />
<br />
{| class="wikitable" style="text-align:right;"<br />
! Color<br />
! Decimal<br />
! Hexadecimal<br />
! Binary<br />
! Paint<br />
! Display<br />
|-<br />
| colors.white<br />
| 1<br />
| 0x1<br />
| 0000000000000001<br />
| 0<br />
| style="background-color:#F0F0F0;" | #F0F0F0<br />
|-<br />
| colors.orange<br />
| 2<br />
| 0x2<br />
| 0000000000000010<br />
| 1<br />
| style="background-color:#F2B233;" | #F2B233<br />
|-<br />
| colors.magenta<br />
| 4<br />
| 0x4<br />
| 0000000000000100<br />
| 2<br />
| style="background-color:#E57FD8;" | #E57FD8<br />
|-<br />
| colors.lightBlue<br />
| 8<br />
| 0x8<br />
| 0000000000001000<br />
| 3<br />
| style="background-color:#99B2F2;" | #99B2F2<br />
|-<br />
| colors.yellow<br />
| 16<br />
| 0x10<br />
| 0000000000010000<br />
| 4<br />
| style="background-color:#DEDE6C;" | #DEDE6C<br />
|-<br />
| colors.lime<br />
| 32<br />
| 0x20<br />
| 0000000000100000<br />
| 5<br />
| style="background-color:#7FCC19;" | #7FCC19<br />
|-<br />
| colors.pink<br />
| 64<br />
| 0x40<br />
| 0000000001000000<br />
| 6<br />
| style="background-color:#F2B2CC;" | #F2B2CC<br />
|-<br />
| colors.gray<br />
| 128<br />
| 0x80<br />
| 0000000010000000<br />
| 7<br />
| style="background-color:#4C4C4C;" | #4C4C4C<br />
|-<br />
| colors.lightGray<br />
| 256<br />
| 0x100<br />
| 0000000100000000<br />
| 8<br />
| style="background-color:#999999;" | #999999<br />
|-<br />
| colors.cyan<br />
| 512<br />
| 0x200<br />
| 0000001000000000<br />
| 9<br />
| style="background-color:#4C99B2;" | #4C99B2<br />
|-<br />
| colors.purple<br />
| 1024<br />
| 0x400<br />
| 0000010000000000<br />
| a<br />
| style="background-color:#B266E5;" | #B266E5<br />
|-<br />
| colors.blue<br />
| 2048<br />
| 0x800<br />
| 0000100000000000<br />
| b<br />
| style="background-color:#3366CC;" | #3366CC<br />
|-<br />
| colors.brown<br />
| 4096<br />
| 0x1000<br />
| 0001000000000000<br />
| c<br />
| style="background-color:#7F664C;" | #7F664C<br />
|-<br />
| colors.green<br />
| 8192<br />
| 0x2000<br />
| 0010000000000000<br />
| d<br />
| style="background-color:#57A64E;" | #57A64E<br />
|-<br />
| colors.red<br />
| 16384<br />
| 0x4000<br />
| 0100000000000000<br />
| e<br />
| style="background-color:#CC4C4C;" | #CC4C4C<br />
|-<br />
| colors.black<br />
| 32768<br />
| 0x8000<br />
| 1000000000000000<br />
| f<br />
| style="background-color:#000000; color:#FFFFFF;" | #191919 (text)<br/>#000000 (background)<br />
|}<br />
[[Category:APIs]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Peripheral_(API)&diff=6298Peripheral (API)2014-03-29T23:01:11Z<p>Oeed: Removed NeedsWork tag</p>
<hr />
<div>{{msgbox<br />
| text = This article is about the Peripheral API. For APIs exposed when wrapping peripherals through peripheral.wrap() see [[:Category:Peripheral_APIs|Peripheral APIs]].<br />
}}<br />
<br />
__TOC__ <br />
The Peripheral API is for interacting with [[peripheral]]s connected to the computer, such as the [[Disk Drive]], the [[Advanced Monitor]] and [[Monitor]]. (More peripherals can be found under [[:Category:Peripherals|here]]).<br />
<br />
Each peripheral block has a name, or ''side''. Although peripherals can now be attached to a computer using networking cables, the word ''side'' is a holdover from when peripherals needed to be directly next to the computer.<br />
<br />
If the peripheral is next to the computer, its side is either "front", "back", "left", "right", "top" or "bottom". If the peripheral is attached by a cable, its side will follow the format "''type''_''id''", for example "printer_0".<br />
<br />
Peripheral functions are called '''methods''', a term borrowed from Java.<br />
<br />
{{API table|Peripheral|image=Grid disk.png|2=<br />
<br />
{{API table/row|[[peripheral.isPresent]]({{type|string}} side)|{{type|boolean}}|<br />
Returns '''true''' if a peripheral is connected on ''side''.<br />
|odd}}<br />
<br />
{{API table/row|[[peripheral.getType]]({{type|string}} side)|{{type|string}} /{{type|nil}}|<br />
Returns the type of peripheral connected on ''side'', as a string.<br />
If no peripheral is connected, returns nil.<br />
}}<br />
<br />
{{API table/row|[[peripheral.getMethods]]({{type|string}} side)|{{type|table}} /{{type|nil}}|<br />
Returns a list of the names of all the methods of the peripheral connected on ''side''.<br />
If no peripheral is connected, returns nil.<br />
|odd}}<br />
<br />
{{API table/row|[[peripheral.call]]({{type|string}} side, {{type|string}} method, ...)|any|<br />
Calls a method on a peripheral. The arguments (apart from ''side'' and ''method'') and the return values depend on the method being called.<br />
If no peripheral is connected, returns nil.<br />
}}<br />
<br />
{{API table/row|[[peripheral.wrap]]({{type|string}} side)|{{type|table}} peripheral / {{type|nil}}|<br />
Returns a table of functions, allowing you to call peripheral methods as if they were normal Lua functions.<br />
If no peripheral is connected, returns nil.<br />
|odd}}<br />
<br />
{{API table/row|[[peripheral.find]]({{type|string}} type)|{{type|table}} peripheral / {{type|nil}}|<br />
Finds an attached peripheral of the given type and if found returns a table of functions, similar to [[peripheral.wrap]], allowing you to call peripheral methods as if they were normal Lua functions.<br />
If no peripheral of the given type is connected, it returns nil.<br />
|odd}}<br />
<br />
{{API table/row|[[peripheral.getNames]]()|{{type|table}}|<br />
This function returns a table of all the sides that have a peripheral present. If the present peripheral is a wired modem any names of the peripherals that is on the network are also added to the table.<br />
|odd}}<br />
<br />
}}<br />
<br />
==Connecting peripherals using networking cables==<br />
Using Networking Cables, you can attach and use peripherals without having them directly touching the computer. To connect a peripheral in this way, place a Wired Modem on any side of your computer, as you would a [[Wireless Modem]]. Place a Wired Modem on each peripheral you wish to connect, and then connect all of them with Networking Cables. Then right click each of the wired modems.<br />
<br />
You should receive a message in your chat bar for each peripheral informing you of a successful connection, and the peripheral side.<br />
<br />
==Monitor==<br />
[[Monitor#Peripheral_Functions|Monitor Peripheral functions]] have been moved to the [[Monitor]] page.<br />
In addition, the [[Advanced_Monitor#Peripheral_Functions|Advanced Monitor Peripheral functions]] have been moved to the [[Advanced Monitor]] page.<br />
<br />
==Printer==<br />
[[Printer#Peripheral_Functions|Printer Peripheral functions]] have been moved to the [[Printer]] page.<br />
<br />
==Computers==<br />
[[Computer#Peripheral_Functions|Computer Peripheral functions]] have been moved to the [[Computer]] page.<br />
In addition, the [[Advanced_Computer#Peripheral_Functions|Advanced Computer Peripheral functions]] have been moved to the [[Advanced Computer]] page.<br />
<br />
[[Category:APIs]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Peripheral.find&diff=6297Peripheral.find2014-03-29T23:00:46Z<p>Oeed: Created page</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=peripheral.find<br />
|args= {{type|string}} peripheral type<br />
|returns=A handle to a peripheral of the given type.<br />
|api=peripheral<br />
|addon=ComputerCraft<br />
|desc=Returns a handle to a peripheral of the supplied type that can then be used to call methods, as if using peripheral.call(side, method)<br />
|examples=<br />
{{Example<br />
|desc=Finds a monitor and writes 'Hello' on it.<br />
|code=local monitor = peripheral.find('monitor') <br/>if monitor then <br/> monitor.write('Hello') <br/>end<br />
|output=If there is a monitor connected 'Hello' will be written on it.<br />
}}<br />
}}<br />
<br />
[[Category:Lua_Core_Functions]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Peripheral.wrap&diff=6296Peripheral.wrap2014-03-29T23:00:11Z<p>Oeed: Fixed incorrect type displaying</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=peripheral.wrap<br />
|args= {{type|string}} side<br />
|returns=A handle to the peripheral on ''side''.<br />
|api=peripheral<br />
|addon=ComputerCraft<br />
|desc=Returns a handle to a peripheral that can then be used to call methods, as if using peripheral.call(side, method)<br />
|examples=<br />
{{Example<br />
|desc=Shuts down the computer or turtle on the right side of the calling machine.<br />
|code=local handle = peripheral.wrap("right") handle.shutdown()<br />
|output=Shuts down any computer to the right of the computer/turtle.<br />
}}<br />
}}<br />
<br />
[[Category:Lua_Core_Functions]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Peripheral_(API)&diff=6295Peripheral (API)2014-03-29T22:55:58Z<p>Oeed: Added peripheral.find</p>
<hr />
<div>{{NeedsWork|New 1.6 functions and changes should be mentioned. - [[User:Oeed|Oeed]] 01:13, 29 March 2014 (GMT)}}<br />
<br />
{{msgbox<br />
| text = This article is about the Peripheral API. For APIs exposed when wrapping peripherals through peripheral.wrap() see [[:Category:Peripheral_APIs|Peripheral APIs]].<br />
}}<br />
<br />
__TOC__ <br />
The Peripheral API is for interacting with [[peripheral]]s connected to the computer, such as the [[Disk Drive]], the [[Advanced Monitor]] and [[Monitor]]. (More peripherals can be found under [[:Category:Peripherals|here]]).<br />
<br />
Each peripheral block has a name, or ''side''. Although peripherals can now be attached to a computer using networking cables, the word ''side'' is a holdover from when peripherals needed to be directly next to the computer.<br />
<br />
If the peripheral is next to the computer, its side is either "front", "back", "left", "right", "top" or "bottom". If the peripheral is attached by a cable, its side will follow the format "''type''_''id''", for example "printer_0".<br />
<br />
Peripheral functions are called '''methods''', a term borrowed from Java.<br />
<br />
{{API table|Peripheral|image=Grid disk.png|2=<br />
<br />
{{API table/row|[[peripheral.isPresent]]({{type|string}} side)|{{type|boolean}}|<br />
Returns '''true''' if a peripheral is connected on ''side''.<br />
|odd}}<br />
<br />
{{API table/row|[[peripheral.getType]]({{type|string}} side)|{{type|string}} /{{type|nil}}|<br />
Returns the type of peripheral connected on ''side'', as a string.<br />
If no peripheral is connected, returns nil.<br />
}}<br />
<br />
{{API table/row|[[peripheral.getMethods]]({{type|string}} side)|{{type|table}} /{{type|nil}}|<br />
Returns a list of the names of all the methods of the peripheral connected on ''side''.<br />
If no peripheral is connected, returns nil.<br />
|odd}}<br />
<br />
{{API table/row|[[peripheral.call]]({{type|string}} side, {{type|string}} method, ...)|any|<br />
Calls a method on a peripheral. The arguments (apart from ''side'' and ''method'') and the return values depend on the method being called.<br />
If no peripheral is connected, returns nil.<br />
}}<br />
<br />
{{API table/row|[[peripheral.wrap]]({{type|string}} side)|{{type|table}} peripheral / {{type|nil}}|<br />
Returns a table of functions, allowing you to call peripheral methods as if they were normal Lua functions.<br />
If no peripheral is connected, returns nil.<br />
|odd}}<br />
<br />
{{API table/row|[[peripheral.find]]({{type|string}} type)|{{type|table}} peripheral / {{type|nil}}|<br />
Finds an attached peripheral of the given type and if found returns a table of functions, similar to [[peripheral.wrap]], allowing you to call peripheral methods as if they were normal Lua functions.<br />
If no peripheral of the given type is connected, it returns nil.<br />
|odd}}<br />
<br />
{{API table/row|[[peripheral.getNames]]()|{{type|table}}|<br />
This function returns a table of all the sides that have a peripheral present. If the present peripheral is a wired modem any names of the peripherals that is on the network are also added to the table.<br />
|odd}}<br />
<br />
}}<br />
<br />
==Connecting peripherals using networking cables==<br />
Using Networking Cables, you can attach and use peripherals without having them directly touching the computer. To connect a peripheral in this way, place a Wired Modem on any side of your computer, as you would a [[Wireless Modem]]. Place a Wired Modem on each peripheral you wish to connect, and then connect all of them with Networking Cables. Then right click each of the wired modems.<br />
<br />
You should receive a message in your chat bar for each peripheral informing you of a successful connection, and the peripheral side.<br />
<br />
==Monitor==<br />
[[Monitor#Peripheral_Functions|Monitor Peripheral functions]] have been moved to the [[Monitor]] page.<br />
In addition, the [[Advanced_Monitor#Peripheral_Functions|Advanced Monitor Peripheral functions]] have been moved to the [[Advanced Monitor]] page.<br />
<br />
==Printer==<br />
[[Printer#Peripheral_Functions|Printer Peripheral functions]] have been moved to the [[Printer]] page.<br />
<br />
==Computers==<br />
[[Computer#Peripheral_Functions|Computer Peripheral functions]] have been moved to the [[Computer]] page.<br />
In addition, the [[Advanced_Computer#Peripheral_Functions|Advanced Computer Peripheral functions]] have been moved to the [[Advanced Computer]] page.<br />
<br />
[[Category:APIs]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Term_(API)&diff=6282Term (API)2014-03-29T07:44:18Z<p>Oeed: Added link to term_resize page</p>
<hr />
<div>The Terminal API provides functions for writing text to the terminal and monitors, and drawing ASCII graphics.<br />
<br />
Methods in ''italics'' are available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor|Advanced Monitors]].<br />
Methods in '''bold''' are available only to [[Monitor|Monitors]].<br />
<br />
{{API table|Term|image=Grid disk.png|2=<br />
<br />
{{API table/row|[[term.write]]({{type|string}} text)|{{type|nil}}<br />
|Writes ''text'' to the screen.|odd}}<br />
<br />
{{API table/row|[[term.clear]]()|{{type|nil}}<br />
|Clears the entire screen}}<br />
<br />
{{API table/row|[[term.clearLine]]()|{{type|nil}}<br />
|Clears the line the cursor is on|odd}}<br />
<br />
{{API table/row|[[term.getCursorPos]]()|{{type|number}} x, {{type|number}} y<br />
|Returns two arguments containing the x and the y position of the cursor.}}<br />
<br />
{{API table/row|[[term.setCursorPos]]({{type|number}} x, {{type|number}} y)|{{type|nil}}<br />
|Sets the cursor's position.|odd}}<br />
<br />
{{API table/row|[[term.setCursorBlink]]({{type|boolean}} bool)|{{type|nil}}<br />
|Disables the blinking or turns it on.}}<br />
<br />
{{API table/row|[[term.isColor]]()|{{type|boolean}}<br />
|Returns if the computer supports color. (Used to determine whether or not an [[Advanced Computer]] is being used)|odd}}<br />
<br />
{{API table/row|[[term.getSize]]()|{{type|number}} x, {{type|number}} y<br />
|Returns two arguments containing the x and the y values stating the size of the screen. (Good for if you're making something to be compatible with both [[Turtle]]s and [[Computer]]s.)}}<br />
<br />
{{API table/row|[[term.scroll]]({{type|number}} n)|{{type|nil}}<br />
|Scrolls the terminal ''n'' lines.|odd}}<br />
<br />
{{API table/row|[[term.redirect]](target)|{{type|table}} previous terminal object<br />
|Redirects terminal output to a monitor or other terminal object. (Use [[peripheral.wrap]] to acquire a terminal object.)}}<br />
<br />
{{API table/row|[[term.current]]()|{{type|table}} terminal object<br />
|Returns the current terminal object. ''Requires version 1.6 or newer.''|odd}}<br />
<br />
{{API table/row|''[[term.setTextColor]]({{type|number}} [[Colors (API)|color]])''|{{type|nil}}<br />
|Sets the text color of the terminal. Available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor]]s.}}<br />
<br />
{{API table/row|''[[term.setBackgroundColor]]({{type|number}} [[Colors (API)#Colors|color]])''|{{type|nil}}<br />
|Sets the background color of the terminal. Available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor]]s.|odd}}<br />
<br />
{{API table/row|'''[[monitor.setTextScale]]({{type|number}} scale)'''|{{type|nil}}<br />
|Sets the text scale on a [[Monitor]].}}<br />
<br />
}}<br />
{{Event<br />
|name=[[term_resize (event)|term_resize]]<br />
|desc=Fired when the screen changes size (through opening a new tab with ''bg'', etc). ''Requires version 1.6 or higher.''<br />
}}<br />
<br />
= Deprecated Functions =<br />
{{Deprecated<br />
|plural=yes<br />
|type=These functions<br />
}}<br />
<br />
{{API table|Term|image=Grid disk.png|2=<br />
<br />
{{API table/row|[[term.restore]]()|{{type|nil}}<br />
|Restores terminal output to the previous target.|odd}}<br />
<br />
}}<br />
[[Category:APIs]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Term_resize_(event)&diff=6281Term resize (event)2014-03-29T07:42:01Z<p>Oeed: Wrote term_resize page</p>
<hr />
<div>{{lowercase}}{{Event<br />
|name=term_resize<br />
|desc=Fired when the screen changes size (through opening a new tab with bg, etc). Requires version 1.6 or higher.<br />
|return1=Nothing<br />
}}<br />
{{Example<br />
|desc=Prints the screen size when it changes.<br />
|code=<br />
while true do<br />
event = os.pullEvent("term_resize")<br />
local w, h = term.getSize()<br />
print('Term Size: '..w..', '..h)<br />
--you should redraw your user interface here to ensure it fills the entire screen and is not clipped<br />
end<br />
}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Term.redirect&diff=6263Term.redirect2014-03-29T01:29:28Z<p>Oeed: Fixed return value</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=term.redirect<br />
|returns={{type|table}} previous terminal object<br />
|api=term<br />
|addon=ComputerCraft<br />
|desc=Redirects terminal output to a monitor (By using [[peripheral.wrap]] to get the monitor object.) or other redirect target.<br />
|examples=<br />
{{Example<br />
|desc=Prints "Hello World!" on the right monitor.<br />
|code=term.redirect(peripheral.wrap("right"))<br>print("Hello World!")<br />
|output=None<br />
}}<br />
}}<br />
<br />
[[Category:API_Functions]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Term_resize_(event)&diff=6260Term resize (event)2014-03-29T01:16:34Z<p>Oeed: Created page</p>
<hr />
<div>{{NeedsWork|This page should be made ASAP. - [[User:Oeed|Oeed]] 01:11, 29 March 2014 (GMT)}}<br />
<br />
{{lowercase}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Peripheral_(API)&diff=6258Peripheral (API)2014-03-29T01:13:13Z<p>Oeed: Added NeedsWork note</p>
<hr />
<div>{{NeedsWork|New 1.6 functions and changes should be mentioned. - [[User:Oeed|Oeed]] 01:13, 29 March 2014 (GMT)}}<br />
<br />
{{msgbox<br />
| text = This article is about the Peripheral API. For APIs exposed when wrapping peripherals through peripheral.wrap() see [[:Category:Peripheral_APIs|Peripheral APIs]].<br />
}}<br />
<br />
__TOC__ <br />
The Peripheral API is for interacting with [[peripheral]]s connected to the computer, such as the [[Disk Drive]], the [[Advanced Monitor]] and [[Monitor]]. (More peripherals can be found under [[:Category:Peripherals|here]]).<br />
<br />
Each peripheral block has a name, or ''side''. Although peripherals can now be attached to a computer using networking cables, the word ''side'' is a holdover from when peripherals needed to be directly next to the computer.<br />
<br />
If the peripheral is next to the computer, its side is either "front", "back", "left", "right", "top" or "bottom". If the peripheral is attached by a cable, its side will follow the format "''type''_''id''", for example "printer_0".<br />
<br />
Peripheral functions are called '''methods''', a term borrowed from Java.<br />
<br />
{{API table|Peripheral|image=Grid disk.png|2=<br />
<br />
{{API table/row|[[peripheral.isPresent]]({{type|string}} side)|{{type|boolean}}|<br />
Returns '''true''' if a peripheral is connected on ''side''.<br />
|odd}}<br />
<br />
{{API table/row|[[peripheral.getType]]({{type|string}} side)|{{type|string}}/{{type|nil}}|<br />
Returns the type of peripheral connected on ''side'', as a string.<br />
If no peripheral is connected, returns nil.<br />
}}<br />
<br />
{{API table/row|[[peripheral.getMethods]]({{type|string}} side)|{{type|table}}/{{type|nil}}|<br />
Returns a list of the names of all the methods of the peripheral connected on ''side''.<br />
If no peripheral is connected, returns nil.<br />
|odd}}<br />
<br />
{{API table/row|[[peripheral.call]]({{type|string}} side, {{type|string}} method, ...)|any|<br />
Calls a method on a peripheral. The arguments (apart from ''side'' and ''method'') and the return values depend on the method being called.<br />
If no peripheral is connected, returns nil.<br />
}}<br />
<br />
{{API table/row|[[peripheral.wrap]]({{type|string}} side)|{{type|table}}/{{type|nil}}|<br />
Returns a table of functions, allowing you to call peripheral methods as if they were normal Lua functions.<br />
If no peripheral is connected, returns nil.<br />
|odd}}<br />
<br />
{{API table/row|[[peripheral.getNames]]()|{{type|table}}|<br />
This function returns a table of all the sides that have a peripheral present. If the present peripheral is a wired modem any names of the peripherals that is on the network are also added to the table.<br />
|odd}}<br />
<br />
}}<br />
<br />
==Connecting peripherals using networking cables==<br />
Using Networking Cables, you can attach and use peripherals without having them directly touching the computer. To connect a peripheral in this way, place a Wired Modem on any side of your computer, as you would a [[Wireless Modem]]. Place a Wired Modem on each peripheral you wish to connect, and then connect all of them with Networking Cables. Then right click each of the wired modems.<br />
<br />
You should receive a message in your chat bar for each peripheral informing you of a successful connection, and the peripheral side.<br />
<br />
==Monitor==<br />
[[Monitor#Peripheral_Functions|Monitor Peripheral functions]] have been moved to the [[Monitor]] page.<br />
In addition, the [[Advanced_Monitor#Peripheral_Functions|Advanced Monitor Peripheral functions]] have been moved to the [[Advanced Monitor]] page.<br />
<br />
==Printer==<br />
[[Printer#Peripheral_Functions|Printer Peripheral functions]] have been moved to the [[Printer]] page.<br />
<br />
==Computers==<br />
[[Computer#Peripheral_Functions|Computer Peripheral functions]] have been moved to the [[Computer]] page.<br />
In addition, the [[Advanced_Computer#Peripheral_Functions|Advanced Computer Peripheral functions]] have been moved to the [[Advanced Computer]] page.<br />
<br />
[[Category:APIs]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Turtle.equipRight&diff=6257Turtle.equipRight2014-03-29T01:11:10Z<p>Oeed: Created page</p>
<hr />
<div>{{NeedsWork|This page should be made ASAP. - [[User:Oeed|Oeed]] 01:11, 29 March 2014 (GMT)}}<br />
<br />
{{lowercase}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Turtle.getSelectedSlot&diff=6256Turtle.getSelectedSlot2014-03-29T01:11:00Z<p>Oeed: Created page</p>
<hr />
<div>{{NeedsWork|This page should be made ASAP. - [[User:Oeed|Oeed]] 01:11, 29 March 2014 (GMT)}}<br />
<br />
{{lowercase}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Turtle.equipLeft&diff=6255Turtle.equipLeft2014-03-29T01:10:54Z<p>Oeed: Created page</p>
<hr />
<div>{{NeedsWork|This page should be made ASAP. - [[User:Oeed|Oeed]] 01:10, 29 March 2014 (GMT)}}<br />
<br />
{{lowercase}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Turtle.getFuelLimit&diff=6254Turtle.getFuelLimit2014-03-29T01:10:16Z<p>Oeed: Created page</p>
<hr />
<div>{{NeedsWork|This page should be made ASAP. - [[User:Oeed|Oeed]] 01:10, 29 March 2014 (GMT)}}<br />
<br />
{{lowercase}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Term_(API)&diff=6253Term (API)2014-03-29T01:06:20Z<p>Oeed: Fixed incorrect term.redirect return value</p>
<hr />
<div>The Terminal API provides functions for writing text to the terminal and monitors, and drawing ASCII graphics.<br />
<br />
Methods in ''italics'' are available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor|Advanced Monitors]].<br />
Methods in '''bold''' are available only to [[Monitor|Monitors]].<br />
<br />
{{API table|Term|image=Grid disk.png|2=<br />
<br />
{{API table/row|[[term.write]]({{type|string}} text)|{{type|nil}}<br />
|Writes ''text'' to the screen.|odd}}<br />
<br />
{{API table/row|[[term.clear]]()|{{type|nil}}<br />
|Clears the entire screen}}<br />
<br />
{{API table/row|[[term.clearLine]]()|{{type|nil}}<br />
|Clears the line the cursor is on|odd}}<br />
<br />
{{API table/row|[[term.getCursorPos]]()|{{type|number}} x, {{type|number}} y<br />
|Returns two arguments containing the x and the y position of the cursor.}}<br />
<br />
{{API table/row|[[term.setCursorPos]]({{type|number}} x, {{type|number}} y)|{{type|nil}}<br />
|Sets the cursor's position.|odd}}<br />
<br />
{{API table/row|[[term.setCursorBlink]]({{type|boolean}} bool)|{{type|nil}}<br />
|Disables the blinking or turns it on.}}<br />
<br />
{{API table/row|[[term.isColor]]()|{{type|boolean}}<br />
|Returns if the computer supports color. (Used to determine whether or not an [[Advanced Computer]] is being used)|odd}}<br />
<br />
{{API table/row|[[term.getSize]]()|{{type|number}} x, {{type|number}} y<br />
|Returns two arguments containing the x and the y values stating the size of the screen. (Good for if you're making something to be compatible with both [[Turtle]]s and [[Computer]]s.)}}<br />
<br />
{{API table/row|[[term.scroll]]({{type|number}} n)|{{type|nil}}<br />
|Scrolls the terminal ''n'' lines.|odd}}<br />
<br />
{{API table/row|[[term.redirect]](target)|{{type|table}} previous terminal object<br />
|Redirects terminal output to a monitor or other terminal object. (Use [[peripheral.wrap]] to acquire a terminal object.)}}<br />
<br />
{{API table/row|[[term.current]]()|{{type|table}} terminal object<br />
|Returns the current terminal object. ''Requires version 1.6 or newer.''|odd}}<br />
<br />
{{API table/row|''[[term.setTextColor]]({{type|number}} [[Colors (API)|color]])''|{{type|nil}}<br />
|Sets the text color of the terminal. Available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor]]s.}}<br />
<br />
{{API table/row|''[[term.setBackgroundColor]]({{type|number}} [[Colors (API)#Colors|color]])''|{{type|nil}}<br />
|Sets the background color of the terminal. Available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor]]s.|odd}}<br />
<br />
{{API table/row|'''[[monitor.setTextScale]]({{type|number}} scale)'''|{{type|nil}}<br />
|Sets the text scale on a [[Monitor]].}}<br />
<br />
}}<br />
{{Event<br />
|name=term_resize<br />
|desc=Fired when the screen changes size (through opening a new tab with ''bg'', etc). ''Requires version 1.6 or higher.''<br />
}}<br />
<br />
= Deprecated Functions =<br />
{{Deprecated<br />
|plural=yes<br />
|type=These functions<br />
}}<br />
<br />
{{API table|Term|image=Grid disk.png|2=<br />
<br />
{{API table/row|[[term.restore]]()|{{type|nil}}<br />
|Restores terminal output to the previous target.|odd}}<br />
<br />
}}<br />
[[Category:APIs]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Multishell&diff=6248Multishell2014-03-28T22:20:17Z<p>Oeed: moved Multishell (API) to Multishell: This is actually a program, not an API.</p>
<hr />
<div>{{NeedsWork|This page should be created ASAP. - [[User:Oeed|Oeed]] 06:00, 28 March 2014 (GMT)}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Multishell_(API)&diff=6249Multishell (API)2014-03-28T22:20:17Z<p>Oeed: moved Multishell (API) to Multishell: This is actually a program, not an API.</p>
<hr />
<div>#REDIRECT [[Multishell]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Shell_(API)&diff=6247Shell (API)2014-03-28T11:14:38Z<p>Oeed: Removed NeedsWork tag</p>
<hr />
<div>The shell API allows you to interface with the [http://en.wikipedia.org/wiki/Shell_%28computing%29 shell].<br />
<br />
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"><br />
<tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;"><br />
[[File:Grid_disk.png|24px]]&nbsp;&nbsp;<br />
Shell (API)<br />
</td></tr><br />
<br />
<tr><td style="width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;">Method Name</td><td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.exit]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Exits the current shell</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.dir]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the directory</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.setDir]]({{type|string}} path)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the directory</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.path]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the path</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.setPath]]({{type|string}} path)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the path</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.resolve]]({{type|string}} localpath)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Resolves a local path to an absolute path.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.resolveProgram]]({{type|string}} name)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Resolves the absolute path to the program whose name you provided.</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.aliases]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns aliases.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.setAlias]]({{type|string}} alias, {{type|string}} program)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets an alias.</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.clearAlias]]({{type|string}} alias)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Clears an alias.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.programs]]([<nowiki></nowiki>{{type|boolean}} hidden])</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns a {{type|table}} of programs.</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.run]]({{type|string}} program, {{type|string}} arguments)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Runs a program.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.getRunningProgram]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the absolute path to the currently-executing program.</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.openTab]]({{type|string}} program, {{type|string}} arguments)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Runs a program in another [[multishell]] tab. ''Requires version 1.6 or newer and an advanced computer.''</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.switchTab]]({{type|number}} tab ID)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Switches the [[multishell]] tab to tab with the given ID. ''Requires version 1.6 or newer and an advanced computer.''</td></tr><br />
</table><br />
<br />
<br />
[[Category:APIs]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Shell_(API)&diff=6246Shell (API)2014-03-28T11:13:50Z<p>Oeed: Added shell.switchTab and shell.openTab</p>
<hr />
<div>{{NeedsWork|New 1.6 functions and changes should be added. - [[User:Oeed|Oeed]] 06:02, 28 March 2014 (GMT)}}<br />
<br />
The shell API allows you to interface with the [http://en.wikipedia.org/wiki/Shell_%28computing%29 shell].<br />
<br />
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"><br />
<tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;"><br />
[[File:Grid_disk.png|24px]]&nbsp;&nbsp;<br />
Shell (API)<br />
</td></tr><br />
<br />
<tr><td style="width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;">Method Name</td><td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.exit]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Exits the current shell</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.dir]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the directory</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.setDir]]({{type|string}} path)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the directory</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.path]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the path</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.setPath]]({{type|string}} path)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the path</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.resolve]]({{type|string}} localpath)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Resolves a local path to an absolute path.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.resolveProgram]]({{type|string}} name)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Resolves the absolute path to the program whose name you provided.</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.aliases]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns aliases.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.setAlias]]({{type|string}} alias, {{type|string}} program)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets an alias.</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.clearAlias]]({{type|string}} alias)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Clears an alias.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.programs]]([<nowiki></nowiki>{{type|boolean}} hidden])</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns a {{type|table}} of programs.</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.run]]({{type|string}} program, {{type|string}} arguments)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Runs a program.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.getRunningProgram]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the absolute path to the currently-executing program.</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.openTab]]({{type|string}} program, {{type|string}} arguments)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Runs a program in another [[multishell]] tab. ''Requires version 1.6 or newer and an advanced computer.''</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.switchTab]]({{type|number}} tab ID)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Switches the [[multishell]] tab to tab with the given ID. ''Requires version 1.6 or newer and an advanced computer.''</td></tr><br />
</table><br />
<br />
<br />
[[Category:APIs]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Term.current&diff=6245Term.current2014-03-28T08:12:35Z<p>Oeed: Created term.current page</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=term.current<br />
|returns={{type|table}} terminal object<br />
|api=term<br />
|addon=ComputerCraft<br />
|desc=Returns the current terminal object that is being used to write to.<br />
|examples=<br />
{{Example<br />
|desc=Restores a program to the computer. <br />
This will only work if the computer was running a program on a monitor<br />
|code=term.redirect(peripheral.wrap('left')) -- switch to a monitor<br/>print('Hello!') -- write on the monitor<br/>print(term.current()) --returns the same as peripheral.wrap('left')<br />
}}<br />
|notes=<br />
* [[term.current]]() requires ComputerCraft version 1.6 or newer.<br />
}}<br />
<br />
[[Category:API_Functions]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Template:Deprecated&diff=6244Template:Deprecated2014-03-28T08:07:36Z<p>Oeed: </p>
<hr />
<div>{{msgbox<br />
| title = {{{type}}} {{#if:{{{plural|}}}|have|has}} been deprecated.<br />
| text = {{{type}}} {{#if:{{{plural|}}}|have|has}} been removed from ComputerCraft {{#if:{{{version|}}}| in version {{{version}}}}}.<br />
| bgcol = #DDDDDD<br />
}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Template:Deprecated&diff=6243Template:Deprecated2014-03-28T08:07:14Z<p>Oeed: Fixed 'in version' related typo</p>
<hr />
<div>{{msgbox<br />
| title = {{{type}}} {{#if:{{{plural|}}}|have|has}} been deprecated.<br />
| text = {{{type}}} {{#if:{{{plural|}}}|have|has}} been removed from ComputerCraft{{#if:{{{version|}}}| in version {{{version}}}}}.<br />
| bgcol = #DDDDDD<br />
}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Term.restore&diff=6242Term.restore2014-03-28T08:06:42Z<p>Oeed: Added depreciation notice</p>
<hr />
<div>{{lowercase}}<br />
<br />
{{Deprecated<br />
|type=term.restore<br />
|version=1.6<br />
}}<br />
<br />
{{Function<br />
|name=term.restore<br />
|returns=Nothing<br />
|api=term<br />
|addon=ComputerCraft<br />
|desc=Restores the program from running on a monitor to run on the computer<br />
|examples=<br />
{{Example<br />
|desc=Restores a program to the computer. <br />
This will only work if the computer was running a program on a monitor<br />
|code=term.restore()<br />
}}<br />
|notes=<br />
* [[term.restore]]() will return the monitor to the last used redirect target - meaning that if you have used [[term.redirect]] on two different monitor objects, [[term.restore]]() will only restore back to the first redirected monitor. <br />
* To restore output directly to the terminal, use [[term.redirect]]([[term.native]]).<br />
}}<br />
<br />
[[Category:API_Functions]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Term_(API)&diff=6241Term (API)2014-03-28T08:05:09Z<p>Oeed: Moved term.restore in to deprecated table, added term.current, added term_resize event</p>
<hr />
<div>The Terminal API provides functions for writing text to the terminal and monitors, and drawing ASCII graphics.<br />
<br />
Methods in ''italics'' are available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor|Advanced Monitors]].<br />
Methods in '''bold''' are available only to [[Monitor|Monitors]].<br />
<br />
{{API table|Term|image=Grid disk.png|2=<br />
<br />
{{API table/row|[[term.write]]({{type|string}} text)|{{type|nil}}<br />
|Writes ''text'' to the screen.|odd}}<br />
<br />
{{API table/row|[[term.clear]]()|{{type|nil}}<br />
|Clears the entire screen}}<br />
<br />
{{API table/row|[[term.clearLine]]()|{{type|nil}}<br />
|Clears the line the cursor is on|odd}}<br />
<br />
{{API table/row|[[term.getCursorPos]]()|{{type|number}} x, {{type|number}} y<br />
|Returns two arguments containing the x and the y position of the cursor.}}<br />
<br />
{{API table/row|[[term.setCursorPos]]({{type|number}} x, {{type|number}} y)|{{type|nil}}<br />
|Sets the cursor's position.|odd}}<br />
<br />
{{API table/row|[[term.setCursorBlink]]({{type|boolean}} bool)|{{type|nil}}<br />
|Disables the blinking or turns it on.}}<br />
<br />
{{API table/row|[[term.isColor]]()|{{type|boolean}}<br />
|Returns if the computer supports color. (Used to determine whether or not an [[Advanced Computer]] is being used)|odd}}<br />
<br />
{{API table/row|[[term.getSize]]()|{{type|number}} x, {{type|number}} y<br />
|Returns two arguments containing the x and the y values stating the size of the screen. (Good for if you're making something to be compatible with both [[Turtle]]s and [[Computer]]s.)}}<br />
<br />
{{API table/row|[[term.scroll]]({{type|number}} n)|{{type|nil}}<br />
|Scrolls the terminal ''n'' lines.|odd}}<br />
<br />
{{API table/row|[[term.redirect]](target)|{{type|nil}}<br />
|Redirects terminal output to a monitor or other terminal object. (Use [[peripheral.wrap]] to acquire a terminal object.)}}<br />
<br />
{{API table/row|[[term.current]]()|{{type|table}} terminal object<br />
|Returns the current terminal object. ''Requires version 1.6 or newer.''|odd}}<br />
<br />
{{API table/row|''[[term.setTextColor]]({{type|number}} [[Colors (API)|color]])''|{{type|nil}}<br />
|Sets the text color of the terminal. Available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor]]s.}}<br />
<br />
{{API table/row|''[[term.setBackgroundColor]]({{type|number}} [[Colors (API)#Colors|color]])''|{{type|nil}}<br />
|Sets the background color of the terminal. Available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor]]s.|odd}}<br />
<br />
{{API table/row|'''[[monitor.setTextScale]]({{type|number}} scale)'''|{{type|nil}}<br />
|Sets the text scale on a [[Monitor]].}}<br />
<br />
}}<br />
{{Event<br />
|name=term_resize<br />
|desc=Fired when the screen changes size (through opening a new tab with ''bg'', etc). ''Requires version 1.6 or higher.''<br />
}}<br />
<br />
= Deprecated Functions =<br />
{{Deprecated<br />
|plural=yes<br />
|type=These functions<br />
}}<br />
<br />
{{API table|Term|image=Grid disk.png|2=<br />
<br />
{{API table/row|[[term.restore]]()|{{type|nil}}<br />
|Restores terminal output to the previous target.|odd}}<br />
<br />
}}<br />
[[Category:APIs]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Template:Deprecated&diff=6240Template:Deprecated2014-03-28T07:44:45Z<p>Oeed: Changed background colour to grey</p>
<hr />
<div>{{msgbox<br />
| title = {{{type}}} {{#if:{{{plural|}}}|have|has}} been deprecated.<br />
| text = {{{type}}} {{#if:{{{plural|}}}|have|has}} been removed from ComputerCraft{{#if:{{{version|}}}| in version {{{version}}}}}.<br />
| bgcol = #DDDDDD<br />
}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=User:Oeed&diff=6239User:Oeed2014-03-28T07:40:16Z<p>Oeed: Created personal userpage</p>
<hr />
<div>Hello! I'm oeed, creator of OneOS, PearOS, Sketch and a few other things.<br />
<br />
You can find my forums account [http://www.computercraft.info/forums2/index.php?/user/12402-oeed/ here].</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Fs.find&diff=6238Fs.find2014-03-28T07:34:49Z<p>Oeed: Created fs.find page</p>
<hr />
<div>{{lowercase}}<br />
{{Function<br />
|name=fs.find<br />
|args={{Type|string}} wildcard<br />
|api=fs<br />
|returns={{Type|table}} list of files and folders on the computer that matches the search term.<br />
|desc=Returns a list of all the files and folders that match a wildcard expansion search.<br />
|examples=<br />
{{Example<br />
|desc=Lists all files containing 'gps' in the subfolders of the 'rom' folder.<br />
|code=print(textutils.seralize(fs.find("/rom/*/gps")))<br />
|output={"rom/apis/gps", "rom/help/gps", "rom/programs/gps"}<br />
}}<br />
}}<br />
<br />
[[Category:Lua_Core_Functions]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Fs_(API)&diff=6237Fs (API)2014-03-28T07:28:47Z<p>Oeed: Added fs.find</p>
<hr />
<div>The FS API allows you to manipulate files and the filesystem.<br />
<br />
{{API table|FS|image=Grid_disk.png|2=<br />
<br />
{{API table/row|[[fs.list]]({{Type|string}} path)|{{type|table}} files|Returns a list of all the files (including subdirectories but not their contents) contained in a directory, as a numerically indexed table.|odd}}<br />
<br />
{{API table/row|[[fs.exists]]({{Type|string}} path)|{{Type|boolean}} exists|Checks if a path refers to an existing file or directory.|}}<br />
{{API table/row|[[fs.isDir]]({{Type|string}} path)|{{Type|boolean}} isdir|Checks if a path refers to an existing directory.|odd}}<br />
{{API table/row|[[fs.isReadOnly]]({{Type|string}} path)|{{Type|boolean}} readonly|Checks if a path is read-only (i.e. cannot be modified).|}}<br />
{{API table/row|[[fs.getName]]({{type|string}} path)|{{type|string}} name|Gets the final component of a pathname.|odd}}<br />
{{API table/row|[[fs.getDrive]]({{type|string}} path)|{{type|string}}/{{type|nil}} drive|Gets the storage medium holding a path, or [[nil]] if the path does not exist.|}}<br />
{{API table/row|[[fs.getSize]]({{Type|string}} path)|{{type|number}} size|Gets the size of a file in bytes.|odd}}<br />
{{API table/row|[[fs.getFreeSpace]]({{Type|string}} path)|{{type|number}} space|Gets the remaining space on the drive containing the given directory.|}}<br />
{{API table/row|[[fs.makeDir]]({{Type|string}} path)|{{type|nil}}|Makes a directory.|odd}}<br />
{{API table/row|[[fs.move]]({{Type|string}} fromPath, {{Type|string}} toPath)|{{type|nil}}|Moves a file or directory to a new location.|}}<br />
{{API table/row|[[fs.copy]]({{Type|string}} fromPath, {{Type|string}} toPath)|{{type|nil}}|Copies a file or directory to a new location.|odd}}<br />
{{API table/row|[[fs.delete]]({{Type|string}} path)|{{type|nil}}|Deletes a file or directory.|}}<br />
{{API table/row|[[fs.combine]]({{Type|string}} basePath, {{Type|string}} localPath)|{{type|string}} path|Combines two path components, returning a path consisting of the local path nested inside the base path.|odd}}<br />
{{API table/row|[[fs.open]]({{Type|string}} path, {{Type|string}} mode)|{{type|table}} handle|Opens a file so it can be read or written.|}}<br />
{{API table/row|[[fs.find]]({{Type|string}} wildcard)|{{type|table}} files|Searches the computer's files using [https://twitter.com/DanTwoHundred/status/417113682129068032 wildcards]. ''Requires version 1.6 or later.''|}}<br />
<br />
}}<br />
<br />
[[Category:APIs]]<br />
<br />
==Path Names==<br />
All of these functions except for [[fs.combine]] refer solely to <em>absolute paths</em>.<br /><br />
This means that the current working directory, as set by the <code>cd</code> command or the [[shell.setDir]] function, is ignored. Each path name consists of a list of nonempty path components separated by forward slashes, and those path components are taken one by one with the first being contained in the root directory of the computer.<br />
<br />
If you need to deal with paths provided by the user that may be absolute or may be relative to the current working directory, use [[shell.resolve]].<br />
<br />
Unlike most real-world operating systems, ComputerCraft's absolute path name system does not need to be started with a forward slash ( / ), making the directory "a/b/c" the same as "/a/b/c". Leaving the slashes is just a matter of preference to the coder.</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Template:BlocksItemsList&diff=6236Template:BlocksItemsList2014-03-28T07:18:47Z<p>Oeed: </p>
<hr />
<div><includeonly><br />
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"><br />
<tr><td style="background-color:#9EBAFF; font-weight: bold; font-size: large; line-height:28px;">[[File:Grid_Redstone.png|25px]]ComputerCraft Blocks and Items</td></tr><br />
<tr><td style="border-color: black; padding: .2em; padding-left: .4em; width:300px; background-color:#DBE5FF; font-weight:bold; font-size: 14px;">[[File:Grid_paper.png|18px]]&nbsp;&nbsp;[[:Category:Blocks|Blocks]]</td></tr><br />
<tr><td style="border-color: black; padding: .4em; padding-left: .4em;"><br />
<table style="width:100%;"><tr><br />
<td style="width:25%">[[File:Iso_Computer.png|16px]]&nbsp;&nbsp;[[Computer]]</td><br />
<td style="width:25%">[[File:Iso_Advanced_Computer.png|16px]]&nbsp;&nbsp;[[Advanced Computer]]</td><br />
<td style="width:25%">[[File:Iso_DiskDrive.png|16px]]&nbsp;&nbsp;[[Disk Drive]]</td><br />
<td style="width:25%">[[File:Iso_Monitor.png|16px]]&nbsp;&nbsp;[[Monitor]]</td><br />
</tr><tr><br />
<td style="width:25%">[[File:Iso_Advanced_Monitor.png|16px]]&nbsp;&nbsp;[[Advanced Monitor]]</td><br />
<td style="width:25%">[[File:Iso_Printer.png|16px]]&nbsp;&nbsp;[[Printer]]</td><br />
<td style="width:25%">[[File:Grid_turtle.png|16px]]&nbsp;&nbsp;[[Turtle]]</td><br />
<td style="width:25%">[[File:Grid_Modem.png|16px]]&nbsp;&nbsp;[[Wireless Modem]]</td><br />
</tr><tr><br />
<td style="width:25%">[[File:Grid_Wired_Modem.png|16px]]&nbsp;&nbsp;[[Wired Modem]]</td><br />
<td style="width:25%">[[File:Iso_Unknown.png|16px]]&nbsp;&nbsp;[[Wired Modem|Networking Cable]]</td><br />
</tr></table><br />
</td><br />
</tr><br />
<tr><td style="border-color: black; padding: .2em; padding-left: .4em; width:300px; background-color:#DBE5FF; font-weight:bold; font-size: 14px;">[[File:Grid_paper.png|18px]]&nbsp;&nbsp;[[:Category:Items|Items]]</td></tr><br />
<tr><td style="border-color: black; padding: .4em; padding-left: .4em;"><br />
<table style="width:100%;"><tr><br />
<td style="width:25%">[[File:Grid_Pocket_Computer.png|16px]]&nbsp;&nbsp;[[Pocket Computer]]</td><br />
<td style="width:25%">[[File:Grid_Advanced_Pocket_Computer.png|16px]]&nbsp;&nbsp;[[Pocket Computer|Advanced Pocket Computer]]</td><br />
<td style="width:25%">[[File:Grid_disk.png|16px]]&nbsp;&nbsp;[[Floppy Disk]]</td><br />
<td style="width:25%">[[File:Grid_printed_page.png|16px]]&nbsp;&nbsp;[[Printer|Printed Page]]</td><br />
</tr><tr><br />
<td style="width:25%">[[File:Grid_printed_pages.png|16px]]&nbsp;&nbsp;[[Printer|Printed Pages]]</td><br />
<td style="width:25%">[[File:Grid_printed_book_.png|16px]]&nbsp;&nbsp;[[Printer|Printed Book]]</td><br />
</tr></table><br />
</td><br />
</tr><br />
</table><br />
</includeonly></div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Template:BlocksItemsList&diff=6235Template:BlocksItemsList2014-03-28T07:18:37Z<p>Oeed: Added pocket computers</p>
<hr />
<div><-includeonly><br />
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"><br />
<tr><td style="background-color:#9EBAFF; font-weight: bold; font-size: large; line-height:28px;">[[File:Grid_Redstone.png|25px]]ComputerCraft Blocks and Items</td></tr><br />
<tr><td style="border-color: black; padding: .2em; padding-left: .4em; width:300px; background-color:#DBE5FF; font-weight:bold; font-size: 14px;">[[File:Grid_paper.png|18px]]&nbsp;&nbsp;[[:Category:Blocks|Blocks]]</td></tr><br />
<tr><td style="border-color: black; padding: .4em; padding-left: .4em;"><br />
<table style="width:100%;"><tr><br />
<td style="width:25%">[[File:Iso_Computer.png|16px]]&nbsp;&nbsp;[[Computer]]</td><br />
<td style="width:25%">[[File:Iso_Advanced_Computer.png|16px]]&nbsp;&nbsp;[[Advanced Computer]]</td><br />
<td style="width:25%">[[File:Iso_DiskDrive.png|16px]]&nbsp;&nbsp;[[Disk Drive]]</td><br />
<td style="width:25%">[[File:Iso_Monitor.png|16px]]&nbsp;&nbsp;[[Monitor]]</td><br />
</tr><tr><br />
<td style="width:25%">[[File:Iso_Advanced_Monitor.png|16px]]&nbsp;&nbsp;[[Advanced Monitor]]</td><br />
<td style="width:25%">[[File:Iso_Printer.png|16px]]&nbsp;&nbsp;[[Printer]]</td><br />
<td style="width:25%">[[File:Grid_turtle.png|16px]]&nbsp;&nbsp;[[Turtle]]</td><br />
<td style="width:25%">[[File:Grid_Modem.png|16px]]&nbsp;&nbsp;[[Wireless Modem]]</td><br />
</tr><tr><br />
<td style="width:25%">[[File:Grid_Wired_Modem.png|16px]]&nbsp;&nbsp;[[Wired Modem]]</td><br />
<td style="width:25%">[[File:Iso_Unknown.png|16px]]&nbsp;&nbsp;[[Wired Modem|Networking Cable]]</td><br />
</tr></table><br />
</td><br />
</tr><br />
<tr><td style="border-color: black; padding: .2em; padding-left: .4em; width:300px; background-color:#DBE5FF; font-weight:bold; font-size: 14px;">[[File:Grid_paper.png|18px]]&nbsp;&nbsp;[[:Category:Items|Items]]</td></tr><br />
<tr><td style="border-color: black; padding: .4em; padding-left: .4em;"><br />
<table style="width:100%;"><tr><br />
<td style="width:25%">[[File:Grid_Pocket_Computer.png|16px]]&nbsp;&nbsp;[[Pocket Computer]]</td><br />
<td style="width:25%">[[File:Grid_Advanced_Pocket_Computer.png|16px]]&nbsp;&nbsp;[[Pocket Computer|Advanced Pocket Computer]]</td><br />
<td style="width:25%">[[File:Grid_disk.png|16px]]&nbsp;&nbsp;[[Floppy Disk]]</td><br />
<td style="width:25%">[[File:Grid_printed_page.png|16px]]&nbsp;&nbsp;[[Printer|Printed Page]]</td><br />
</tr><tr><br />
<td style="width:25%">[[File:Grid_printed_pages.png|16px]]&nbsp;&nbsp;[[Printer|Printed Pages]]</td><br />
<td style="width:25%">[[File:Grid_printed_book_.png|16px]]&nbsp;&nbsp;[[Printer|Printed Book]]</td><br />
</tr></table><br />
</td><br />
</tr><br />
</table><br />
</includeonly></div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Pocket_Computer&diff=6234Pocket Computer2014-03-28T07:10:45Z<p>Oeed: Wrote pocket computer page</p>
<hr />
<div>{{Block<br />
|name=Pocket Computer<br />
|image=Pocket_Computer_Large.png<br />
|id=31709<br />
|damage-value=The ID of the Computer.<br />
|is-peripheral=No<br />
}}<br />
Pocket Computers, added in 1.6, are computers than are held as an inventory item, allowing you to use them on the move. To use a Pocket Computer, hold it in your hand then right click. Both advanced and standard versions are available. It is also possible to craft Pocket Computers with wireless modems built in, this allows you to control your machines from anywhere or even [http://www.computercraft.info/forums2/index.php?/topic/17614-ultimate-door-lock-pda-opened-doors/ open doors] for you without having to do anything! When removing from your inventory (dropping, moving in to chest, etc) the computer will stay on for 3-4 seconds. After that time it will turn it self off, you will not loose any data. The screen size of Pocket Computers is 26 wide by 20 high.<br />
<br />
If the computer your program is running on is a Pocket Computer 'pocket' will be a blank table.<br />
For example, to check if your program is running on Pocket Computer do:<br />
if pocket then<br />
print('Running on a Pocket Computer')<br />
else<br />
print('Running on a standard Computer')<br />
end<br />
[[Category:Items]]<br />
[[Category:Consoles]]<br />
== Recipes ==<br />
{{Crafting grid<br />
|A1=Gold_Ingot |B1=Gold_Ingot |C1=Gold_Ingot<br />
|A2=Gold_Ingot |B2=Golden_Apple |C2=Gold_Ingot<br />
|A3=Gold_Ingot |B3=glass_pane |C3=Gold_Ingot<br />
|Output=Advanced_Pocket_Computer<br />
}}<br />
{{Crafting grid<br />
|A1=stone |B1=stone |C1=stone<br />
|A2=stone |B2=Golden Apple |C2=stone<br />
|A3=stone |B3=glass_pane |C3=stone<br />
|Output=Pocket_Computer<br />
}}<br />
<br />
Wireless Pocket Computers (inc. Advanced)<br />
{{Crafting grid<br />
|B1=Modem<br />
|B2=Pocket_Computer<br />
|Output=Pocket_Computer<br />
}}<br />
== Usage ==<br />
Hold the Pocket Computer in your hands then right click. To turn it off type 'shutdown' in to the shell.<br />
<br />
Pocket Computers also come with a special program, falling, a Tetris game by by GopherAtl. <br />
<br />
Below is a ingame screen of a Pocket Computer.<br />
<br />
[[File:Pocket_Computer_Screenshot.png]]<br />
<br />
<br />
{{BlocksItemsList}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=File:Pocket_Computer_Screenshot.png&diff=6233File:Pocket Computer Screenshot.png2014-03-28T07:06:57Z<p>Oeed: </p>
<hr />
<div></div>Oeedhttp://www.computercraft.info/wiki/index.php?title=File:Pocket_Computer_Large.png&diff=6232File:Pocket Computer Large.png2014-03-28T06:44:11Z<p>Oeed: </p>
<hr />
<div></div>Oeedhttp://www.computercraft.info/wiki/index.php?title=File:Advanced_Pocket_Computer_Large.png&diff=6231File:Advanced Pocket Computer Large.png2014-03-28T06:43:44Z<p>Oeed: </p>
<hr />
<div></div>Oeedhttp://www.computercraft.info/wiki/index.php?title=File:Grid_Advanced_Pocket_Computer.png&diff=6230File:Grid Advanced Pocket Computer.png2014-03-28T06:40:07Z<p>Oeed: Advanced Pocket Computer icon in the off state, copied from the mod's assets</p>
<hr />
<div>Advanced Pocket Computer icon in the off state, copied from the mod's assets</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=File:Grid_Pocket_Computer.png&diff=6229File:Grid Pocket Computer.png2014-03-28T06:38:15Z<p>Oeed: </p>
<hr />
<div>Pocket Computer icon in the off state, copied from the mod's assets<br />
<br />
There seems to be some really annoying error causing it to stay on the 16 x 16 size, it might just be caching.</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=File:Grid_Pocket_Computer.png&diff=6228File:Grid Pocket Computer.png2014-03-28T06:37:01Z<p>Oeed: uploaded a new version of &quot;File:Grid Pocket Computer.png&quot;: Reverted to version as of 06:20, 28 March 2014</p>
<hr />
<div>Pocket Computer icon in the off state, copied from the mod's assets</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=File:Grid_Pocket_Computer.png&diff=6227File:Grid Pocket Computer.png2014-03-28T06:34:20Z<p>Oeed: uploaded a new version of &quot;File:Grid Pocket Computer.png&quot;: Didn't seem to update to the resized file correctly</p>
<hr />
<div>Pocket Computer icon in the off state, copied from the mod's assets</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=File:Grid_Golden_Apple.png&diff=6226File:Grid Golden Apple.png2014-03-28T06:28:58Z<p>Oeed: Icon of a golden apple, copied from the Minecraft wiki</p>
<hr />
<div>Icon of a golden apple, copied from the Minecraft wiki</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=File:Grid_Pocket_Computer.png&diff=6225File:Grid Pocket Computer.png2014-03-28T06:20:27Z<p>Oeed: uploaded a new version of &quot;File:Grid Pocket Computer.png&quot;: Resized to 32 x 32</p>
<hr />
<div>Pocket Computer icon in the off state, copied from the mod's assets</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=File:Grid_Pocket_Computer.png&diff=6224File:Grid Pocket Computer.png2014-03-28T06:18:29Z<p>Oeed: Pocket Computer icon in the off state, copied from the mod's assets</p>
<hr />
<div>Pocket Computer icon in the off state, copied from the mod's assets</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Shell_(API)&diff=6221Shell (API)2014-03-28T06:02:04Z<p>Oeed: Added NeedsWork note</p>
<hr />
<div>{{NeedsWork|New 1.6 functions and changes should be added. - [[User:Oeed|Oeed]] 06:02, 28 March 2014 (GMT)}}<br />
<br />
The shell API allows you to interface with the [http://en.wikipedia.org/wiki/Shell_%28computing%29 shell].<br />
<br />
<table style="width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;"><br />
<tr><td colspan="2" style="font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;"><br />
[[File:Grid_disk.png|24px]]&nbsp;&nbsp;<br />
Shell (API)<br />
</td></tr><br />
<br />
<tr><td style="width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;">Method Name</td><td style="background: #E0E0E0; padding: .4em; font-weight:bold;">Description</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.exit]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Exits the current shell</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.dir]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the directory</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.setDir]]({{type|string}} path)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the directory</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.path]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the path</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.setPath]]({{type|string}} path)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the path</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.resolve]]({{type|string}} localpath)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Resolves a local path to an absolute path.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.resolveProgram]]({{type|string}} name)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Resolves the absolute path to the program whose name you provided.</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.aliases]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns aliases.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.setAlias]]({{type|string}} alias, {{type|string}} program)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets an alias.</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.clearAlias]]({{type|string}} alias)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Clears an alias.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.programs]]([<nowiki></nowiki>{{type|boolean}} hidden])</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns a {{type|table}} of programs.</td></tr><br />
<br />
<tr style="background-color: #E8E8E8;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.run]]({{type|string}} program, {{type|string}} arguments)</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Runs a program.</td></tr><br />
<br />
<tr style="background-color: #FFFFFF;"><td style="border-top: solid #C9C9C9 1px; padding: .4em;">[[shell.getRunningProgram]]()</td><br />
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the absolute path to the currently-executing program.</td></tr><br />
</table><br />
<br />
<br />
[[Category:APIs]]</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Fs_(API)&diff=6220Fs (API)2014-03-28T06:01:42Z<p>Oeed: Added NeedsWork note</p>
<hr />
<div>{{NeedsWork|New 1.6 functions and changes should be added. - [[User:Oeed|Oeed]] 06:01, 28 March 2014 (GMT)}}<br />
<br />
The FS API allows you to manipulate files and the filesystem.<br />
<br />
{{API table|FS|image=Grid_disk.png|2=<br />
<br />
{{API table/row|[[fs.list]]({{Type|string}} path)|{{type|table}} files|Returns a list of all the files (including subdirectories but not their contents) contained in a directory, as a numerically indexed table.|odd}}<br />
<br />
{{API table/row|[[fs.exists]]({{Type|string}} path)|{{Type|boolean}} exists|Checks if a path refers to an existing file or directory.|}}<br />
{{API table/row|[[fs.isDir]]({{Type|string}} path)|{{Type|boolean}} isdir|Checks if a path refers to an existing directory.|odd}}<br />
{{API table/row|[[fs.isReadOnly]]({{Type|string}} path)|{{Type|boolean}} readonly|Checks if a path is read-only (i.e. cannot be modified).|}}<br />
{{API table/row|[[fs.getName]]({{type|string}} path)|{{type|string}} name|Gets the final component of a pathname.|odd}}<br />
{{API table/row|[[fs.getDrive]]({{type|string}} path)|{{type|string}}/{{type|nil}} drive|Gets the storage medium holding a path, or [[nil]] if the path does not exist.|}}<br />
{{API table/row|[[fs.getSize]]({{Type|string}} path)|{{type|number}} size|Gets the size of a file in bytes.|odd}}<br />
{{API table/row|[[fs.getFreeSpace]]({{Type|string}} path)|{{type|number}} space|Gets the remaining space on the drive containing the given directory.|}}<br />
{{API table/row|[[fs.makeDir]]({{Type|string}} path)|{{type|nil}}|Makes a directory.|odd}}<br />
{{API table/row|[[fs.move]]({{Type|string}} fromPath, {{Type|string}} toPath)|{{type|nil}}|Moves a file or directory to a new location.|}}<br />
{{API table/row|[[fs.copy]]({{Type|string}} fromPath, {{Type|string}} toPath)|{{type|nil}}|Copies a file or directory to a new location.|odd}}<br />
{{API table/row|[[fs.delete]]({{Type|string}} path)|{{type|nil}}|Deletes a file or directory.|}}<br />
{{API table/row|[[fs.combine]]({{Type|string}} basePath, {{Type|string}} localPath)|{{type|string}} path|Combines two path components, returning a path consisting of the local path nested inside the base path.|odd}}<br />
{{API table/row|[[fs.open]]({{Type|string}} path, {{Type|string}} mode)|{{type|table}} handle|Opens a file so it can be read or written.|}}<br />
<br />
}}<br />
<br />
[[Category:APIs]]<br />
<br />
==Path Names==<br />
All of these functions except for [[fs.combine]] refer solely to <em>absolute paths</em>.<br /><br />
This means that the current working directory, as set by the <code>cd</code> command or the [[shell.setDir]] function, is ignored. Each path name consists of a list of nonempty path components separated by forward slashes, and those path components are taken one by one with the first being contained in the root directory of the computer.<br />
<br />
If you need to deal with paths provided by the user that may be absolute or may be relative to the current working directory, use [[shell.resolve]].<br />
<br />
Unlike most real-world operating systems, ComputerCraft's absolute path name system does not need to be started with a forward slash ( / ), making the directory "a/b/c" the same as "/a/b/c". Leaving the slashes is just a matter of preference to the coder.</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Multishell&diff=6219Multishell2014-03-28T06:00:27Z<p>Oeed: Created multishell API page</p>
<hr />
<div>{{NeedsWork|This page should be created ASAP. - [[User:Oeed|Oeed]] 06:00, 28 March 2014 (GMT)}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Window_(API)&diff=6218Window (API)2014-03-28T05:59:47Z<p>Oeed: Created window API page.</p>
<hr />
<div>{{NeedsWork|This page should be created ASAP. - [[User:Oeed|Oeed]] 05:59, 28 March 2014 (GMT)}}</div>Oeedhttp://www.computercraft.info/wiki/index.php?title=Term_(API)&diff=6217Term (API)2014-03-28T05:58:48Z<p>Oeed: Added NeedsWork note</p>
<hr />
<div>{{NeedsWork|New 1.6 functions and changes should be added. - [[User:Oeed|Oeed]] 05:58, 28 March 2014 (GMT)}}<br />
<br />
The Terminal API provides functions for writing text to the terminal and monitors, and drawing ASCII graphics.<br />
<br />
Methods in ''italics'' are available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor|Advanced Monitors]].<br />
Methods in '''bold''' are available only to [[Monitor|Monitors]].<br />
<br />
{{API table|Term|image=Grid disk.png|2=<br />
<br />
{{API table/row|[[term.write]]({{type|string}} text)|{{type|nil}}<br />
|Writes ''text'' to the screen.|odd}}<br />
<br />
{{API table/row|[[term.clear]]()|{{type|nil}}<br />
|Clears the entire screen}}<br />
<br />
{{API table/row|[[term.clearLine]]()|{{type|nil}}<br />
|Clears the line the cursor is on|odd}}<br />
<br />
{{API table/row|[[term.getCursorPos]]()|{{type|number}} x, {{type|number}} y<br />
|Returns two arguments containing the x and the y position of the cursor.}}<br />
<br />
{{API table/row|[[term.setCursorPos]]({{type|number}} x, {{type|number}} y)|{{type|nil}}<br />
|Sets the cursor's position.|odd}}<br />
<br />
{{API table/row|[[term.setCursorBlink]]({{type|boolean}} bool)|{{type|nil}}<br />
|Disables the blinking or turns it on.}}<br />
<br />
{{API table/row|[[term.isColor]]()|{{type|boolean}}<br />
|Returns if the computer supports color. (Used to determine whether or not an [[Advanced Computer]] is being used)|odd}}<br />
<br />
{{API table/row|[[term.getSize]]()|{{type|number}} x, {{type|number}} y<br />
|Returns two arguments containing the x and the y values stating the size of the screen. (Good for if you're making something to be compatible with both [[Turtle]]s and [[Computer]]s.)}}<br />
<br />
{{API table/row|[[term.scroll]]({{type|number}} n)|{{type|nil}}<br />
|Scrolls the terminal ''n'' lines.|odd}}<br />
<br />
{{API table/row|[[term.redirect]](target)|{{type|nil}}<br />
|Redirects terminal output to a monitor or other redirect target. (Use [[peripheral.wrap]] to acquire a monitor "object".)}}<br />
<br />
{{API table/row|[[term.restore]]()|{{type|nil}}<br />
|Restores terminal output to the previous target.|odd}}<br />
<br />
{{API table/row|''[[term.setTextColor]]({{type|number}} [[Colors (API)|color]])''|{{type|nil}}<br />
|Sets the text color of the terminal. Available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor]]s.}}<br />
<br />
{{API table/row|''[[term.setBackgroundColor]]({{type|number}} [[Colors (API)#Colors|color]])''|{{type|nil}}<br />
|Sets the background color of the terminal. Available only to [[Advanced Computer|Advanced Computers]] and [[Advanced Monitor]]s.|odd}}<br />
<br />
{{API table/row|'''[[monitor.setTextScale]]({{type|number}} scale)'''|{{type|nil}}<br />
|Sets the text scale on a [[Monitor]].}}<br />
<br />
}}<br />
<br />
[[Category:APIs]]</div>Oeed