<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.computercraft.info/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chainmanner</id>
		<title>ComputerCraft Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://www.computercraft.info/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chainmanner"/>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/Special:Contributions/Chainmanner"/>
		<updated>2026-07-11T09:13:35Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Fs_(API)&amp;diff=6058</id>
		<title>Fs (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Fs_(API)&amp;diff=6058"/>
				<updated>2013-11-14T17:33:58Z</updated>
		
		<summary type="html">&lt;p&gt;Chainmanner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The FS API allows you to manipulate files and the filesystem.&lt;br /&gt;
&lt;br /&gt;
{{API table|FS|image=Grid_disk.png|2=&lt;br /&gt;
&lt;br /&gt;
{{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}}&lt;br /&gt;
&lt;br /&gt;
{{API table/row|[[fs.exists]]({{Type|string}} path)|{{Type|boolean}} exists|Checks if a path refers to an existing file or directory.|}}&lt;br /&gt;
{{API table/row|[[fs.isDir]]({{Type|string}} path)|{{Type|boolean}} isdir|Checks if a path refers to an existing directory.|odd}}&lt;br /&gt;
{{API table/row|[[fs.isReadOnly]]({{Type|string}} path)|{{Type|boolean}} readonly|Checks if a path is read-only (i.e. cannot be modified).|}}&lt;br /&gt;
{{API table/row|[[fs.getName]]({{type|string}} path)|{{type|string}} name|Gets the final component of a pathname.|odd}}&lt;br /&gt;
{{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.|}}&lt;br /&gt;
{{API table/row|[[fs.getSize]]({{Type|string}} path)|{{type|number}} size|Gets the size of a file in bytes.|odd}}&lt;br /&gt;
{{API table/row|[[fs.getFreeSpace]]({{Type|string}} path)|{{type|number}} space|Gets the remaining space on the drive containing the given directory.|}}&lt;br /&gt;
{{API table/row|[[fs.makeDir]]({{Type|string}} path)|{{type|nil}}|Makes a directory.|odd}}&lt;br /&gt;
{{API table/row|[[fs.move]]({{Type|string}} fromPath, {{Type|string}} toPath)|{{type|nil}}|Moves a file or directory to a new location.|}}&lt;br /&gt;
{{API table/row|[[fs.copy]]({{Type|string}} fromPath, {{Type|string}} toPath)|{{type|nil}}|Copies a file or directory to a new location.|odd}}&lt;br /&gt;
{{API table/row|[[fs.delete]]({{Type|string}} path)|{{type|nil}}|Deletes a file or directory.|}}&lt;br /&gt;
{{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}}&lt;br /&gt;
{{API table/row|[[fs.open]]({{Type|string}} path, {{Type|string}} mode)|{{type|table}} handle|Opens a file so it can be read or written.|}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;br /&gt;
&lt;br /&gt;
==Path Names==&lt;br /&gt;
All of these functions except for [[fs.combine]] refer solely to &amp;lt;em&amp;gt;absolute paths&amp;lt;/em&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
This means that the current working directory, as set by the &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;a/b/c&amp;quot; the same as &amp;quot;/a/b/c&amp;quot;. Leaving the slashes is just a matter of preference to the coder.&lt;/div&gt;</summary>
		<author><name>Chainmanner</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Rednet_(API)&amp;diff=6007</id>
		<title>Rednet (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Rednet_(API)&amp;diff=6007"/>
				<updated>2013-09-21T11:25:19Z</updated>
		
		<summary type="html">&lt;p&gt;Chainmanner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{msgbox&lt;br /&gt;
|title=Please Note&lt;br /&gt;
|text=Rednet no longer supports transmitting data through Bundled Cables. However, interacting with Bundled Cables is still available via the [[Redstone_(API)|Redstone API]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The Rednet API allows computers to communicate between themselves without using redstone wires. In order to send and receive data, a [[modem]] is required. The data is received immediately after sending it, but only by computers within a certain range. That range depends on the altitude of the sending computer increasing with higher altitudes to a max of 384.&lt;br /&gt;
'''NOTE:''' The distance variable that is sent/received through the Rednet API is based off of the computer location, not the modem location. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;2&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Rednet (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.open]]({{type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Tells the computer that the side can be used for networking.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.close]]({{type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Tells the computer that the side can no longer be used for networking.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.announce]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Broadcasts an empty rednet message.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.send]]({{type|number}} receiverID, {{type|string}} message)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends a message to the computer using the opened sides. The receiver ID is the ID (number, not string) of the computer you're sending the message to. ID as nil will do the same as a broadcast. The message must be a string to send across rednet, if you are wanting to send a table see [[textutils.serialize]]&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.broadcast]]({{type|string}} message)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends the message to ALL connected and open computers.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.receive]]({{type|number}} timeout)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Waits until it received a rednet message or &amp;lt;var&amp;gt;timeout&amp;lt;/var&amp;gt; has passed. Leave args empty to wait for a message forever.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.isOpen]]({{type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns true if the wireless modem is open.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Event Name&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Description&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Parameters&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | rednet_message&lt;br /&gt;
|Fired when a rednet message is received (can be used as alternative for rednet.receive())&lt;br /&gt;
|{{type|number}} senderId, {{type|string}} message, {{type|number}} distance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
Before the creation of the in-game wireless networking API, the term &amp;quot;Rednet&amp;quot; referred to a system created by one of the ComputerCraft users based on bundled cables from a popular Minecraft mod - RedPower. It also allowed communication between computers, but the data was transferred slowly - every bit was converted to redstone signal, that lasted about 0,05 seconds. On the release of ComputerCraft 1.3, the system became useless, as the wireless networking was officially implemented to the mod.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
'''ID Whitelists are useless, and messages sent by Rednet can be viewed by anyone, even if they are not the target computer.'''&lt;br /&gt;
&lt;br /&gt;
Rednet alone is completely insecure. Any messages sent via rednet can actually be sniffed, contrary to popular belief, and people can pretend to be a certain computer and fool rednet easily. &lt;br /&gt;
&lt;br /&gt;
Rednet simply utilizes the Modem API. A user can easily sniff and find out what messages a computer is receiving if he knows its ID. All he has to do is use the [[Modem_(API)|Modem API]] to listen, where the channel to listen on is the target computer's ID. Additionally, a malicious user can 'pretend' to be a certain computer by using the Modem API to send a message to the target computer's ID with the message, but using the ID of the computer to pretend to be for the reply channel parameter. If they do so, the computer receiving the message with rednet will be fooled into thinking it came from a different computer.&lt;br /&gt;
&lt;br /&gt;
When using rednet for anything with security critical, be sure to implement your own security measures.&lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
'''Overview''': Rednet functions by having a modem listen on the channel of the computer's ID, and the rednet broadcast channel for messages. It uses the ''replyChannel'' parameter of the modem_message event as the sender computer's ID. It broadcasts by sending a simple modem message on the rednet broadcast channel, and receives by receiving a modem message on the broadcast channel or the channel of its computer's ID. &lt;br /&gt;
&lt;br /&gt;
'''CHANNEL_BROADCAST''': 65535&lt;br /&gt;
&lt;br /&gt;
(local) '''tValidSides''': Contains valid values of strings containing computer sides, used by ''open'' and ''close''&lt;br /&gt;
&lt;br /&gt;
'''rednet.open(sSide)''': Checks if ''sSide'' is a string, a valid side, and a side with a modem on it. Then it opens the modem on ''CHANNEL_BROADCAST'' and ''os.getComputerID()''&lt;br /&gt;
&lt;br /&gt;
'''rednet.close(sSide)''': Checks if ''sSide'' is a string, a valid side, and a side with a modem on it. Then it closes the modem on ''CHANNEL_BROADCAST'' and ''os.getComputerID()''&lt;br /&gt;
&lt;br /&gt;
'''rednet.isOpen(sSide)''': Checks if ''sSide'' is a string, a valid side, and a side with a modem on it. Then it returns true if the modem on ''sSide'' is open on both ''CHANNEL_BROADCAST'' and ''os.getComputerID()''&lt;br /&gt;
&lt;br /&gt;
'''rednet.send(nRecipient, sMessage)''': For each side ''sSide'' in ''rs.getSides()'', it calls ''isOpen(sSide)''. If the result is true, it executes&lt;br /&gt;
 peripheral.call( sSide, &amp;quot;transmit&amp;quot;, nRecipient, os.getComputerID(), sMessage )&lt;br /&gt;
&lt;br /&gt;
'''rednet.broadcast(sMessage)''': Calls ''send(CHANNEL_BROADCAST, sMessage)''&lt;br /&gt;
&lt;br /&gt;
'''rednet.receive(nTimeout)''': If ''nTimeout'' is there, it starts a timer for ''nTimeout'' seconds-stored in ''timer'', and sets ''sFilter'' to nil. Otherwise, ''sFilter'' is set to &amp;quot;rednet_message&amp;quot;. In a loop, &lt;br /&gt;
 local e, p1, p2, p3, p4, p5 = os.pullEvent( sFilter )&lt;br /&gt;
is called. If ''e'' is &amp;quot;rednet_message&amp;quot; then it returns ''p1'', ''p2'', and ''p3'', but if ''e'' is &amp;quot;timer&amp;quot;, and ''p1'' is ''timer'' then it returns nil.&lt;br /&gt;
&lt;br /&gt;
(local) '''bRunning''': false&lt;br /&gt;
&lt;br /&gt;
'''rednet.run()''': If ''bRunning'' is true, then it errors &amp;quot;rednet is already running&amp;quot;. It then sets ''bRunning'' to true to indicate that it is running. Looping while ''bRunning'', it pulls&lt;br /&gt;
 local sEvent, sSide, sChannel, sReplyChannel, sMessage, nDistance = os.pullEventRaw( &amp;quot;modem_message&amp;quot; )&lt;br /&gt;
Then if ''sEvent'' is &amp;quot;modem_message&amp;quot;, ''isOpen(sSide)'' is true, and ''sChannel'' is ''os.getComputerID()'' or it is ''CHANNEL_BROADCAST'', then it queues &lt;br /&gt;
 os.queueEvent( &amp;quot;rednet_message&amp;quot;, sReplyChannel, sMessage, nDistance )&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Chainmanner</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Modem_(API)&amp;diff=6006</id>
		<title>Modem (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Modem_(API)&amp;diff=6006"/>
				<updated>2013-09-21T11:24:11Z</updated>
		
		<summary type="html">&lt;p&gt;Chainmanner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;:''This page is for the modem API. For the blocks, see [[Modem]].''&lt;br /&gt;
&lt;br /&gt;
Modem channels are essentially networks which can be opened, closed and listened on by any computer within range, without need of independant computer IDs. To interact with channels, one must wrap or interact directly with the peripheral as opposed to the previous interaction with the Rednet API.&lt;br /&gt;
&lt;br /&gt;
'''There is not an actual API called &amp;quot;modem&amp;quot;. This is the API for wrapped modem peripherals.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;2&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Modem (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.isOpen]]({{type|int}} channel)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Checks to see if ''channel'' is open&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.open]]({{type|int}} channel)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Opens ''channel'' to allow for listening. The channel specified must be larger than 0 and less than 65535&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.close]]({{type|int}} channel)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Closes an open channel to disallow listening&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.closeAll]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Closes all open channels&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.transmit]]({{type|int}} channel, {{type|int}} replyChannel, {{type|string}} message)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Transmits a message on the specified channel&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.isWireless]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns true if the modem is wireless; false if it is wired&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Event Name&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Description&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Parameters&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | modem_message&lt;br /&gt;
|Fired when a modem message is received.&lt;br /&gt;
|{{type|string}} modemSide, {{type|int}} senderChannel, {{type|int}} replyChannel, {{type|string}} message, {{type|number}} distance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Sending Messages==&lt;br /&gt;
Sending messages is simple and does not require that you open any channels. Simply use the transmit function like so:&lt;br /&gt;
 local modem = peripheral.wrap(&amp;quot;right&amp;quot;) --Wraps the modem on the right side.&lt;br /&gt;
 modem.transmit(3, 1, &amp;quot;Hello world!&amp;quot;)  &lt;br /&gt;
 peripheral.call(&amp;quot;right&amp;quot;, &amp;quot;transmit&amp;quot;, 3, 1, &amp;quot;This will also work!&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
What did that do? First I wrapped the peripheral in order to interact with it. Second, I used modem.transmit(channel, replyChannel, message) in order to send my message. In case you were wondering, the reply channel is captured by the listening computer and suggests which channel they should reply on.&lt;br /&gt;
&lt;br /&gt;
==Receiving Messages==&lt;br /&gt;
Receiving messages requires that you be familiar with events. As of this moment, there is no API which cuts out events from the process. Here is an example of how to receive messages:&lt;br /&gt;
 local modem = peripheral.wrap(&amp;quot;left&amp;quot;)&lt;br /&gt;
 modem.open(3)--Open channel 3 so that we can listen on it&lt;br /&gt;
 local event, modemSide, senderChannel, &lt;br /&gt;
   replyChannel, message, senderDistance = os.pullEvent(&amp;quot;modem_message&amp;quot;)&lt;br /&gt;
 print(&amp;quot;I just received a message from: &amp;quot;..senderChannel)&lt;br /&gt;
 print(&amp;quot;I should apparently reply on: &amp;quot;..replyChannel)&lt;br /&gt;
 print(&amp;quot;The modem receiving this is located on the &amp;quot;..modemSide..&amp;quot; side&amp;quot;)&lt;br /&gt;
 print(&amp;quot;The message was: &amp;quot;..message)&lt;br /&gt;
 print(&amp;quot;The sender is: &amp;quot;..senderDistance..&amp;quot; blocks away from me.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
So what did I do? Quite simply, I called os.pullEvent() with the string argument &amp;quot;modem_message&amp;quot;, which blocks all other events from being returned. When the &amp;quot;modem_message&amp;quot; event is captured, it returns the arguments: event, modemSide, senderChannel, replyChannel, message, senderDistance. I captured these and then printed them out.&lt;br /&gt;
&lt;br /&gt;
== Modem Limitations ==&lt;br /&gt;
* You can only open 128 channels at any given time.&lt;br /&gt;
* The maximum channel you can open is 65535.&lt;br /&gt;
* You can listen on more than one channel at a time. For example, if the modem has channel 3 and channel 5 open, and somebody sends a message on channel 5, the modem will receive it. If a message is sent on channel 3, the modem will also receive the message.&lt;br /&gt;
* Sending messages does not require you to open any channels prior to sending it.&lt;br /&gt;
* If you aren't receiving a message when you think you should, check to make sure that you have opened the channel first.&lt;br /&gt;
* Modems and channels are not secure - if you are sending a message using the Modem API, messages are still available to any computer listening on the sent channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Peripheral APIs]]&lt;/div&gt;</summary>
		<author><name>Chainmanner</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Rednet_(API)&amp;diff=6005</id>
		<title>Rednet (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Rednet_(API)&amp;diff=6005"/>
				<updated>2013-09-21T11:23:21Z</updated>
		
		<summary type="html">&lt;p&gt;Chainmanner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{msgbox&lt;br /&gt;
|title=Please Note&lt;br /&gt;
|text=Rednet no longer supports&amp;lt;br&amp;gt;transmitting data through Bundled Cables. However, interacting with Bundled Cables is still available via the [[Redstone_(API)|Redstone API]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The Rednet API allows computers to communicate between themselves without using redstone wires. In order to send and receive data, a [[modem]] is required. The data is received immediately after sending it, but only by computers within a certain range. That range depends on the altitude of the sending computer increasing with higher altitudes to a max of 384.&lt;br /&gt;
'''NOTE:''' The distance variable that is sent/received through the Rednet API is based off of the computer location, not the modem location. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;2&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Rednet (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.open]]({{type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Tells the computer that the side can be used for networking.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.close]]({{type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Tells the computer that the side can no longer be used for networking.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.announce]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Broadcasts an empty rednet message.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.send]]({{type|number}} receiverID, {{type|string}} message)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends a message to the computer using the opened sides. The receiver ID is the ID (number, not string) of the computer you're sending the message to. ID as nil will do the same as a broadcast. The message must be a string to send across rednet, if you are wanting to send a table see [[textutils.serialize]]&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.broadcast]]({{type|string}} message)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends the message to ALL connected and open computers.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.receive]]({{type|number}} timeout)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Waits until it received a rednet message or &amp;lt;var&amp;gt;timeout&amp;lt;/var&amp;gt; has passed. Leave args empty to wait for a message forever.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.isOpen]]({{type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns true if the wireless modem is open.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Event Name&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Description&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Parameters&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | rednet_message&lt;br /&gt;
|Fired when a rednet message is received (can be used as alternative for rednet.receive())&lt;br /&gt;
|{{type|number}} senderId, {{type|string}} message, {{type|number}} distance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
Before the creation of the in-game wireless networking API, the term &amp;quot;Rednet&amp;quot; referred to a system created by one of the ComputerCraft users based on bundled cables from a popular Minecraft mod - RedPower. It also allowed communication between computers, but the data was transferred slowly - every bit was converted to redstone signal, that lasted about 0,05 seconds. On the release of ComputerCraft 1.3, the system became useless, as the wireless networking was officially implemented to the mod.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
'''ID Whitelists are useless, and messages sent by Rednet can be viewed by anyone, even if they are not the target computer.'''&lt;br /&gt;
&lt;br /&gt;
Rednet alone is completely insecure. Any messages sent via rednet can actually be sniffed, contrary to popular belief, and people can pretend to be a certain computer and fool rednet easily. &lt;br /&gt;
&lt;br /&gt;
Rednet simply utilizes the Modem API. A user can easily sniff and find out what messages a computer is receiving if he knows its ID. All he has to do is use the [[Modem_(API)|Modem API]] to listen, where the channel to listen on is the target computer's ID. Additionally, a malicious user can 'pretend' to be a certain computer by using the Modem API to send a message to the target computer's ID with the message, but using the ID of the computer to pretend to be for the reply channel parameter. If they do so, the computer receiving the message with rednet will be fooled into thinking it came from a different computer.&lt;br /&gt;
&lt;br /&gt;
When using rednet for anything with security critical, be sure to implement your own security measures.&lt;br /&gt;
&lt;br /&gt;
== Technical Details ==&lt;br /&gt;
'''Overview''': Rednet functions by having a modem listen on the channel of the computer's ID, and the rednet broadcast channel for messages. It uses the ''replyChannel'' parameter of the modem_message event as the sender computer's ID. It broadcasts by sending a simple modem message on the rednet broadcast channel, and receives by receiving a modem message on the broadcast channel or the channel of its computer's ID. &lt;br /&gt;
&lt;br /&gt;
'''CHANNEL_BROADCAST''': 65535&lt;br /&gt;
&lt;br /&gt;
(local) '''tValidSides''': Contains valid values of strings containing computer sides, used by ''open'' and ''close''&lt;br /&gt;
&lt;br /&gt;
'''rednet.open(sSide)''': Checks if ''sSide'' is a string, a valid side, and a side with a modem on it. Then it opens the modem on ''CHANNEL_BROADCAST'' and ''os.getComputerID()''&lt;br /&gt;
&lt;br /&gt;
'''rednet.close(sSide)''': Checks if ''sSide'' is a string, a valid side, and a side with a modem on it. Then it closes the modem on ''CHANNEL_BROADCAST'' and ''os.getComputerID()''&lt;br /&gt;
&lt;br /&gt;
'''rednet.isOpen(sSide)''': Checks if ''sSide'' is a string, a valid side, and a side with a modem on it. Then it returns true if the modem on ''sSide'' is open on both ''CHANNEL_BROADCAST'' and ''os.getComputerID()''&lt;br /&gt;
&lt;br /&gt;
'''rednet.send(nRecipient, sMessage)''': For each side ''sSide'' in ''rs.getSides()'', it calls ''isOpen(sSide)''. If the result is true, it executes&lt;br /&gt;
 peripheral.call( sSide, &amp;quot;transmit&amp;quot;, nRecipient, os.getComputerID(), sMessage )&lt;br /&gt;
&lt;br /&gt;
'''rednet.broadcast(sMessage)''': Calls ''send(CHANNEL_BROADCAST, sMessage)''&lt;br /&gt;
&lt;br /&gt;
'''rednet.receive(nTimeout)''': If ''nTimeout'' is there, it starts a timer for ''nTimeout'' seconds-stored in ''timer'', and sets ''sFilter'' to nil. Otherwise, ''sFilter'' is set to &amp;quot;rednet_message&amp;quot;. In a loop, &lt;br /&gt;
 local e, p1, p2, p3, p4, p5 = os.pullEvent( sFilter )&lt;br /&gt;
is called. If ''e'' is &amp;quot;rednet_message&amp;quot; then it returns ''p1'', ''p2'', and ''p3'', but if ''e'' is &amp;quot;timer&amp;quot;, and ''p1'' is ''timer'' then it returns nil.&lt;br /&gt;
&lt;br /&gt;
(local) '''bRunning''': false&lt;br /&gt;
&lt;br /&gt;
'''rednet.run()''': If ''bRunning'' is true, then it errors &amp;quot;rednet is already running&amp;quot;. It then sets ''bRunning'' to true to indicate that it is running. Looping while ''bRunning'', it pulls&lt;br /&gt;
 local sEvent, sSide, sChannel, sReplyChannel, sMessage, nDistance = os.pullEventRaw( &amp;quot;modem_message&amp;quot; )&lt;br /&gt;
Then if ''sEvent'' is &amp;quot;modem_message&amp;quot;, ''isOpen(sSide)'' is true, and ''sChannel'' is ''os.getComputerID()'' or it is ''CHANNEL_BROADCAST'', then it queues &lt;br /&gt;
 os.queueEvent( &amp;quot;rednet_message&amp;quot;, sReplyChannel, sMessage, nDistance )&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Chainmanner</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Modem.isOpen&amp;diff=5759</id>
		<title>Modem.isOpen</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Modem.isOpen&amp;diff=5759"/>
				<updated>2013-06-08T16:47:17Z</updated>
		
		<summary type="html">&lt;p&gt;Chainmanner: Created page with &amp;quot;{{Function |name=modem.isOpen |args=int channel |api=Modem |addon=ComputerCraft |desc=Checks whether or not a certain channel is open.  |examples= {{Example |de...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Function&lt;br /&gt;
|name=modem.isOpen&lt;br /&gt;
|args=[[Int (type)|int]] channel&lt;br /&gt;
|api=Modem&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=Checks whether or not a certain channel is open. &lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Checks whether the computer is listening on this channel. &lt;br /&gt;
|code=modem.isOpen(1)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Chainmanner</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Modem_(API)&amp;diff=5758</id>
		<title>Modem (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Modem_(API)&amp;diff=5758"/>
				<updated>2013-06-08T16:36:14Z</updated>
		
		<summary type="html">&lt;p&gt;Chainmanner: /* Modem Limitations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedsWork|Need to add pages for missing functions --[[User:Cranium|Cranium]] 17:13, 10 May 2013 (MSK)}}&lt;br /&gt;
&lt;br /&gt;
:''This page is for the modem API. For the blocks, see [[Modem]].''&lt;br /&gt;
&lt;br /&gt;
As of ComputerCraft 1.5, channels have been added - channels are essentially networks which can be opened, closed and listened on by any computer within range, without need of independant computer IDs. To interact with channels, one must wrap or interact directly with the peripheral as opposed to the previous interaction with the Rednet API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;2&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Modem (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.isOpen]]({{type|int}} channel)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Checks to see if ''channel'' is open&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.open]]({{type|int}} channel)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Opens ''channel'' to allow for listening. The channel specified must be larger than 0 and less than 65535&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.close]]({{type|int}} channel)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Closes an open channel to disallow listening&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.closeAll]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Closes all open channels&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.transmit]]({{type|int}} channel, {{type|int}} replyChannel, {{type|string}} message)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Transmits a message on the specified channel&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.isWireless]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns true if the modem is wireless; false if it is wired&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sending Messages==&lt;br /&gt;
Sending messages is simple and does not require that you open any channels. Simply use the transmit function like so:&lt;br /&gt;
 local modem = peripheral.wrap(&amp;quot;right&amp;quot;) --Wraps the modem on the right side.&lt;br /&gt;
 modem.transmit(3, 1, &amp;quot;Hello world!&amp;quot;)  &lt;br /&gt;
 peripheral.call(&amp;quot;right&amp;quot;, &amp;quot;transmit&amp;quot;, 3, 1, &amp;quot;This will also work!&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
What did that do? First I wrapped the peripheral in order to interact with it. Second, I used modem.transmit(channel, replyChannel, message) in order to send my message. In case you were wondering, the reply channel is captured by the listening computer and suggests which channel they should reply on.&lt;br /&gt;
&lt;br /&gt;
==Receiving Messages==&lt;br /&gt;
Receiving messages requires that you be familiar with events. As of this moment, there is no API which cuts out events from the process. Here is an example of how to receive messages:&lt;br /&gt;
 local modem = peripheral.wrap(&amp;quot;left&amp;quot;)&lt;br /&gt;
 modem.open(3)--Open channel 3 so that we can listen on it&lt;br /&gt;
 local event, modemSide, senderChannel, &lt;br /&gt;
   replyChannel, message, senderDistance = os.pullEvent(&amp;quot;modem_message&amp;quot;)&lt;br /&gt;
 print(&amp;quot;I just received a message from: &amp;quot;..senderChannel)&lt;br /&gt;
 print(&amp;quot;I should apparently reply on: &amp;quot;..replyChannel)&lt;br /&gt;
 print(&amp;quot;The modem receiving this is located on the &amp;quot;..modemSide..&amp;quot; side&amp;quot;)&lt;br /&gt;
 print(&amp;quot;The message was: &amp;quot;..message)&lt;br /&gt;
 print(&amp;quot;The sender is: &amp;quot;..senderDistance..&amp;quot; blocks away from me.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
So what did I do? Quite simply, I called os.pullEvent() with the string argument &amp;quot;modem_message&amp;quot;, which blocks all other events from being returned. When the &amp;quot;modem_message&amp;quot; event is captured, it returns the arguments: event, modemSide, senderChannel, replyChannel, message, senderDistance. I captured these and then printed them out.&lt;br /&gt;
&lt;br /&gt;
== Modem Limitations ==&lt;br /&gt;
* You can only open 128 channels at any given time.&lt;br /&gt;
* The maximum channel you can open is 65535.&lt;br /&gt;
* You can listen on more than one channel at a time. For example, if the modem has channel 3 and channel 5 open, and somebody sends a message on channel 5, the modem will receive it. If a message is sent on channel 3, the modem will also receive the message.&lt;br /&gt;
* Sending messages does not require you to open any channels prior to sending it.&lt;br /&gt;
* If you aren't receiving a message when you think you should, check to make sure that you have opened the channel first.&lt;br /&gt;
* Modems and channels are not secure - if you are sending a message using the Modem API, messages are still available to any computer listening on the sent channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Peripheral APIs]]&lt;/div&gt;</summary>
		<author><name>Chainmanner</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Modem_(API)&amp;diff=5757</id>
		<title>Modem (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Modem_(API)&amp;diff=5757"/>
				<updated>2013-06-08T16:35:41Z</updated>
		
		<summary type="html">&lt;p&gt;Chainmanner: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedsWork|Need to add pages for missing functions --[[User:Cranium|Cranium]] 17:13, 10 May 2013 (MSK)}}&lt;br /&gt;
&lt;br /&gt;
:''This page is for the modem API. For the blocks, see [[Modem]].''&lt;br /&gt;
&lt;br /&gt;
As of ComputerCraft 1.5, channels have been added - channels are essentially networks which can be opened, closed and listened on by any computer within range, without need of independant computer IDs. To interact with channels, one must wrap or interact directly with the peripheral as opposed to the previous interaction with the Rednet API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;2&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Modem (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.isOpen]]({{type|int}} channel)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Checks to see if ''channel'' is open&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.open]]({{type|int}} channel)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Opens ''channel'' to allow for listening. The channel specified must be larger than 0 and less than 65535&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.close]]({{type|int}} channel)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Closes an open channel to disallow listening&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.closeAll]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Closes all open channels&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.transmit]]({{type|int}} channel, {{type|int}} replyChannel, {{type|string}} message)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Transmits a message on the specified channel&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[modem.isWireless]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns true if the modem is wireless; false if it is wired&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sending Messages==&lt;br /&gt;
Sending messages is simple and does not require that you open any channels. Simply use the transmit function like so:&lt;br /&gt;
 local modem = peripheral.wrap(&amp;quot;right&amp;quot;) --Wraps the modem on the right side.&lt;br /&gt;
 modem.transmit(3, 1, &amp;quot;Hello world!&amp;quot;)  &lt;br /&gt;
 peripheral.call(&amp;quot;right&amp;quot;, &amp;quot;transmit&amp;quot;, 3, 1, &amp;quot;This will also work!&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
What did that do? First I wrapped the peripheral in order to interact with it. Second, I used modem.transmit(channel, replyChannel, message) in order to send my message. In case you were wondering, the reply channel is captured by the listening computer and suggests which channel they should reply on.&lt;br /&gt;
&lt;br /&gt;
==Receiving Messages==&lt;br /&gt;
Receiving messages requires that you be familiar with events. As of this moment, there is no API which cuts out events from the process. Here is an example of how to receive messages:&lt;br /&gt;
 local modem = peripheral.wrap(&amp;quot;left&amp;quot;)&lt;br /&gt;
 modem.open(3)--Open channel 3 so that we can listen on it&lt;br /&gt;
 local event, modemSide, senderChannel, &lt;br /&gt;
   replyChannel, message, senderDistance = os.pullEvent(&amp;quot;modem_message&amp;quot;)&lt;br /&gt;
 print(&amp;quot;I just received a message from: &amp;quot;..senderChannel)&lt;br /&gt;
 print(&amp;quot;I should apparently reply on: &amp;quot;..replyChannel)&lt;br /&gt;
 print(&amp;quot;The modem receiving this is located on the &amp;quot;..modemSide..&amp;quot; side&amp;quot;)&lt;br /&gt;
 print(&amp;quot;The message was: &amp;quot;..message)&lt;br /&gt;
 print(&amp;quot;The sender is: &amp;quot;..senderDistance..&amp;quot; blocks away from me.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
So what did I do? Quite simply, I called os.pullEvent() with the string argument &amp;quot;modem_message&amp;quot;, which blocks all other events from being returned. When the &amp;quot;modem_message&amp;quot; event is captured, it returns the arguments: event, modemSide, senderChannel, replyChannel, message, senderDistance. I captured these and then printed them out.&lt;br /&gt;
&lt;br /&gt;
== Modem Limitations ==&lt;br /&gt;
* You can only open 128 channels at any given time.&lt;br /&gt;
* The maximum channel you can open is 65535.&lt;br /&gt;
* You can listen on more than one channel at a time. For example, if the modem has channel 3 and channel 5 open, and somebody sends a message on channel 5, the modem will receive it. If a message is sent on channel 3, the modem will also receive the message.&lt;br /&gt;
* Sending messages does not require you to open any channels prior to sending it.&lt;br /&gt;
* If you aren't receiving a message when you think you should, check to make sure that you have opened the channel first.&lt;br /&gt;
* Modems and channels are not secure - if you are sending a message using the Rednet API, messages are still available to any computer listening on the sent channel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Peripheral APIs]]&lt;/div&gt;</summary>
		<author><name>Chainmanner</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Rednet_(API)&amp;diff=5756</id>
		<title>Rednet (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Rednet_(API)&amp;diff=5756"/>
				<updated>2013-06-08T16:34:29Z</updated>
		
		<summary type="html">&lt;p&gt;Chainmanner: Removed biased information in the message box.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{msgbox&lt;br /&gt;
|title=Please Note&lt;br /&gt;
|text=As of ComputerCraft 1.5, [[Modem_(API)|channels]] have been added, and no longer supports&amp;lt;br&amp;gt;transmitting data through Bundled Cables. However interacting with Bundled Cables is still available via the [[Redstone_(API)|Redstone API]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The Rednet API allows computers to communicate between themselves without using redstone wires. In order to send and receive data, a [[modem]] is required. The data is received immediately after sending it, but only by computers within a certain range. That range depends on the altitude of the sending computer increasing with higher altitudes to a max of 384.&lt;br /&gt;
'''NOTE:''' The distance variable that is sent/received through the Rednet API is based off of the computer location, not the modem location. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table style=&amp;quot;width: 100%; border: solid 1px black; margin: 2px; border-spacing: 0px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td colspan=&amp;quot;2&amp;quot; style=&amp;quot;font-weight: bold; font-size: large; padding-bottom: .3em; border-bottom: solid #C9C9C9 1px; background: #D3FFC2; line-height:28px;&amp;quot;&amp;gt;&lt;br /&gt;
[[File:Grid_disk.png|24px]]&amp;amp;nbsp;&amp;amp;nbsp;&lt;br /&gt;
Rednet (API)&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td style=&amp;quot;width: 350px; background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Method Name&amp;lt;/td&amp;gt;&amp;lt;td style=&amp;quot;background: #E0E0E0; padding: .4em; font-weight:bold;&amp;quot;&amp;gt;Description&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.open]]({{type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Tells the computer that the side can be used for networking.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.close]]({{type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Tells the computer that the side can no longer be used for networking.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.announce]]()&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Broadcasts an empty rednet message.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.send]]({{type|number}} receiverID, {{type|string}} message)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends a message to the computer using the opened sides. The receiver ID is the ID (number, not string) of the computer you're sending the message to. ID as nil will do the same as a broadcast. The message must be a string to send across rednet, if you are wanting to send a table see [[textutils.serialize]]&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.broadcast]]({{type|string}} message)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Sends the message to ALL connected and open computers.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #E8E8E8;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.receive]]({{type|number}} timeout)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Waits until it received a rednet message or &amp;lt;var&amp;gt;timeout&amp;lt;/var&amp;gt; has passed. Leave args empty to wait for a message forever.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr style=&amp;quot;background-color: #FFFFFF;&amp;quot;&amp;gt;&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;[[rednet.isOpen]]({{type|string}} side)&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-top: solid #C9C9C9 1px; padding: .4em;&amp;quot;&amp;gt;Returns true if the wireless modem is open.&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Events==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Event Name&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Description&lt;br /&gt;
! colspan=&amp;quot;1&amp;quot; | Parameters&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | rednet_message&lt;br /&gt;
|Fired when a rednet message is received (can be used as alternative for rednet.receive())&lt;br /&gt;
|{{type|number}} senderId, {{type|string}} message, {{type|number}} distance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
Before the creation of the in-game wireless networking API, the term &amp;quot;Rednet&amp;quot; referred to a system created by one of the ComputerCraft users based on bundled cables from a popular Minecraft mod - RedPower. It also allowed communication between computers, but the data was transferred slowly - every bit was converted to redstone signal, that lasted about 0,1 seconds. On the release of ComputerCraft 1.3, the system became useless, as the wireless networking was officially implemented to the mod.&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Chainmanner</name></author>	</entry>

	</feed>