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

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=OS_(API)&amp;diff=351</id>
		<title>OS (API)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=OS_(API)&amp;diff=351"/>
				<updated>2012-02-23T09:01:33Z</updated>
		
		<summary type="html">&lt;p&gt;Skrylar: Made it less barren.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
''You may be looking for alternative OS's for ComputerCraft. If so, go to the [[list of OS's]].''&lt;br /&gt;
&lt;br /&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.computerID()&lt;br /&gt;
|Returns the unique ID 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, making it available to all programs.&lt;br /&gt;
|-&lt;br /&gt;
|[[#api|os.unloadAPI( name )]]&lt;br /&gt;
|Unloads a previously loaded API.&lt;br /&gt;
|-&lt;br /&gt;
|[[#pullEvent|os.pullEvent()]]&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()&lt;br /&gt;
|&amp;lt;no description given&amp;gt;&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 [[Category:APIs|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;
[[Category:APIs]]&lt;/div&gt;</summary>
		<author><name>Skrylar</name></author>	</entry>

	</feed>