<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ocr.michiyo.me/w/index.php?action=history&amp;feed=atom&amp;title=Component%2Fmodem</id>
	<title>Component/modem - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ocr.michiyo.me/w/index.php?action=history&amp;feed=atom&amp;title=Component%2Fmodem"/>
	<link rel="alternate" type="text/html" href="https://ocr.michiyo.me/w/index.php?title=Component/modem&amp;action=history"/>
	<updated>2026-08-24T13:47:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://ocr.michiyo.me/w/index.php?title=Component/modem&amp;diff=1182&amp;oldid=prev</id>
		<title>imported&gt;OCDoc Import: Imported from legacy OpenComputers documentation at ocdoc.cil.li</title>
		<link rel="alternate" type="text/html" href="https://ocr.michiyo.me/w/index.php?title=Component/modem&amp;diff=1182&amp;oldid=prev"/>
		<updated>2026-08-24T08:08:27Z</updated>

		<summary type="html">&lt;p&gt;Imported from legacy OpenComputers documentation at ocdoc.cil.li&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Component: Modem =&lt;br /&gt;
&lt;br /&gt;
This component is provided by [[Item/network card|network cards]]. Wireless network cards behave much like normal network cards, but additionally send the message as a wireless &amp;quot;packet&amp;quot; when a strength is set. The modem&amp;#039;s address must be used for networking. It can be found through component.modem.address.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE&amp;#039;&amp;#039;&amp;#039;: The modem component only works with in-game networks. For out-of-game connections see the [[Item/internet card|internet card]].&lt;br /&gt;
&lt;br /&gt;
Component name: `modem`. Callbacks:&lt;br /&gt;
&lt;br /&gt;
* `isWireless(): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Returns whether this modem is capable of sending wireless messages.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `maxPacketSize(): number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Returns the maximum packet size for sending messages via network cards. Defaults to 8192. You can change this in the OpenComputers configuration file.  &lt;br /&gt;
Every value in a message adds two bytes of overhead. (Even if there&amp;#039;s only one value.)  &lt;br /&gt;
Numbers add another 8 bytes, true/false/nil another 4 bytes, and strings exactly as many bytes as the string contains---though empty strings still count as one byte.  &lt;br /&gt;
Examples:  &lt;br /&gt;
* `&amp;quot;foo&amp;quot;` is a 5-byte packet; two bytes of overhead and a three byte string.&lt;br /&gt;
* `&amp;quot;currentStatus&amp;quot;,300` is a 25-byte packet; four bytes overhead, a 13-byte string, and 8 bytes for a number.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `isOpen(port: number): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Returns whether the specified &amp;quot;port&amp;quot; is currently being listened on. Messages only trigger signals when they arrive on a port that is open.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `open(port: number): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Opens the specified port number for listening. Returns `true` if the port was opened, `false` if it was already open. **Note: maximum port is 65535**&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `close([port: number]): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Closes the specified port (default: all ports). Returns true if ports were closed.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `send(address: string, port: number[, ...]): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Sends a network message to the specified address. Returns `true` if the message was sent. This does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; mean the message was received, only that it was sent. No port-sniffing for you.  &lt;br /&gt;
Any additional arguments are passed along as data. These arguments must be basic types: nil, boolean, number and string values are supported, tables and functions are not. See [[API/serialization|the serialization API]] for serialization of tables.  &lt;br /&gt;
The number of additional arguments is limited. The default limit is 8. It can be changed in the OpenComputers configuration file, but this is //not// recommended; higher limits can allow relatively weak computers to break relatively strong ones with no defense possible, while lower limits will prevent some protocols from working.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `broadcast(port: number, ...): boolean`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Sends a broadcast message. This message is delivered to all reachable network cards. Returns `true` if the message was sent. Note that broadcast messages are &amp;#039;&amp;#039;not&amp;#039;&amp;#039; delivered to the modem that sent the message.  &lt;br /&gt;
All additional arguments are passed along as data. See `send`.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `getStrength(): number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;The current signal strength to apply when sending messages.&lt;br /&gt;
//Wireless network cards only.//&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `setStrength(value: number): number`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Sets the signal strength. If this is set to a value larger than zero, sending a message will also generate a wireless message. Also, calls to set the strength that exceed the installed modem&amp;#039;s maximum strength will simply set the modem&amp;#039;s strength to it&amp;#039;s maximum.  The higher the signal strength the more energy is required to send messages, though.&lt;br /&gt;
//Wireless network cards only.//&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `getWakeMessage():string`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Gets the current wake-up message. When the network card detects the wake message (a string in the first argument of a network packet), on any port and the machine is off, the machine is started. Works for robots, cases, servers, drones, and tablets. [[Component/tunnel|Linked Cards]] provide this same functionality.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* `setWakeMessage(message: string, [fuzzy: boolean]):string`&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Sets the wake-up message to the specified **string**. The message matching can be fuzzy (default is false). A fuzzy match ignores additional trailing arguments in the network packet.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This component generates a signal named `modem_message` if a message from another network card is received.&lt;br /&gt;
It has the signature `localAddress: string, remoteAddress: string, port: number, distance: number, ...`.&lt;br /&gt;
&lt;br /&gt;
* `localAddress` is the address of the modem component the message was received by. - `remoteAddress` is the address of the network card the message was sent from. - `port` is the port number the message was delivered to. - `distance` is the distance to the modem that sent the message. This is only set for wireless messages. For normal messages this is always 0. - All further values are values passed along by the sender (i.e. the `...` in `send` and `broadcast`).&lt;br /&gt;
&lt;br /&gt;
== Example use: ```lua local component = require(&amp;quot;component&amp;quot;) local event = require(&amp;quot;event&amp;quot;) local m = component.modem -- get primary modem component m.open(123) print(m.isOpen(123)) -- true -- Send some message. m.broadcast(123, &amp;quot;this is a test&amp;quot;) -- Wait for a message from another network card. local _, _, from, port, _, message = event.pull(&amp;quot;modem_message&amp;quot;) print(&amp;quot;Got a message from &amp;quot; .. from .. &amp;quot; on port &amp;quot; .. port .. &amp;quot;: &amp;quot; .. tostring(message)) ``` ==&lt;br /&gt;
&lt;br /&gt;
{{:Component/contents}}&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>imported&gt;OCDoc Import</name></author>
	</entry>
</feed>