<?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=Kingdaro</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=Kingdaro"/>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/Special:Contributions/Kingdaro"/>
		<updated>2026-07-11T20:58:15Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Wireless_Modem&amp;diff=5278</id>
		<title>Wireless Modem</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Wireless_Modem&amp;diff=5278"/>
				<updated>2013-03-30T07:50:47Z</updated>
		
		<summary type="html">&lt;p&gt;Kingdaro: Changed the wireless modem recipe. I'm /pretty/ sure this is right, but if it isn't please correct.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{NeedsWork|The behaviour of Rednet has changed as of 1.5 - please consider updating this page with information. (Please don't add prerelease info!)}}&lt;br /&gt;
:''This page is for the Modem blocks. For the modem API, see [[Modem_(API)|Modem (API)]]''&lt;br /&gt;
{{Block&lt;br /&gt;
|name=Modem&lt;br /&gt;
|image=WirelessModem.png&lt;br /&gt;
|id=4094&lt;br /&gt;
|damage-value=1&lt;br /&gt;
|is-peripheral=Yes&lt;br /&gt;
|peripheral-api=Modem (API)&lt;br /&gt;
}}&lt;br /&gt;
Modems are blocks which can be used to wirelessly transfer data between [[Computer|computers]] and [[Turtle|turtles]], using the [[Rednet_(API)|Rednet API]] or the [[Modem_(API)|Modem API]].&lt;br /&gt;
To place a modem on a side of a computer, right-click to place the modem while sneaking.&lt;br /&gt;
&lt;br /&gt;
It is also possible to turn the modem on and off by typing &amp;quot;rednet.open ( side )&amp;quot; to open and &amp;quot;rednet.close ( side )&amp;quot; to close.&lt;br /&gt;
&lt;br /&gt;
Modems can send messages to other modems located up to 64 meters away, or 16 meters during a thunderstorm.&lt;br /&gt;
As of 1.4 Modem range is increased with higher altitudes. If there is no thunderstorm, the range will always be higher than 64, and at max altitude you would have a range of 384 meters.&lt;br /&gt;
&lt;br /&gt;
In 1.4 and 1.41 there is a miscalculation that causes the range to only be 381 meters at max altitude.&lt;br /&gt;
&lt;br /&gt;
== Recipe ==&lt;br /&gt;
{{Crafting grid&lt;br /&gt;
 |A1=stone |B1=stone          |C1=stone&lt;br /&gt;
 |A2=stone |B2=ender_pearl    |C2=stone&lt;br /&gt;
 |A3=stone |B3=stone          |C3=stone&lt;br /&gt;
 |Output=Modem&lt;br /&gt;
 }}&lt;br /&gt;
&lt;br /&gt;
== Example (Rednet API)==&lt;br /&gt;
* Place 2 computers and add modems to them by clicking the right mouse button while sneaking.&lt;br /&gt;
* Access them, and start Lua.&lt;br /&gt;
* Once Lua has started, type &amp;quot;[[rednet_(API)|rednet]].[[rednet.open|open]] (&amp;quot;&amp;lt;relative location to modem, e.g. left, right&amp;gt;&amp;quot;)&amp;quot; on both computers.&lt;br /&gt;
* Check if there exists a connection: a dim, red light should be found on the modem.&lt;br /&gt;
* Type on one computer &amp;quot;[[rednet_(API)|rednet]].[[rednet.receive|receive]] (60)&amp;quot;. This will make the computer freeze for 60 seconds, or until it has received a signal from the other computers.&lt;br /&gt;
* Now, type &amp;quot;[[rednet_(API)|rednet]].[[rednet.broadcast|broadcast]] ('&amp;lt;your message&amp;gt;')&amp;quot; on the other computer. This should send your message to all computers connected.&lt;br /&gt;
* Opening the first computer should show the message written on the second computer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Modem as a Peripheral==&lt;br /&gt;
To use a Modem as a peripheral, you need to either call a method directly using [[peripheral.call]](), or, wrap the modem using the [[Peripheral_(API)|Peripheral API]]. Wrapped modems provide all functions listed in the [[Rednet_(API)|Rednet API]].&lt;br /&gt;
&lt;br /&gt;
For this example, we have a Modem connected to the top of our [[Computer]]:&lt;br /&gt;
&lt;br /&gt;
 -- Immediately invoke a method without wrapping&lt;br /&gt;
 peripheral.call(&amp;quot;top&amp;quot;, &amp;quot;open&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
 -- You can also &amp;quot;wrap&amp;quot; the peripheral side to a variable:&lt;br /&gt;
 local modem = peripheral.wrap(&amp;quot;top&amp;quot;)&lt;br /&gt;
 modem.open(&amp;quot;top&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[[Category:Peripherals]]&lt;/div&gt;</summary>
		<author><name>Kingdaro</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Os.computerID&amp;diff=3855</id>
		<title>Os.computerID</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Os.computerID&amp;diff=3855"/>
				<updated>2012-11-26T10:01:48Z</updated>
		
		<summary type="html">&lt;p&gt;Kingdaro: dunno where people got &amp;quot;computerID&amp;quot; from, it's &amp;quot;getComputerID&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
|name=os.getComputerID&lt;br /&gt;
|returns=the ID of the Computer&lt;br /&gt;
|api=os&lt;br /&gt;
|addon=ComputerCraft&lt;br /&gt;
|desc=returns the ID of the computer this command is executed on.&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=prints the Computer ID&lt;br /&gt;
|code=print(os.getComputerID())&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Kingdaro</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=OS_(API)&amp;diff=3854</id>
		<title>OS (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=OS_(API)&amp;diff=3854"/>
				<updated>2012-11-26T09:56:11Z</updated>
		
		<summary type="html">&lt;p&gt;Kingdaro: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Operating System API allows for interfacing with the Lua based Operating System itself.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
!style=&amp;quot;background:#EEE&amp;quot; width=&amp;quot;200px&amp;quot;|Method name&lt;br /&gt;
!style=&amp;quot;background:#EEE&amp;quot; width=&amp;quot;*&amp;quot;|Description&lt;br /&gt;
|-&lt;br /&gt;
|[[os.version]]()&lt;br /&gt;
|Returns the version of the OS the computer is running.&lt;br /&gt;
|-&lt;br /&gt;
|[[os.getComputerID]]()&lt;br /&gt;
|Returns the unique ID of this computer.&lt;br /&gt;
|-&lt;br /&gt;
|[[os.getComputerLabel]]()&lt;br /&gt;
|Returns the label of this computer.&lt;br /&gt;
|-&lt;br /&gt;
|[[os.setComputerLabel]]( label )&lt;br /&gt;
|Set the label of this computer.&lt;br /&gt;
|-&lt;br /&gt;
|[[os.run]]( environment, programpath, arguments )&lt;br /&gt;
|An advanced way of starting programs. A started program will have a given&lt;br /&gt;
Environment table which determines what functions it has available, as well as&lt;br /&gt;
any variables it will be able to access by default. You may prefer to use the&lt;br /&gt;
[[Shell (API)]] unless you need to do something special.&lt;br /&gt;
|-&lt;br /&gt;
|[[#api|os.loadAPI]]( name )&lt;br /&gt;
|Loads a lua script as an API in it's own namespace (see example). It will be available to *all* programs.&lt;br /&gt;
  -- &amp;quot;apiTest&amp;quot; file&lt;br /&gt;
  function foo(bar)&lt;br /&gt;
    print(bar)&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  -- &amp;quot;program&amp;quot; file&lt;br /&gt;
  apiTest.foo(&amp;quot;this is a test&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
|[[#api|os.unloadAPI]]( name )&lt;br /&gt;
|Unloads a previously loaded API.&lt;br /&gt;
|-&lt;br /&gt;
|[[Os.pullEvent|os.pullEvent]]( only-event-to-accept )&lt;br /&gt;
|Blocks until the computer has detected an event, then returns the event.&lt;br /&gt;
|-&lt;br /&gt;
|[[#pullEvent|os.pullEventRaw]]()&lt;br /&gt;
|Advanced version of pullEvent().&lt;br /&gt;
|-&lt;br /&gt;
|[[os.queueEvent]]( event, param1, param2, ... )&lt;br /&gt;
|Adds an event to the event queue with the name &amp;lt;var&amp;gt;event&amp;lt;/var&amp;gt; and the given parameters&lt;br /&gt;
|-&lt;br /&gt;
|[[os.clock]]()&lt;br /&gt;
|Returns CPU time.&lt;br /&gt;
|-&lt;br /&gt;
|[[os.startTimer]]( timeout )&lt;br /&gt;
|Queues an event to be triggered after a number of seconds.&lt;br /&gt;
The ID of the timer is returned from this function to differentiate multiple&lt;br /&gt;
timers. Timers are one-shot, once they have fired an event you will need to&lt;br /&gt;
start another one if you need a recurring timer.&lt;br /&gt;
|-&lt;br /&gt;
|[[os.sleep]]( timeout )&lt;br /&gt;
|Makes the system wait a number of seconds before continuing in the program.&lt;br /&gt;
May also be used as simply &amp;quot;sleep( timeout )&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
|[[os.time]]()&lt;br /&gt;
|Returns the current Minecraft world time.&lt;br /&gt;
|-&lt;br /&gt;
|[[os.setAlarm]]( time )&lt;br /&gt;
|Queues an event to be triggered at the specific Minecraft world time.&lt;br /&gt;
|-&lt;br /&gt;
|[[os.shutdown]]()&lt;br /&gt;
|Turns off the computer.&lt;br /&gt;
|-&lt;br /&gt;
|[[os.reboot]]()&lt;br /&gt;
|Reboots the computer.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;div id=&amp;quot;api&amp;quot;&amp;gt;API&amp;lt;/div&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
API are programs which are loaded in to the OS itself, and expose functions&lt;br /&gt;
which other programs may use. The stock [[APIs]] that ship with&lt;br /&gt;
ComputerCraft are loaded in this way, and may be replaced by a computer's&lt;br /&gt;
user or programs.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;div id=&amp;quot;pullEvent&amp;quot;&amp;gt;os.pullEvent()&amp;lt;/div&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
os.pullEvent() causes the current program to pause, retrieving the next event&lt;br /&gt;
from the computer's queue of events. If there is no event to read, then the&lt;br /&gt;
program will stall until such an event becomes available. Note that if a&lt;br /&gt;
program has not attempted to pull an event in the past ten seconds, it will&lt;br /&gt;
be forcefully terminated to prevent CPU waste in SMP environments.&lt;br /&gt;
&lt;br /&gt;
pullEvent returns the name of the event that was read, as well as up to&lt;br /&gt;
five parameters:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
local event, p1, p2, p3, p4, p5 = os.pullEvent()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
os.pullEvent() is usually run inside a 'while true do' loop.&lt;br /&gt;
&lt;br /&gt;
An advanced version of this method &amp;lt;code&amp;gt;os.pullEventRaw&amp;lt;/code&amp;gt; bypasses the&lt;br /&gt;
normal handling of events from the OS. You may use this to act on the&lt;br /&gt;
&amp;quot;Terminate&amp;quot; event (triggered when holding Ctrl-T) for custom termination logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- === Event names ===&lt;br /&gt;
-- please wikitable this --&lt;br /&gt;
*[[Raw key events|&amp;quot;key&amp;quot;: keypress]]&lt;br /&gt;
*&amp;quot;rednet_message&amp;quot;: recieved a rednet message&lt;br /&gt;
*&amp;quot;terminate&amp;quot; (? please verify name): Ctrl-T held&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Kingdaro</name></author>	</entry>

	</feed>