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

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Making_an_API_(tutorial)&amp;diff=384</id>
		<title>Making an API (tutorial)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Making_an_API_(tutorial)&amp;diff=384"/>
				<updated>2012-02-24T18:24:19Z</updated>
		
		<summary type="html">&lt;p&gt;Webmilio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== MAKING AN API - a tutorial by TheVarmari ==&lt;br /&gt;
'''NOTE:''' There is a better tutorial in the [http://www.computercraft.info/forums2/ forums] located [http://www.computercraft.info/forums2/index.php?/topic/145-tutorial-creating-an-api/ here].&lt;br /&gt;
Use this if you prefer to use ccwiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Hello, dear Computercraft Wiki user!&lt;br /&gt;
Today I will tell you how to make an functioning API.&lt;br /&gt;
Let's get started!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Making the API file ==&lt;br /&gt;
First we need to define what our API will be called.&lt;br /&gt;
In this case, I use exampleAPI.&lt;br /&gt;
Now edit the file you want your API to be called.&lt;br /&gt;
''NOTE: If it exists, call it something else''&lt;br /&gt;
&lt;br /&gt;
=== The code ===&lt;br /&gt;
Now, we need to put some functions in it!&lt;br /&gt;
Why don't we start with the basics;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 -- this is the file exampleAPI&lt;br /&gt;
 -- our first function:&lt;br /&gt;
 function printMessage()&lt;br /&gt;
  print(&amp;quot;message&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Which basically prints &amp;quot;message&amp;quot; when excecuted.&lt;br /&gt;
Save the file.&lt;br /&gt;
&lt;br /&gt;
=== Including the API ===&lt;br /&gt;
Now that we have the API done, let's include it in some file!&lt;br /&gt;
Because we speak about APIs, we do it the proper way.&lt;br /&gt;
No shell.run's!&lt;br /&gt;
&lt;br /&gt;
Edit the file you want to include the API in.&lt;br /&gt;
In my case, it is called exampleFile.&lt;br /&gt;
Now, we include the API in it by typing this to the '''first''' row:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 os.loadAPI(&amp;quot;exampleAPI&amp;quot;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This loads the API into the file's memory.&lt;br /&gt;
''NOTE: You have to do this for every file you include it in.&lt;br /&gt;
CC doesn't have long-term memory.''&lt;br /&gt;
&lt;br /&gt;
=== Using the API ===&lt;br /&gt;
Now that that's over, let's include the printMessage command from our API.&lt;br /&gt;
Lua loads API's as tables, so you have to use api_name.function_name(function_arguments)&lt;br /&gt;
&lt;br /&gt;
In my case, I use&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 exampleAPI.printMessage()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Ta-da! It printed out &amp;quot;message&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== A couple of words ==&lt;br /&gt;
Thank you for reading this tutorial, it sure was fun to make!&lt;br /&gt;
Correct any mistakes I did! &lt;br /&gt;
[[User:TheVarmari|TheVarmari]] 16:59, 22 February 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Webmilio</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Making_an_API_(tutorial)&amp;diff=383</id>
		<title>Making an API (tutorial)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Making_an_API_(tutorial)&amp;diff=383"/>
				<updated>2012-02-24T18:22:21Z</updated>
		
		<summary type="html">&lt;p&gt;Webmilio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== MAKING AN API - a tutorial by TheVarmari ==&lt;br /&gt;
'''NOTE:''' There is a better tutorial in the [http://www.computercraft.info/forums2/ forums].&lt;br /&gt;
Use this if you prefer to use ccwiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Hello, dear Computercraft Wiki user!&lt;br /&gt;
Today I will tell you how to make an functioning API.&lt;br /&gt;
Let's get started!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Making the API file ==&lt;br /&gt;
First we need to define what our API will be called.&lt;br /&gt;
In this case, I use exampleAPI.&lt;br /&gt;
Now edit the file you want your API to be called.&lt;br /&gt;
''NOTE: If it exists, call it something else''&lt;br /&gt;
&lt;br /&gt;
=== The code ===&lt;br /&gt;
Now, we need to put some functions in it!&lt;br /&gt;
Why don't we start with the basics;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 -- this is the file exampleAPI&lt;br /&gt;
 -- our first function:&lt;br /&gt;
 function printMessage()&lt;br /&gt;
  print(&amp;quot;message&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Which basically prints &amp;quot;message&amp;quot; when excecuted.&lt;br /&gt;
Save the file.&lt;br /&gt;
&lt;br /&gt;
=== Including the API ===&lt;br /&gt;
Now that we have the API done, let's include it in some file!&lt;br /&gt;
Because we speak about APIs, we do it the proper way.&lt;br /&gt;
No shell.run's!&lt;br /&gt;
&lt;br /&gt;
Edit the file you want to include the API in.&lt;br /&gt;
In my case, it is called exampleFile.&lt;br /&gt;
Now, we include the API in it by typing this to the '''first''' row:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 os.loadAPI(&amp;quot;exampleAPI&amp;quot;)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This loads the API into the file's memory.&lt;br /&gt;
''NOTE: You have to do this for every file you include it in.&lt;br /&gt;
CC doesn't have long-term memory.''&lt;br /&gt;
&lt;br /&gt;
=== Using the API ===&lt;br /&gt;
Now that that's over, let's include the printMessage command from our API.&lt;br /&gt;
Lua loads API's as tables, so you have to use api_name.function_name(function_arguments)&lt;br /&gt;
&lt;br /&gt;
In my case, I use&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 exampleAPI.printMessage()&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Ta-da! It printed out &amp;quot;message&amp;quot;!&lt;br /&gt;
&lt;br /&gt;
== A couple of words ==&lt;br /&gt;
Thank you for reading this tutorial, it sure was fun to make!&lt;br /&gt;
Correct any mistakes I did! &lt;br /&gt;
[[User:TheVarmari|TheVarmari]] 16:59, 22 February 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Webmilio</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=ComputerCraft&amp;diff=381</id>
		<title>ComputerCraft</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=ComputerCraft&amp;diff=381"/>
				<updated>2012-02-24T18:19:28Z</updated>
		
		<summary type="html">&lt;p&gt;Webmilio: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The mod itself. This mod, created by dan200, has a [http://www.minecraftforum.net/topic/892282-11-computercraft-13/ thread] on the minecraft forums and it's own [http://computercraft.info wiki]. You can see the history of this mod on the ''[http://http://computercraft.info/wiki/index.php?title=Changelog Changelog]'' page on the wiki.&lt;/div&gt;</summary>
		<author><name>Webmilio</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=ComputerCraft&amp;diff=380</id>
		<title>ComputerCraft</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=ComputerCraft&amp;diff=380"/>
				<updated>2012-02-24T18:19:08Z</updated>
		
		<summary type="html">&lt;p&gt;Webmilio: Created the page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The mod itself. This mod, created by dan200 on the minecraft forums, has a [http://www.minecraftforum.net/topic/892282-11-computercraft-13/ thread] on the minecraft forums and it's own [http://computercraft.info wiki]. You can see the history of this mod on the ''[http://http://computercraft.info/wiki/index.php?title=Changelog Changelog]'' page on the wiki.&lt;/div&gt;</summary>
		<author><name>Webmilio</name></author>	</entry>

	</feed>