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

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Rednet_(API)&amp;diff=6009</id>
		<title>Rednet (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Rednet_(API)&amp;diff=6009"/>
				<updated>2013-10-01T08:23:11Z</updated>
		
		<summary type="html">&lt;p&gt;Engineer: &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;
&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.run]]()&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;Runs rednet, but when it's already running it will error out.&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>Engineer</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Peripheral_(API)&amp;diff=5979</id>
		<title>Peripheral (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Peripheral_(API)&amp;diff=5979"/>
				<updated>2013-09-03T13:48:46Z</updated>
		
		<summary type="html">&lt;p&gt;Engineer: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__ &lt;br /&gt;
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]]).&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
If the peripheral is next to the computer, its side is either &amp;quot;front&amp;quot;, &amp;quot;back&amp;quot;, &amp;quot;left&amp;quot;, &amp;quot;right&amp;quot;, &amp;quot;top&amp;quot; or &amp;quot;bottom&amp;quot;. If the peripheral is attached by a cable, its side will follow the format &amp;quot;''type''_''id''&amp;quot;, for example &amp;quot;printer_0&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Peripheral functions are called '''methods''', a term borrowed from Java.&lt;br /&gt;
&lt;br /&gt;
{{API table|Peripheral|image=Grid disk.png|2=&lt;br /&gt;
&lt;br /&gt;
{{API table/row|[[peripheral.isPresent]]({{type|string}} side)|{{type|boolean}}|&lt;br /&gt;
Returns '''true''' if a peripheral is connected on ''side''.&lt;br /&gt;
|odd}}&lt;br /&gt;
&lt;br /&gt;
{{API table/row|[[peripheral.getType]]({{type|string}} side)|{{type|string}}/{{type|nil}}|&lt;br /&gt;
Returns the type of peripheral connected on ''side'', as a string.&lt;br /&gt;
If no peripheral is connected, returns nil.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{API table/row|[[peripheral.getMethods]]({{type|string}} side)|{{type|table}}/{{type|nil}}|&lt;br /&gt;
Returns a list of the names of all the methods of the peripheral connected on ''side''.&lt;br /&gt;
If no peripheral is connected, returns nil.&lt;br /&gt;
|odd}}&lt;br /&gt;
&lt;br /&gt;
{{API table/row|[[peripheral.call]]({{type|string}} side, {{type|string}} method, ...)|any|&lt;br /&gt;
Calls a method on a peripheral. The arguments (apart from ''side'' and ''method'') and the return values depend on the method being called.&lt;br /&gt;
If no peripheral is connected, returns nil.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{API table/row|[[peripheral.wrap]]({{type|string}} side)|{{type|table}}/{{type|nil}}|&lt;br /&gt;
Returns a table of functions, allowing you to call peripheral methods as if they were normal Lua functions.&lt;br /&gt;
If no peripheral is connected, returns nil.&lt;br /&gt;
|odd}}&lt;br /&gt;
&lt;br /&gt;
{{API table/row|[[peripheral.getNames]]()|{{type|table}}|&lt;br /&gt;
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.&lt;br /&gt;
|odd}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Connecting peripherals using networking cables==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
You should receive a message in your chat bar for each peripheral informing you of a successful connection, and the peripheral side.&lt;br /&gt;
&lt;br /&gt;
==Monitor==&lt;br /&gt;
[[Monitor#Peripheral_Functions|Monitor Peripheral functions]] have been moved to the [[Monitor]] page.&lt;br /&gt;
In addition, the [[Advanced_Monitor#Peripheral_Functions|Advanced Monitor Peripheral functions]] have been moved to the [[Advanced Monitor]] page.&lt;br /&gt;
&lt;br /&gt;
==Printer==&lt;br /&gt;
[[Printer#Peripheral_Functions|Printer Peripheral functions]] have been moved to the [[Printer]] page.&lt;br /&gt;
&lt;br /&gt;
==Computers==&lt;br /&gt;
[[Computer#Peripheral_Functions|Computer Peripheral functions]] have been moved to the [[Computer]] page.&lt;br /&gt;
In addition, the [[Advanced_Computer#Peripheral_Functions|Advanced Computer Peripheral functions]] have been moved to the [[Advanced Computer]] page.&lt;br /&gt;
&lt;br /&gt;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Engineer</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Os.pullEvent&amp;diff=5515</id>
		<title>Os.pullEvent</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Os.pullEvent&amp;diff=5515"/>
				<updated>2013-04-30T17:30:09Z</updated>
		
		<summary type="html">&lt;p&gt;Engineer: /* Event types */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Function&lt;br /&gt;
 |name=os.pullEvent&lt;br /&gt;
 |args=[{{type|string}} filter]&lt;br /&gt;
 |api=OS&lt;br /&gt;
 |returns={{type|string}} event, variable parameters(see table below)&lt;br /&gt;
 |addon=ComputerCraft&lt;br /&gt;
 |desc=Waits (yields) until an event occurs&lt;br /&gt;
 |examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=The program requires to wait for a keypress to do something:&lt;br /&gt;
|code=[[Function (type)|function]] clear()&lt;br /&gt;
    [[term.clear]]()&lt;br /&gt;
    [[term.setCursorPos]] (1,1)&lt;br /&gt;
 end&lt;br /&gt;
 while true do&lt;br /&gt;
    clear()&lt;br /&gt;
    [[print]] (&amp;quot;Press E to do something.&amp;quot;)&lt;br /&gt;
    local event, param1 = os.pullEvent (&amp;quot;char&amp;quot;) -- limit os.pullEvent to the char event&lt;br /&gt;
    if param1 == &amp;quot;e&amp;quot; then -- if the returned value was 'e'&lt;br /&gt;
        clear()&lt;br /&gt;
        [[write]] (&amp;quot;Name: &amp;quot;)&lt;br /&gt;
        local name = [[read]]()&lt;br /&gt;
        [[print]] (name)&lt;br /&gt;
        break&lt;br /&gt;
    else&lt;br /&gt;
        clear()&lt;br /&gt;
        [[print]] (&amp;quot;Wrong button!&amp;quot;)&lt;br /&gt;
        [[os.sleep|sleep]] (1.5) -- I don't like a whole 2 seconds but 1 second is too short&lt;br /&gt;
    end&lt;br /&gt;
 end&lt;br /&gt;
}}&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=This script shows how the os.pullEvent function can be used as an iterator instead of using a while loop:&lt;br /&gt;
|code=for event, param1 in os.pullEvent do --this will continuously fire an event without the use of a while loop&lt;br /&gt;
    [[print]](&amp;quot;Event: &amp;quot;..event)&lt;br /&gt;
    [[print]](&amp;quot;Param1: &amp;quot;..param1)&lt;br /&gt;
 end&lt;br /&gt;
[[User:SuicidalSTDz|SuicidalSTDz]] 20:23, 29 March 2013 (MSK)&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Common syntax ===&lt;br /&gt;
&lt;br /&gt;
 event, param1, param2, param3 = os.pullEvent()&lt;br /&gt;
&lt;br /&gt;
Note: This is one of the most commonly used functions that can return multiple values.&lt;br /&gt;
It works like any other function call (such as &amp;quot;input = read()&amp;quot;) except that you can get more than one piece of information back.&lt;br /&gt;
&lt;br /&gt;
== How it works ==&lt;br /&gt;
When os.pullEvent() is called, the computer waits until an event occurs.&lt;br /&gt;
Events can be triggered by several different things, such as a key being pressed or a redstone input changing.&lt;br /&gt;
They are usually triggered by ComputerCraft itself, when it needs to notify the computer that something happened.&lt;br /&gt;
They can also be triggered by peripherals, or by your program calling [[os.queueEvent]].&lt;br /&gt;
&lt;br /&gt;
More complicated input, such as &amp;quot;the user typing a line of text,&amp;quot; does ''not'' correspond to an event.&lt;br /&gt;
[[read]] handles this inside itself by waiting for the user to press a key, then updating the screen, moving the cursor, etc.&lt;br /&gt;
&lt;br /&gt;
Events have a type (which is a string) and 0-5 parameters (which are often but not always strings).&lt;br /&gt;
No built-in events use more than 3 parameters.&lt;br /&gt;
&lt;br /&gt;
When an event occurs, the event type, followed by the parameters, will be returned. If you have:&lt;br /&gt;
&lt;br /&gt;
 event, button, x, y = os.pullEvent()&lt;br /&gt;
&lt;br /&gt;
and the user clicks the mouse at coordinates 5,4 then:&lt;br /&gt;
* event will be set to &amp;quot;mouse_click&amp;quot; (the event type)&lt;br /&gt;
* button will be set to 0 (the first parameter)&lt;br /&gt;
* x will be set to 5 (the second parameter)&lt;br /&gt;
* y will be set to 4 (the third parameter)&lt;br /&gt;
&lt;br /&gt;
Note that in this example, we didn't specify a filter. If you specify a filter, then all events of different types will be ignored.&lt;br /&gt;
If the user inserts a disk, instead of clicking the mouse, then event will be &amp;quot;disk&amp;quot;, button will be the side the disk drive is on, and x and y will be nil.&lt;br /&gt;
&lt;br /&gt;
If we wanted to only wait for mouse clicks we could use:&lt;br /&gt;
&lt;br /&gt;
  event, button, x, y = os.pullEvent(&amp;quot;mouse_click&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
which will ignore any events that are not mouse clicks.&lt;br /&gt;
&lt;br /&gt;
If you assign more variables than necessary, the extra ones will be set to nil.&lt;br /&gt;
If you assign fewer variables than necessary, the extra parameters will be discarded.&lt;br /&gt;
&lt;br /&gt;
==Event types==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Name&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Description&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | Parameters&lt;br /&gt;
|-&lt;br /&gt;
! 1 !! 2 !! 3&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[char (event)|char]]&lt;br /&gt;
|Fired when text is typed on the keyboard&lt;br /&gt;
| {{type|string}} the letter typed&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[key (event)|key]]&lt;br /&gt;
|Fired when a key is pressed on the keyboard&lt;br /&gt;
|{{type|number}} numerical keycode&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[timer (event)|timer]]&lt;br /&gt;
|Fired when a timeout started by [[os.startTimer]]() completes&lt;br /&gt;
|{{type|number}} Value of the timer as returned by os.startTimer()&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[alarm (event)|alarm]]&lt;br /&gt;
|Fired when a time passed to [[os.setAlarm]]() is reached&lt;br /&gt;
|{{type|number}} Value of the alarm as returned by os.setAlarm()&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[redstone (event)|redstone]]&lt;br /&gt;
|Fired when the state of any of the redstone inputs change&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[terminate (event)|terminate]]&lt;br /&gt;
|Fired when a combination of keys CTRL and T is pressed and held for three seconds.&lt;br /&gt;
You will not normally see this event, as it is handled inside os.pullEvent.&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[disk (event)|disk]]&lt;br /&gt;
|Fired when a disk is inserted into an adjacent disk drive&lt;br /&gt;
|{{type|string}} side&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[disk_eject (event)|disk_eject]]&lt;br /&gt;
|Fired when a disk is removed from an adjacent disk drive&lt;br /&gt;
|{{type|string}} side&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[peripheral (event)|peripheral]]&lt;br /&gt;
|Fired when peripheral is attached&lt;br /&gt;
|{{type|string}} side&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[peripheral_detach (event)| peripheral_detach]]&lt;br /&gt;
|Fired when peripheral is removed&lt;br /&gt;
|{{type|string}} side&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[rednet_message (event)|rednet_message]]&lt;br /&gt;
|Fired when a rednet message is received from the [[Rednet_(API)|rednet API]]&lt;br /&gt;
|{{type|number}} senderID&lt;br /&gt;
|{{type|string}} message&lt;br /&gt;
|{{type|number}} distance travelled&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[http_success (event)|http_success]]&lt;br /&gt;
|Fired when an attempt to receive text from / post text on a website is successful.&lt;br /&gt;
You will not normally see this event as it is handled inside http.get.&lt;br /&gt;
|{{type|string}} url of the site&lt;br /&gt;
|{{type|table}} text on the site&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[http_failure (event)|http_failure]]&lt;br /&gt;
|Fired when an attempt to receive text from / post text on a website is unsuccessful&lt;br /&gt;
You will not normally see this event as it is handled inside http.get.&lt;br /&gt;
|{{type|string}} url of the site&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[mouse_click (event)|mouse_click]]&lt;br /&gt;
|Fired when a mouse button is pressed&lt;br /&gt;
|{{type|number}} mouse button&lt;br /&gt;
|{{type|number}} x coordinate&lt;br /&gt;
|{{type|number}} y coordinate&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[mouse_scroll (event)|mouse_scroll]]&lt;br /&gt;
|Fired when a mousewheel is scrolled.&lt;br /&gt;
|{{type|number}} scroll direction (-1 for up, 1 for down)&lt;br /&gt;
|{{type|number}} x coordinate(in screen chars)&lt;br /&gt;
|{{type|number}} y coordinate(in screen chars)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[mouse_drag (event)|mouse_drag]]&lt;br /&gt;
|Fired when the mouse is moved after clicking.&lt;br /&gt;
|{{type|number}} mouse button&lt;br /&gt;
|{{type|number}} x coordinate(in screen chars)&lt;br /&gt;
|{{type|number}} y coordinate(in screen chars)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[monitor_touch (event)|monitor_touch]]&lt;br /&gt;
|Fired when a player right click on an advanced monitor connected.&lt;br /&gt;
|{{type|string}} side&lt;br /&gt;
|{{type|number}} x coordinate(in screen chars)&lt;br /&gt;
|{{type|number}} y coordinate(in screen chars)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | [[monitor_resize (event)|monitor_resize]]&lt;br /&gt;
|Fired when a monitor resizes&lt;br /&gt;
|{{type|string}} side&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Guides ==&lt;br /&gt;
[http://www.computercraft.info/forums2/index.php?/topic/1516-ospullevent-what-is-it-and-how-is-it-useful/page__view__findpost__p__11156 ''Onionnion's Guide on os.pullEvent()'']&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua_Core_Functions]]&lt;/div&gt;</summary>
		<author><name>Engineer</name></author>	</entry>

	</feed>