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

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Mouse_click_(event)&amp;diff=7457</id>
		<title>Mouse click (event)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Mouse_click_(event)&amp;diff=7457"/>
				<updated>2016-12-13T16:40:00Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: pressing extra mouse buttons are registered as left mouse button&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase}}&lt;br /&gt;
{{Event&lt;br /&gt;
|name=mouse_click&lt;br /&gt;
|desc=Fired when the terminal of an advanced system is pressed with a mouse. Unavailable to normal systems, as these lack mouse support.&lt;br /&gt;
|return1=The mouse button that was clicked. Left Mouse Button is returned as the number 1, Right Mouse Button is returned as the number 2 and Middle Mouse Button is returned as the number 3. If you have more than three buttons on your mouse, pressing them will return 1.&lt;br /&gt;
|return2=The X-coordinate of the click (in screen-characters).&lt;br /&gt;
|return3=The Y-coordinate of the click (in screen-characters).&lt;br /&gt;
|examples=&lt;br /&gt;
{{Example&lt;br /&gt;
|desc=Print the button and the co-ordinates of every mouse click we receive.&lt;br /&gt;
|code=&lt;br /&gt;
 while true do&lt;br /&gt;
   local event, button, x, y = '''[[os.pullEvent]]( &amp;quot;mouse_click&amp;quot; )'''&lt;br /&gt;
   &lt;br /&gt;
   [[print]]( &amp;quot;The mouse button &amp;quot;, button, &amp;quot; was pressed at &amp;quot;, x, &amp;quot; and &amp;quot;, y )&lt;br /&gt;
 end&lt;br /&gt;
|output=The button that was pressed, followed by the X and Y position of the event.&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Loops&amp;diff=7087</id>
		<title>Loops</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Loops&amp;diff=7087"/>
				<updated>2015-07-01T12:31:50Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: I'm pretty sure that that means the same. Which is obviously incorrect then.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
{{Tutorial&lt;br /&gt;
|name=Loops&lt;br /&gt;
|desc=This is a tutorial page for loops and their application.&lt;br /&gt;
|objective=To understand the purposes, and uses of, loops and iterators&lt;br /&gt;
|prereqs=[[Variables|A basic understanding of Variables]] and [[Function_(type)|a basic understanding of Functions]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introducing Loops ==&lt;br /&gt;
&lt;br /&gt;
At some point while coding, you will most likely want to run some code multiple times, without writing out a lot of code. While it is true that functions can shorten your code, there may be situations where even those don't simplify it enough. That's where loops come in.&lt;br /&gt;
&lt;br /&gt;
Here is a name-gathering script without loops:&lt;br /&gt;
 local [[Function (type)|function]] GetName()&lt;br /&gt;
    [[write]](&amp;quot;Enter a name: &amp;quot;)&lt;br /&gt;
    return [[read]]()&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 local Name1 = GetName()&lt;br /&gt;
 local Name2 = GetName()&lt;br /&gt;
 local Name3 = GetName()&lt;br /&gt;
 local Name4 = GetName()&lt;br /&gt;
 local Name5 = GetName()&lt;br /&gt;
 &lt;br /&gt;
 [[write]](&amp;quot;You have entered &amp;quot;..Name1..&amp;quot; &amp;quot;..Name2..&amp;quot; &amp;quot;..Name3..&amp;quot; &amp;quot;..Name4..&amp;quot; &amp;quot;..Name5)&lt;br /&gt;
&lt;br /&gt;
As you can see, there is quite a lot of repetition, even when we're using a function.&lt;br /&gt;
&lt;br /&gt;
== The For loop ==&lt;br /&gt;
&lt;br /&gt;
The for loop is the most basic loop. It is in the following format:&lt;br /&gt;
 for ''Variable'' = ''Start'', ''End'', ''Interval'' do&lt;br /&gt;
    --Insert code here&lt;br /&gt;
 end&lt;br /&gt;
''Variable'' is a number that will track where we are in the loop. It is usually called &amp;quot;i&amp;quot;, or something more appropriate to the script. ''Start'' is a number to indicate the start point for the loop. In a simple loop this will typically be 1, but you may have need to start with other values. ''End'' is the number the loop will count to. ''Interval'' is an optional argument, and will specify how much to increment (or decrement!) ''Variable'' by with each iteration.&lt;br /&gt;
&lt;br /&gt;
The best way to discover how the for loop works is to try it yourself. Try changing the numbers the following code to see how it reacts.&lt;br /&gt;
 for i=1,10 do&lt;br /&gt;
    [[print]]( &amp;quot;i is &amp;quot;..[[tostring]](i) )&lt;br /&gt;
 end&lt;br /&gt;
Notice how it always counts up until ''Variable'' is the same or greater than ''End''. ''Start'', ''End'', and ''Interval'' can also be variables, so it can loop a different number of times:&lt;br /&gt;
 [[write]](&amp;quot;How many times should I loop? &amp;quot;)&lt;br /&gt;
 local Num = tonumber( read() )&lt;br /&gt;
 for i=1,Num do&lt;br /&gt;
    [[print]](&amp;quot;Looped &amp;quot;..[[tostring]](i)..&amp;quot; time(s).&amp;quot;)&lt;br /&gt;
 end&lt;br /&gt;
Note that the loop only inspects ''Start'', ''End'', and ''Interval'' once - when the loop starts - so if their values change while the loop is running, it'll ignore this and loop according to as they were when it it begun.&lt;br /&gt;
&lt;br /&gt;
To simplify the first script using a for loop, it would look something like this:&lt;br /&gt;
 local string = &amp;quot;&amp;quot;&lt;br /&gt;
 for i=1,5 do&lt;br /&gt;
   [[write]](&amp;quot;Enter a name: &amp;quot;)&lt;br /&gt;
   string=string..&amp;quot; &amp;quot;..read()&lt;br /&gt;
 end&lt;br /&gt;
 [[write]](&amp;quot;You have entered &amp;quot;..string)&lt;br /&gt;
A for loop's code will not be executed at all if you hand it values such that the loop appears to've already ended. For example:&lt;br /&gt;
 for i=1,0 do&lt;br /&gt;
   print(i)&lt;br /&gt;
 end&lt;br /&gt;
The above code will print nothing, as ''Start'' starts out as above ''End''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The While loop ==&lt;br /&gt;
&lt;br /&gt;
The While loop will continue looping until a certain condition is no longer met.&lt;br /&gt;
 local Answer, Correct = &amp;quot;&amp;quot;, &amp;quot;2&amp;quot;&lt;br /&gt;
 while Answer ~= Correct do&lt;br /&gt;
    [[write]](&amp;quot;What is the sum of 1 and 1 (1+1)? &amp;quot;)&lt;br /&gt;
    Answer = [[read]]()&lt;br /&gt;
    &lt;br /&gt;
    if Answer == Correct then print(&amp;quot;Correct!&amp;quot;) else print(&amp;quot;Incorrect!&amp;quot;) end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
This type of loop is useful for if you don't want to specify a definite end for the loop. Although infinite loops are ill-advised, you may want to use one at some point. To terminate a program stuck in a loop, hold Ctrl + T while in the computer's interface.&lt;br /&gt;
 while [[boolean_(type)|true]] do --Always loop&lt;br /&gt;
    --Code here&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== The Repeat loop ==&lt;br /&gt;
The reverse of a while loop - instead of repeating so long as a condition is true, it repeats ''until'' a condition is true. Since the check is done at the ''bottom'' of the code block, the code within it will always be executed at least once.&lt;br /&gt;
&lt;br /&gt;
 local i = 1&lt;br /&gt;
 repeat&lt;br /&gt;
   [[print]](i)&lt;br /&gt;
   i = i + 1	&lt;br /&gt;
 until i == 5&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=User_talk:Latias1290&amp;diff=6008</id>
		<title>User talk:Latias1290</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=User_talk:Latias1290&amp;diff=6008"/>
				<updated>2013-09-28T04:07:26Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Do you mind fixing the shading on [[File:Grid_Advanced_Turtle.png]]? I'm not really a graphics person and all I did was copy the colors from models\turtle2.png onto [[File:Grid_turtle.png]].&lt;br /&gt;
--[[User:Bunny365|Bunny365]] 15:39, 1 September 2013 (GMT)&lt;br /&gt;
:Im not really graphical either :/ [[User:Latias1290|Latias1290]] 04:07, 28 September 2013 (GMT)&lt;br /&gt;
&lt;br /&gt;
== Login with Roaming Profiles ==&lt;br /&gt;
&lt;br /&gt;
You have edited the login with roaming profiles pages considerably and redone it even after AfterLifeLochie reverted the changes. Remember that the wiki is a place to put tutorials to help people out, not publish your programs and self-recommend them -- that goes on the forums. &lt;br /&gt;
I love how you added a new login with roaming profiles page, but it seriously looks more like a forum post than a tutorial. You buried the previous program and claimed it as not recommended. Instead you pretty much put your version of the program and essentially copyrighted it, and then recommended it yourself. On top of that, you marked the security issues that DID APPLY to your program as inapplicable to your version. This is for tutorials, not publishing programs to compete with previous ones.&lt;br /&gt;
&lt;br /&gt;
I didn't revert the edition because I think your version is a good improvement, but I added a list of it's flaws (from a wireless networking analyst point of view) to keep users aware and removed the bragging parts (&amp;quot;I recommend the new one, this is just for reference...&amp;quot;). &lt;br /&gt;
&lt;br /&gt;
I can't remove the &amp;quot;by Latias1290&amp;quot; part in the client because it's your intellectual property, but I suggest that you don't brand your tutorial. I mean, it's a tutorial. Also, you should add comments and explain your program rather than just putting the program -- as that doesn't really explain much to people who read the tutorial, instead they have to figure it out themselves.&lt;br /&gt;
&lt;br /&gt;
[[User:Bwhodle|Bwhodle]] 18:43, 6 September 2013 (GMT)&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Turtle_GPS_self-tracker_expansion_(tutorial)&amp;diff=5973</id>
		<title>Turtle GPS self-tracker expansion (tutorial)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Turtle_GPS_self-tracker_expansion_(tutorial)&amp;diff=5973"/>
				<updated>2013-08-28T06:10:25Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial will teach you how to make a [[Turtle]] more efficient in keeping track of its location when using the [[Gps_(API)|GPS API]]. This is essentially an API that uses the native Turtle movement API while using its own movement as a sensor to keep track of its location, so it only requires a GPS signal once, until it is turned off. This API requires every Turtle you want to use the API with to have it installed. I recommend using an [[Advanced_Computer|Advanced Computer]] to write it on, move it to a [[Disk]] with a [[Disk_Drive|disk drive]] and moving it to the Turtle. Alternatively, if you are on Singleplayer or a Multiplayer admin and have access to the mod file, you can move it into the turtle/rom folder to have it automatically installed on every new turtle that is placed.&lt;br /&gt;
&lt;br /&gt;
Important: When starting, the program assumes that it is facing west, so first you must face West and then place the turtle. Here are some ways to check where you are facing:&lt;br /&gt;
You can see the sun/moon rising right in front of you. You are facing East.&lt;br /&gt;
You can see the sun/moon falling right in front of you. You are facing West.&lt;br /&gt;
Clouds go west. Check where they go.&lt;br /&gt;
Press F3 and locate the number behind &amp;quot;f&amp;quot;. This one is below &amp;quot;x&amp;quot;, &amp;quot;y&amp;quot; and &amp;quot;z&amp;quot;. If this number is 0, you are facing North. If this number is 1, you are facing West. If this number is 2, you are facing South. If this number is 3, you are facing East.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
''Note: This will only work on a Turtle. That said, even if it worked on a [[Computer|computer]], it wouldnt have any practical use because a computer cant move.''&amp;lt;br /&amp;gt;&lt;br /&gt;
Before you start, you must add this to the program that you want to use it with at the top line:&lt;br /&gt;
 os.loadApi(&amp;quot;tst&amp;quot;)&lt;br /&gt;
This will allow the program to use the API. This tutorial assumes that you use the file name &amp;quot;tst&amp;quot; for the API, but if you like to you can change it. You must then also change every reference to &amp;quot;tst&amp;quot; in your program, including the line above.&lt;br /&gt;
Write this in the computer/turtle:&lt;br /&gt;
&lt;br /&gt;
 -- Turtle Self-tracking System created by Latias1290.&lt;br /&gt;
 &lt;br /&gt;
 local xPos, yPos, zPos = nil&lt;br /&gt;
 face = 1&lt;br /&gt;
 cal = false&lt;br /&gt;
 &lt;br /&gt;
 function setLocation() -- get gps using other computers&lt;br /&gt;
  xPos, yPos, zPos = gps.locate()&lt;br /&gt;
  cal = true&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function manSetLocation(number x, number y, number z) -- manually set location&lt;br /&gt;
  xPos = x&lt;br /&gt;
  yPos = y&lt;br /&gt;
  zPos = z&lt;br /&gt;
  cal = true&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function getLocation() -- return the location&lt;br /&gt;
  if xPos != nil then&lt;br /&gt;
   return xPos, yPos, zPos&lt;br /&gt;
  elseif xPos == nil then&lt;br /&gt;
   return nil&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function turnLeft() -- turn left&lt;br /&gt;
  if face == 0 then&lt;br /&gt;
   face = 1&lt;br /&gt;
  elseif face == 1 then&lt;br /&gt;
   face = 2&lt;br /&gt;
  elseif face == 2 then&lt;br /&gt;
   face = 3&lt;br /&gt;
  elseif face == 3 then&lt;br /&gt;
   face = 0&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function turnRight() -- turn right&lt;br /&gt;
  if face == 0 then&lt;br /&gt;
   face = 3&lt;br /&gt;
  elseif face == 1 then&lt;br /&gt;
   face = 0&lt;br /&gt;
  elseif face == 2 then&lt;br /&gt;
   face = 1&lt;br /&gt;
  elseif face == 3 then&lt;br /&gt;
   face = 2&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function forward() -- go forward&lt;br /&gt;
  turtle.forward()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   if face == 0 then&lt;br /&gt;
    zPos = zPos - 1&lt;br /&gt;
   elseif face == 1 then&lt;br /&gt;
    xPos = xPos - 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    zPos = zPos + 1&lt;br /&gt;
   elseif face == 3 then&lt;br /&gt;
    xPos = xPos + 1&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function back() -- go back&lt;br /&gt;
  turtle.back()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   if face == 0 then&lt;br /&gt;
    zPos = zPos + 1&lt;br /&gt;
   elseif face == 1 then&lt;br /&gt;
    xPos = xPos + 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    zPos = zPos - 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    xPos = xPos - 1&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function up() -- go up&lt;br /&gt;
  turtle.up()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   yPos = yPos + 1&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function down() -- go down&lt;br /&gt;
  turtle.down()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   yPos = yPos - 1&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  function jump() -- perform a jump. useless? yup!&lt;br /&gt;
   turtle.up()&lt;br /&gt;
   turtle.down()&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== How to Use ==&lt;br /&gt;
This might seem daunting at the first moment. But dont worry, I will walk you through it. Note that to use it properly, you must always put &amp;quot;tst.&amp;quot; in front of it, or how you named it followed by a dot. So if I wanted to have my turtle go 1 block forward, I typed &amp;quot;tst.forward()&amp;quot;. Note that if you do not do either tst.getLocation OR tst.setLocation(coords), the API will print &amp;quot;Not Calibrated.&amp;quot; every time you use a command. This will not prevent you from using it, however.&lt;br /&gt;
&lt;br /&gt;
=== setLocation ===&lt;br /&gt;
To use this, you will need at least 4 computers equipped with a Wireless Modem, and having it host a GPS. More info about that [[Gps_(API)|here]] and [[Gps_(program)|here]].&lt;br /&gt;
&lt;br /&gt;
=== manSetLocation ===&lt;br /&gt;
For this one you will need to know the location of your turtle. Any location will work, but the API loses its point if you use another coordinate set.&lt;br /&gt;
A good way to obtain the coordinates is to open up the debug screen(press F3), stand on the turtle, write down the x, y and z fields, substract 1 from the Y coordinate and use these.&lt;br /&gt;
&lt;br /&gt;
=== getLocation ===&lt;br /&gt;
This one is pretty simple. It returns the coordinates. Note that you will have to overwrite all of them.&lt;br /&gt;
For example, if we had the variables x, y and z, and we wanted to have the value set to our location, we did this:&lt;br /&gt;
 x, y, z = tst.getLocation()&lt;br /&gt;
Simple right? Note that this will return nil if you are not calibrated, which means if you do it before you do setLocation or manSetLocation, x, y and z will be null!&lt;br /&gt;
&lt;br /&gt;
=== forward, back, up, down, turnLeft and turnRight ===&lt;br /&gt;
This one is pretty easy as well. It makes your turtle move 1 block in the direction you used(its obvious which function goes where) and update its location according to where it went.&lt;br /&gt;
&lt;br /&gt;
=== jump ===&lt;br /&gt;
This one works a bit different. It makes the turtle go up, then go down. &amp;quot;But thats useless!&amp;quot; you might say, and indeed it is!&lt;br /&gt;
&lt;br /&gt;
[[Category:Unofficial APIs]] [[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Login_with_Roaming_Profiles&amp;diff=5972</id>
		<title>Login with Roaming Profiles</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Login_with_Roaming_Profiles&amp;diff=5972"/>
				<updated>2013-08-28T05:53:35Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This tutorial covers how to make a password server and a password client. The server will host a Lua table of usernames and passwords and the client will remotely connect each start up, ask the user for their username and password and compare it to that on the password server.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Setting Up ==&lt;br /&gt;
First of all, you must know how to craft a [[Wireless_Modem|wireless modem]] and a [[Computer|computer]]. You need to craft at least 2 wireless modems and 2 computers if you want to have a practical use for this system. Then, attach 1 modem to each computer you want to add to the system.&lt;br /&gt;
&lt;br /&gt;
Second, since typing on normal computers is relatively slow and annoying, I recommend to write the programs in [[Advanced_Computers|advanced computers]](because in advanced computers you can click to move the cursor around, and there are colors to distinguis between different statements), copying them into a [[Floppy|disk]] and moving them into each computer you want to include(with their respective programs of course). Alternatively, if you are the server owner(this tutorial assumes you are in Multiplayer because this system does not have any practical use in Singleplayer), you can go into the world folder and write copy/paste the source code into the folders of each computer you want to use. The folders you should use are the named the IDs of the computers(so if you have 3 computers, with the IDs 5, 7 and 9, you should copy them into the folders 5, 7 and 9). &lt;br /&gt;
&lt;br /&gt;
It does not matter wether you are using Normal or Advanced computers for this tutorial. I recommend to use Normal ones for the server.&lt;br /&gt;
&lt;br /&gt;
When writing the programs, I HIGHLY recommend using a [[Disk_Drive|disk drive]] like stated above, so you dont have to write in prograns for every computer you add.&lt;br /&gt;
Remember to read the text behind the --. These are comments, and you can safely leave them in the code.&lt;br /&gt;
&lt;br /&gt;
== Server ==&lt;br /&gt;
 print(&amp;quot;Initializing...&amp;quot;)&lt;br /&gt;
 local validSender = false&lt;br /&gt;
 valid = false&lt;br /&gt;
 tserved, vserved, dserved = 0&lt;br /&gt;
 &lt;br /&gt;
 print(&amp;quot;Loading startup settings...&amp;quot;)&lt;br /&gt;
 count = true -- If you dont want the server to count request statics, set the value of this variable to &amp;quot;false&amp;quot; without qoutes.&lt;br /&gt;
 modemSide = &amp;quot;left&amp;quot; -- change to the side of the computer your modem is on&lt;br /&gt;
 whitelist = true -- If you dont want to use a whitelist, change the value to &amp;quot;false&amp;quot; without quotes. This is not recommended on Multiplayer, but it does not make any difference on a Singleplayer World.&lt;br /&gt;
 &lt;br /&gt;
 print(&amp;quot;Loading user database...&amp;quot;)&lt;br /&gt;
 users = {&amp;quot;username1&amp;quot;, &amp;quot;username2&amp;quot; } -- Change this to the names for the users you want to have. Make sure the usernames are in the same order as in the password table. Changing the order is fine, but you must maintain the same order in both the users and passwords tables. Incorrect orders WILL cause 2 or more users not being able to log in!&lt;br /&gt;
 passwords = {&amp;quot;password1&amp;quot;, &amp;quot;password2&amp;quot; } -- Change this to the passwords for the users defined in the variable above. Again, make sure the passwords for users are in the same order as the usernames.&lt;br /&gt;
 senders = { 1, 2, 3, 4 } -- change this to the ID's of the all computers you want to accept requests from if you use a whitelist. If you do not use a whitelist, DO NOT REMOVE THIS LINE! Doing so will cause the program to crash everytime it is run, even though the variable is not used.&lt;br /&gt;
 &lt;br /&gt;
 print(&amp;quot;Loading core functions...&amp;quot;)&lt;br /&gt;
 function clear()&lt;br /&gt;
 term.clear()&lt;br /&gt;
 term.setCursorPos(1, 1)&lt;br /&gt;
 print(&amp;quot;CCLS Server 1.0 for CC 1.53&amp;quot;) &lt;br /&gt;
 print(&amp;quot;There is no user interaction here. Please contact your system administrator for assistance regarding the system.&amp;quot;)&lt;br /&gt;
 if count == true then&lt;br /&gt;
  print(tserved..&amp;quot; total requests received this session.&amp;quot;)&lt;br /&gt;
  print(vserved..&amp;quot; requests completed this session.&amp;quot;)&lt;br /&gt;
  print(dserved..&amp;quot; requests denied this session.&amp;quot;)&lt;br /&gt;
 elseif count == false then&lt;br /&gt;
  print(&amp;quot;Request statics have been disabled.&amp;quot;)&lt;br /&gt;
 else&lt;br /&gt;
  rednet.close(modemSide)&lt;br /&gt;
  term.clear()&lt;br /&gt;
  term.setCursorPos(1, 1)&lt;br /&gt;
  print(&amp;quot;Error: Counter setting is not boolean and the server can not continue.&amp;quot;)&lt;br /&gt;
  print(&amp;quot;The server program will exit automatically in 10 minutes. Or you can hold down Ctrl+T for 1 second.&amp;quot;)&lt;br /&gt;
  print(&amp;quot;After that, please set the variable \&amp;quot;count\&amp;quot; in the source code to either \&amp;quot;true\&amp;quot; or \&amp;quot;false\&amp;quot; WITHOUT QUOTATION MARKS. Doing this with quotation marks will cause the same error.&amp;quot;)&lt;br /&gt;
  sleep(600)&lt;br /&gt;
  shell.exit()&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 print(&amp;quot;Starting up...&amp;quot;)&lt;br /&gt;
 rednet.open(modemSide) -- Opens the modem to wait for incoming login requests&lt;br /&gt;
 &lt;br /&gt;
 clear()&lt;br /&gt;
 &lt;br /&gt;
 while true do &lt;br /&gt;
  validSender = false&lt;br /&gt;
  senderId, message, distance = rednet.receive()&lt;br /&gt;
  for i,v in ipairs(senders) do&lt;br /&gt;
   tserved = tserved + 1&lt;br /&gt;
   if v == senderId then&lt;br /&gt;
    validSender = true&lt;br /&gt;
    break&lt;br /&gt;
   else&lt;br /&gt;
    rednet.send(senderId, &amp;quot;301&amp;quot;, true) -- Send response code 301 - which means Not Whitelisted.&lt;br /&gt;
    dserved = dserved + 1&lt;br /&gt;
    clear()&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
  if validSender then&lt;br /&gt;
   for i,v in ipairs(users) do&lt;br /&gt;
    if message == v then&lt;br /&gt;
  password = passwords[i]&lt;br /&gt;
  rednet.send(senderId, password, true)&lt;br /&gt;
  vserved = vserved + 1&lt;br /&gt;
  clear()&lt;br /&gt;
  break&lt;br /&gt;
    else&lt;br /&gt;
  rednet.send(senderId, &amp;quot;300&amp;quot;, true) -- Send response code 300 - which means Bad Auth.&lt;br /&gt;
  dserved = dserved + 1&lt;br /&gt;
  clear()&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Client ==&lt;br /&gt;
 os.pullEvent = os.pullEventRaw&lt;br /&gt;
 local failed = true&lt;br /&gt;
 busr = &amp;quot;nsliq&amp;quot; -- If you ever happen to be unable to log in for some reason, you can use this username as a backup.&lt;br /&gt;
 bpass = &amp;quot;zuFUkVEjQKjkLQhTdpFMheNF&amp;quot; -- If you ever happen to be unable to log in for some reason, you can use this password as a backup.&lt;br /&gt;
 &lt;br /&gt;
 password_server = 0 -- change to the ID of your password server computer&lt;br /&gt;
 rednet.open(&amp;quot;left&amp;quot;) -- change to the side your rednet modem is on&lt;br /&gt;
 while true do&lt;br /&gt;
 term.clear()&lt;br /&gt;
 term.setCursorPos(1,1)&lt;br /&gt;
 print(&amp;quot;Welcome to CCLS 1.0 by Latias1290.&amp;quot;)&lt;br /&gt;
 print(&amp;quot;Please select an option.&amp;quot;)&lt;br /&gt;
 print(&amp;quot;[1] Login&amp;quot;)&lt;br /&gt;
 print(&amp;quot;[2] Shutdown&amp;quot;)&lt;br /&gt;
 write(&amp;quot;&amp;gt; &amp;quot;)&lt;br /&gt;
 input = read()&lt;br /&gt;
 if input == &amp;quot;2&amp;quot; then&lt;br /&gt;
  os.shutdown()&lt;br /&gt;
 elseif input == &amp;quot;1&amp;quot; then&lt;br /&gt;
  print(&amp;quot;Please login.&amp;quot;)&lt;br /&gt;
  write(&amp;quot;Username: &amp;quot;)&lt;br /&gt;
  username = read()&lt;br /&gt;
  write(&amp;quot;Password: &amp;quot;)&lt;br /&gt;
  password = read(&amp;quot;*&amp;quot;)&lt;br /&gt;
  if username == busr then&lt;br /&gt;
  if password == bpass then&lt;br /&gt;
 print(&amp;quot;Access granted&amp;quot;)&lt;br /&gt;
 break&lt;br /&gt;
  end&lt;br /&gt;
  end&lt;br /&gt;
  rednet.send(password_server, username, true)&lt;br /&gt;
  senderId, message, distance = rednet.receive(5)&lt;br /&gt;
  if message == &amp;quot;300&amp;quot; then&lt;br /&gt;
  print(&amp;quot;Invalid Username or Password.&amp;quot;)&lt;br /&gt;
  sleep(3)&lt;br /&gt;
  elseif password == message then&lt;br /&gt;
  failed = false&lt;br /&gt;
  term.clear()&lt;br /&gt;
  term.setCursorPos(1,1)&lt;br /&gt;
  print(&amp;quot;Welcome &amp;quot;, username)&lt;br /&gt;
  break;&lt;br /&gt;
  else&lt;br /&gt;
  print(&amp;quot;Invalid Username or Password.&amp;quot;)&lt;br /&gt;
  sleep(3)&lt;br /&gt;
  end&lt;br /&gt;
 else&lt;br /&gt;
  print(&amp;quot;Invalid Command.&amp;quot;)&lt;br /&gt;
  sleep(2)&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Old Server ==&lt;br /&gt;
''Note: This is here for reference for people who need the older version. I recommend using the programs above.''&lt;br /&gt;
&lt;br /&gt;
 os.pullEvent = os.pullEventRaw&lt;br /&gt;
 term.clear()&lt;br /&gt;
 term.setCursorPos(1,1)&lt;br /&gt;
 print(&amp;quot;This is a password server. There is no user interaction here.&amp;quot;)&lt;br /&gt;
 print(&amp;quot;Please find a computer and login there.&amp;quot;) &lt;br /&gt;
 local firstCycle = true&lt;br /&gt;
 local validSender = false&lt;br /&gt;
 local modemSide = &amp;quot;left&amp;quot; -- change to the side of the computer your modem is on&lt;br /&gt;
 local valid = false&lt;br /&gt;
 users = {&amp;quot;username1&amp;quot;, &amp;quot;username2&amp;quot; } --make sure users and passwords line up&lt;br /&gt;
 passwords = {&amp;quot;password1&amp;quot;, &amp;quot;password2&amp;quot; }&lt;br /&gt;
 senders = { 1, 2, 3, 4 } -- computer ID's of the computers you want to accept requests from&lt;br /&gt;
 function bootUp()&lt;br /&gt;
  rednet.open(modemSide)&lt;br /&gt;
 end&lt;br /&gt;
 while true do &lt;br /&gt;
  validSender = false&lt;br /&gt;
  if firstCycle then&lt;br /&gt;
   bootUp()&lt;br /&gt;
   firstCycle = false&lt;br /&gt;
  end&lt;br /&gt;
  senderId, message, distance = rednet.receive()&lt;br /&gt;
  for i,v in ipairs(senders) do&lt;br /&gt;
   if v == senderId then&lt;br /&gt;
    validSender = true&lt;br /&gt;
    break&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
  if validSender then&lt;br /&gt;
   for i,v in ipairs(users) do&lt;br /&gt;
    if message == v then&lt;br /&gt;
     valid = true&lt;br /&gt;
     password = passwords[i]&lt;br /&gt;
     break&lt;br /&gt;
    else&lt;br /&gt;
     valid = false&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
   if valid then&lt;br /&gt;
    rednet.send(senderId, password, true)&lt;br /&gt;
   else&lt;br /&gt;
    rednet.send(senderId, &amp;quot;Not Valid&amp;quot;, true)&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Old Client ==&lt;br /&gt;
&lt;br /&gt;
 os.pullEvent = os.pullEventRaw&lt;br /&gt;
 local locker = true&lt;br /&gt;
 local failed = true&lt;br /&gt;
 local attempted_login = true&lt;br /&gt;
 local password_server = 0 -- change to the ID of your password server computer&lt;br /&gt;
 rednet.open(&amp;quot;left&amp;quot;) -- change to the side your rednet modem is on&lt;br /&gt;
 while locker do&lt;br /&gt;
  attempted_login = false&lt;br /&gt;
  term.clear()&lt;br /&gt;
  term.setCursorPos(1,1)&lt;br /&gt;
  print(&amp;quot;Welcome to a USERS PC : Roaming Profile Enabled&amp;quot;)&lt;br /&gt;
  print(&amp;quot;What would you like to do?&amp;quot;)&lt;br /&gt;
  print(&amp;quot;[1] Login (*)&amp;quot;)&lt;br /&gt;
  print(&amp;quot;[2] Shutdown&amp;quot;)&lt;br /&gt;
  write(&amp;quot;&amp;gt; &amp;quot;)&lt;br /&gt;
  local input = read()&lt;br /&gt;
  if input == &amp;quot;2&amp;quot; then&lt;br /&gt;
   os.shutdown()&lt;br /&gt;
  elseif input == &amp;quot;1&amp;quot; then&lt;br /&gt;
   attempted_login = true&lt;br /&gt;
   print(&amp;quot;Please login...&amp;quot;)&lt;br /&gt;
   write(&amp;quot;Username: &amp;quot;)&lt;br /&gt;
   local username = read()&lt;br /&gt;
   write(&amp;quot;Password: &amp;quot;)&lt;br /&gt;
   local password = read(&amp;quot;*&amp;quot;)&lt;br /&gt;
   rednet.send(password_server, username, true)&lt;br /&gt;
   senderId, message, distance = rednet.receive(5)&lt;br /&gt;
   if password == message then&lt;br /&gt;
    failed = false&lt;br /&gt;
    locker = false&lt;br /&gt;
    term.clear()&lt;br /&gt;
    term.setCursorPos(1,1)&lt;br /&gt;
    print(&amp;quot;Welcome &amp;quot;, username)&lt;br /&gt;
   else&lt;br /&gt;
    print(&amp;quot;Invalid Username or Password.&amp;quot;)&lt;br /&gt;
    sleep(3)&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Command not recognised...&amp;quot;)&lt;br /&gt;
   sleep(2)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Thoughts and Notes ==&lt;br /&gt;
''Note: You do not have to read these if you use the new system.''&amp;lt;br /&amp;gt;&lt;br /&gt;
Although this may work very well as a login system, it is insecure by the flaw that a malicious sniffer can unnoticeably obtain a copy of the password while it is being sent as described on the [[Rednet_(API)|Rednet API]] page, and use the password to login.&lt;br /&gt;
&lt;br /&gt;
If you change the client code, to &amp;quot;startup&amp;quot; and put it in the root directory, it works very well as a login system.&lt;br /&gt;
You may also want to put in the line &lt;br /&gt;
 os.pullEvent = os.pullEventRaw -- disables Ctrl+T&lt;br /&gt;
as if it doesn't work first time it can be difficult to get out of the program.&lt;br /&gt;
&lt;br /&gt;
If you have either Railcraft or Additional Pipes, find the 'World Anchor' or 'Teleport Tether' block. If your server can afford the resources, place the block within a 3x3 grid of your password server. It will ensure that even if you leave the chunk, the password server still is operational. Otherwise you may find that you cannot login because you've left the chunk and the password server is no longer dealing with requests.&lt;br /&gt;
&lt;br /&gt;
This is a minor security flaw but it is only if someone has access to a computer that is 'whitelisted' to access the password server. The security flaw is that if they use the password Not Valid on that computer they are allowed access;&lt;br /&gt;
&lt;br /&gt;
 if valid then&lt;br /&gt;
  --send client password&lt;br /&gt;
 else&lt;br /&gt;
  --send client Not Valid&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
to fix remove the else statement&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Programs]]&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Turtle_GPS_self-tracker_expansion_(tutorial)&amp;diff=5970</id>
		<title>Turtle GPS self-tracker expansion (tutorial)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Turtle_GPS_self-tracker_expansion_(tutorial)&amp;diff=5970"/>
				<updated>2013-08-28T05:51:57Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial will teach you how to make a [[Turtle]] more efficient in keeping track of its location when using the [[Gps_(API)|GPS API]]. This is essentially an API that uses the native Turtle movement API while using its own movement as a sensor to keep track of its location, so it only requires a GPS signal once, until it is turned off. This API requires every Turtle you want to use the API with to have it installed. I recommend using an [[Advanced_Computer|Advanced Computer]] to write it on, move it to a [[Disk]] with a [[Disk_Drive|disk drive]] and moving it to the Turtle. Alternatively, if you are on Singleplayer or a Multiplayer admin and have access to the mod file, you can move it into the turtle/rom folder to have it automatically installed on every new turtle that is placed.&lt;br /&gt;
&lt;br /&gt;
Important: When starting, the program assumes that it is facing west, so first you must face West and then place the turtle. Here are some ways to check where you are facing:&lt;br /&gt;
You can see the sun/moon rising right in front of you. You are facing East.&lt;br /&gt;
You can see the sun/moon falling right in front of you. You are facing West.&lt;br /&gt;
Clouds go west. Check where they go.&lt;br /&gt;
Press F3 and locate the number behind &amp;quot;f&amp;quot;. This one is below &amp;quot;x&amp;quot;, &amp;quot;y&amp;quot; and &amp;quot;z&amp;quot;. If this number is 0, you are facing North. If this number is 1, you are facing West. If this number is 2, you are facing South. If this number is 3, you are facing East.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
''Note: This will only work on a Turtle. That said, even if it worked on a [[Computer|computer]], it wouldnt have any practical use because a computer cant move.''&amp;lt;br /&amp;gt;&lt;br /&gt;
Before you start, you must add this to the program that you want to use it with at the top line:&lt;br /&gt;
 os.loadApi(&amp;quot;tst&amp;quot;)&lt;br /&gt;
This will allow the program to use the API. This tutorial assumes that you use the file name &amp;quot;tst&amp;quot; for the API, but if you like to you can change it. You must then also change every reference to &amp;quot;tst&amp;quot; in your program, including the line above.&lt;br /&gt;
Write this in the computer/turtle:&lt;br /&gt;
&lt;br /&gt;
 -- Turtle Self-tracking System created by Latias1290.&lt;br /&gt;
 &lt;br /&gt;
 local xPos, yPos, zPos = nil&lt;br /&gt;
 face = 1&lt;br /&gt;
 cal = false&lt;br /&gt;
 &lt;br /&gt;
 function setLocation() -- get gps using other computers&lt;br /&gt;
  xPos, yPos, zPos = gps.locate()&lt;br /&gt;
  cal = true&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function manSetLocation(number x, number y, number z) -- manually set location&lt;br /&gt;
  xPos = x&lt;br /&gt;
  yPos = y&lt;br /&gt;
  zPos = z&lt;br /&gt;
  cal = true&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function getLocation() -- return the location&lt;br /&gt;
  if xPos != nil then&lt;br /&gt;
   return xPos, yPos, zPos&lt;br /&gt;
  elseif xPos == nil then&lt;br /&gt;
   return nil&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function turnLeft() -- turn left&lt;br /&gt;
  if face == 0 then&lt;br /&gt;
   face = 1&lt;br /&gt;
  elseif face == 1 then&lt;br /&gt;
   face = 2&lt;br /&gt;
  elseif face == 2 then&lt;br /&gt;
   face = 3&lt;br /&gt;
  elseif face == 3 then&lt;br /&gt;
   face = 0&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function turnRight() -- turn right&lt;br /&gt;
  if face == 0 then&lt;br /&gt;
   face = 3&lt;br /&gt;
  elseif face == 1 then&lt;br /&gt;
   face = 0&lt;br /&gt;
  elseif face == 2 then&lt;br /&gt;
   face = 1&lt;br /&gt;
  elseif face == 3 then&lt;br /&gt;
   face = 2&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function forward() -- go forward&lt;br /&gt;
  turtle.forward()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   if face == 0 then&lt;br /&gt;
    zPos = zPos - 1&lt;br /&gt;
   elseif face == 1 then&lt;br /&gt;
    xPos = xPos - 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    zPos = zPos + 1&lt;br /&gt;
   elseif face == 3 then&lt;br /&gt;
    xPos = xPos + 1&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function back() -- go back&lt;br /&gt;
  turtle.back()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   if face == 0 then&lt;br /&gt;
    zPos = zPos + 1&lt;br /&gt;
   elseif face == 1 then&lt;br /&gt;
    xPos = xPos + 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    zPos = zPos - 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    xPos = xPos - 1&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function up() -- go up&lt;br /&gt;
  turtle.up()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   yPos = yPos + 1&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function down() -- go down&lt;br /&gt;
  turtle.down()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   yPos = yPos - 1&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  function jump() -- perform a jump. useless? yup!&lt;br /&gt;
   turtle.up()&lt;br /&gt;
   turtle.down()&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== How to Use ==&lt;br /&gt;
This might seem daunting at the first moment. But dont worry, I will walk you through it. Note that to use it properly, you must always put &amp;quot;tst.&amp;quot; in front of it, or how you named it followed by a dot. So if I wanted to have my turtle go 1 block forward, I typed &amp;quot;tst.forward()&amp;quot;. Note that if you do not do either tst.getLocation OR tst.setLocation(coords), the API will print &amp;quot;Not Calibrated.&amp;quot; every time you use a command. This will not prevent you from using it, however.&lt;br /&gt;
&lt;br /&gt;
=== setLocation ===&lt;br /&gt;
To use this, you will need at least 4 computers equipped with a Wireless Modem, and having it host a GPS. More info about that [[Gps_(API)|here]] and [[Gps_(program)|here]].&lt;br /&gt;
&lt;br /&gt;
=== manSetLocation ===&lt;br /&gt;
For this one you will need to know the location of your turtle. Any location will work, but the API loses its point if you use another coordinate set.&lt;br /&gt;
A good way to obtain the coordinates is to open up the debug screen(press F3), stand on the turtle, write down the x, y and z fields, substract 1 from the Y coordinate and use these.&lt;br /&gt;
&lt;br /&gt;
=== getLocation ===&lt;br /&gt;
This one is pretty simple. It returns the coordinates. Note that you will have to overwrite all of them.&lt;br /&gt;
For example, if we had the variables x, y and z, and we wanted to have the value set to our location, we did this:&lt;br /&gt;
 x, y, z = tst.getLocation()&lt;br /&gt;
Simple right? Note that this will return nil if you are not calibrated, which means if you do it before you do setLocation or manSetLocation, x, y and z will be null!&lt;br /&gt;
&lt;br /&gt;
=== forward, back, up, down, turnLeft and turnRight ===&lt;br /&gt;
This one is pretty easy as well. It makes your turtle move 1 block in the direction you used(its obvious which function goes where) and update its location according to where it went.&lt;br /&gt;
&lt;br /&gt;
=== jump ===&lt;br /&gt;
This one works a bit different. It makes the turtle go up, then go down. &amp;quot;But thats useless!&amp;quot; you might say, and indeed it is!&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Turtle_GPS_self-tracker_expansion_(tutorial)&amp;diff=5969</id>
		<title>Turtle GPS self-tracker expansion (tutorial)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Turtle_GPS_self-tracker_expansion_(tutorial)&amp;diff=5969"/>
				<updated>2013-08-28T05:51:48Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial will teach you how to make a [[Turtle]] more efficient in keeping track of its location when using the [[Gps_(API)|GPS API]]. This is essentially an API that uses the native Turtle movement API while using its own movement as a sensor to keep track of its location, so it only requires a GPS signal once, until it is turned off. This API requires every Turtle you want to use the API with to have it installed. I recommend using an [[Advanced_Computer|Advanced Computer]] to write it on, move it to a [[Disk]] with a [[Disk_Drive|disk drive]] and moving it to the Turtle. Alternatively, if you are on Singleplayer or a Multiplayer admin and have access to the mod file, you can move it into the turtle/rom folder to have it automatically installed on every new turtle that is placed.&lt;br /&gt;
&lt;br /&gt;
Important: When starting, the program assumes that it is facing west, so first you must face West and then place the turtle. Here are some ways to check where you are facing:&lt;br /&gt;
You can see the sun/moon rising right in front of you. You are facing East.&lt;br /&gt;
You can see the sun/moon falling right in front of you. You are facing West.&lt;br /&gt;
Clouds go west. Check where they go.&lt;br /&gt;
Press F3 and locate the number behind &amp;quot;f&amp;quot;. This one is below &amp;quot;x&amp;quot;, &amp;quot;y&amp;quot; and &amp;quot;z&amp;quot;. If this number is 0, you are facing North. If this number is 1, you are facing West. If this number is 2, you are facing South. If this number is 3, you are facing East.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
''Note: This will only work on a Turtle. That said, even if it worked on a [[Computer|computer]], it wouldnt have any practical use because a computer cant move.''&amp;lt;br /&amp;gt;&lt;br /&gt;
Before you start, you must add this to the program that you want to use it with at the top line:&lt;br /&gt;
 os.loadApi(&amp;quot;tst&amp;quot;)&lt;br /&gt;
This will allow the program to use the API. This tutorial assumes that you use the file name &amp;quot;tst&amp;quot; for the API, but if you like to you can change it. You must then also change every reference to &amp;quot;tst&amp;quot; in your program, including the line above.&lt;br /&gt;
Write this in the computer/turtle:&lt;br /&gt;
&lt;br /&gt;
 -- Turtle Self-tracking System created by Latias1290.&lt;br /&gt;
&lt;br /&gt;
 local xPos, yPos, zPos = nil&lt;br /&gt;
 face = 1&lt;br /&gt;
 cal = false&lt;br /&gt;
 &lt;br /&gt;
 function setLocation() -- get gps using other computers&lt;br /&gt;
  xPos, yPos, zPos = gps.locate()&lt;br /&gt;
  cal = true&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function manSetLocation(number x, number y, number z) -- manually set location&lt;br /&gt;
  xPos = x&lt;br /&gt;
  yPos = y&lt;br /&gt;
  zPos = z&lt;br /&gt;
  cal = true&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function getLocation() -- return the location&lt;br /&gt;
  if xPos != nil then&lt;br /&gt;
   return xPos, yPos, zPos&lt;br /&gt;
  elseif xPos == nil then&lt;br /&gt;
   return nil&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function turnLeft() -- turn left&lt;br /&gt;
  if face == 0 then&lt;br /&gt;
   face = 1&lt;br /&gt;
  elseif face == 1 then&lt;br /&gt;
   face = 2&lt;br /&gt;
  elseif face == 2 then&lt;br /&gt;
   face = 3&lt;br /&gt;
  elseif face == 3 then&lt;br /&gt;
   face = 0&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function turnRight() -- turn right&lt;br /&gt;
  if face == 0 then&lt;br /&gt;
   face = 3&lt;br /&gt;
  elseif face == 1 then&lt;br /&gt;
   face = 0&lt;br /&gt;
  elseif face == 2 then&lt;br /&gt;
   face = 1&lt;br /&gt;
  elseif face == 3 then&lt;br /&gt;
   face = 2&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function forward() -- go forward&lt;br /&gt;
  turtle.forward()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   if face == 0 then&lt;br /&gt;
    zPos = zPos - 1&lt;br /&gt;
   elseif face == 1 then&lt;br /&gt;
    xPos = xPos - 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    zPos = zPos + 1&lt;br /&gt;
   elseif face == 3 then&lt;br /&gt;
    xPos = xPos + 1&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function back() -- go back&lt;br /&gt;
  turtle.back()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   if face == 0 then&lt;br /&gt;
    zPos = zPos + 1&lt;br /&gt;
   elseif face == 1 then&lt;br /&gt;
    xPos = xPos + 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    zPos = zPos - 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    xPos = xPos - 1&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function up() -- go up&lt;br /&gt;
  turtle.up()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   yPos = yPos + 1&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function down() -- go down&lt;br /&gt;
  turtle.down()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   yPos = yPos - 1&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  function jump() -- perform a jump. useless? yup!&lt;br /&gt;
   turtle.up()&lt;br /&gt;
   turtle.down()&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== How to Use ==&lt;br /&gt;
This might seem daunting at the first moment. But dont worry, I will walk you through it. Note that to use it properly, you must always put &amp;quot;tst.&amp;quot; in front of it, or how you named it followed by a dot. So if I wanted to have my turtle go 1 block forward, I typed &amp;quot;tst.forward()&amp;quot;. Note that if you do not do either tst.getLocation OR tst.setLocation(coords), the API will print &amp;quot;Not Calibrated.&amp;quot; every time you use a command. This will not prevent you from using it, however.&lt;br /&gt;
&lt;br /&gt;
=== setLocation ===&lt;br /&gt;
To use this, you will need at least 4 computers equipped with a Wireless Modem, and having it host a GPS. More info about that [[Gps_(API)|here]] and [[Gps_(program)|here]].&lt;br /&gt;
&lt;br /&gt;
=== manSetLocation ===&lt;br /&gt;
For this one you will need to know the location of your turtle. Any location will work, but the API loses its point if you use another coordinate set.&lt;br /&gt;
A good way to obtain the coordinates is to open up the debug screen(press F3), stand on the turtle, write down the x, y and z fields, substract 1 from the Y coordinate and use these.&lt;br /&gt;
&lt;br /&gt;
=== getLocation ===&lt;br /&gt;
This one is pretty simple. It returns the coordinates. Note that you will have to overwrite all of them.&lt;br /&gt;
For example, if we had the variables x, y and z, and we wanted to have the value set to our location, we did this:&lt;br /&gt;
 x, y, z = tst.getLocation()&lt;br /&gt;
Simple right? Note that this will return nil if you are not calibrated, which means if you do it before you do setLocation or manSetLocation, x, y and z will be null!&lt;br /&gt;
&lt;br /&gt;
=== forward, back, up, down, turnLeft and turnRight ===&lt;br /&gt;
This one is pretty easy as well. It makes your turtle move 1 block in the direction you used(its obvious which function goes where) and update its location according to where it went.&lt;br /&gt;
&lt;br /&gt;
=== jump ===&lt;br /&gt;
This one works a bit different. It makes the turtle go up, then go down. &amp;quot;But thats useless!&amp;quot; you might say, and indeed it is!&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=User_talk:AfterLifeLochie&amp;diff=5968</id>
		<title>User talk:AfterLifeLochie</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=User_talk:AfterLifeLochie&amp;diff=5968"/>
				<updated>2013-08-28T05:51:28Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: /* Why did you revert my edits? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Another test. Ignore this.&lt;br /&gt;
&lt;br /&gt;
== Why did you revert my changes on the function and example templates? ==&lt;br /&gt;
&lt;br /&gt;
The 24px ones were really small and blurry. --[[Special:Contributions/67.189.72.22|67.189.72.22]] 13:17, 3 December 2012 (MSK)&lt;br /&gt;
* The templates are optimized for screen-readers at present, and are only meant to be a complimentary object. In addition, the files themselves are actually blurry and aren't rendered in high-enough definition. If and when I get FTP access, I can setup a better system than the current one, but the most important point; ''please don't edit live production templates without using a sandbox''. The effects of a template bungle could be a potential eye-sore. ''[[User:AfterLifeLochie|AfterLifeLochie]] 13:22, 3 December 2012 (MSK)''&lt;br /&gt;
&lt;br /&gt;
== APT Minecraft Tekkit window. ==&lt;br /&gt;
&lt;br /&gt;
Lochie, I was viewing your new forum thread on ComputerCraft APT and realised you were running Tekkit. I am glad that not all of the Mod Admins are so hardcoming on the Technic Team. Yours, [[User:Jonjon1234|Jonjon1234]] 15:51, 14 December 2012 (MSK)&lt;br /&gt;
&lt;br /&gt;
== Program Listing? ==&lt;br /&gt;
&lt;br /&gt;
Question for you:  As a rookie to CC, I find it really hard to track down APIs or Programs in the forums for such.  Sites like Turtlescripts have spawned trying to be a better browseable index of programs.&lt;br /&gt;
&lt;br /&gt;
Would it make sense to have a Program Catalog on the site?  I was thinking relatively lightweight, a table with the name, author, summary, current supported version, and a link to the Programs forum thread for it.  Possibly have different sections for the major groupings, such as API, OS, Turtles, etc.  I can do a mock-up version of what I'm describing if I'm describing poorly.  Having posted a couple programs (and more to come), I'd have no issue creating a forum thread, then adding it to a Wiki page.  I'd prefer the visibility. [[User:Rihlsul|Rihlsul]] 07:04, 27 March 2013 (MSK)&lt;br /&gt;
&lt;br /&gt;
== Why did you revert my edits? ==&lt;br /&gt;
&lt;br /&gt;
I just noticed my new version on [[Login_with_Roaming_Profiles|this page]] was removed, can you please tell me why? [[User:Latias1290|Latias1290]] 05:45, 28 August 2013 (GMT)&lt;br /&gt;
&lt;br /&gt;
* Do not paste copyrighted or 'copyrighted' code, text or images on the ComputerCraft Wiki. By pasting code, text and content you release it to the public domain and I cannot assert you own said code due to the comments and 'copyright lines'. ''[[User:AfterLifeLochie|AfterLifeLochie]] 05:50, 28 August 2013 (GMT)''&lt;br /&gt;
::I thought it was fine because &amp;quot;Dirk Kok&amp;quot; is my real name, but Ill leave it out. [[User:Latias1290|Latias1290]] 05:51, 28 August 2013 (GMT)&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=User_talk:AfterLifeLochie&amp;diff=5966</id>
		<title>User talk:AfterLifeLochie</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=User_talk:AfterLifeLochie&amp;diff=5966"/>
				<updated>2013-08-28T05:45:19Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: /* Why did you revert my edits? */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Another test. Ignore this.&lt;br /&gt;
&lt;br /&gt;
== Why did you revert my changes on the function and example templates? ==&lt;br /&gt;
&lt;br /&gt;
The 24px ones were really small and blurry. --[[Special:Contributions/67.189.72.22|67.189.72.22]] 13:17, 3 December 2012 (MSK)&lt;br /&gt;
* The templates are optimized for screen-readers at present, and are only meant to be a complimentary object. In addition, the files themselves are actually blurry and aren't rendered in high-enough definition. If and when I get FTP access, I can setup a better system than the current one, but the most important point; ''please don't edit live production templates without using a sandbox''. The effects of a template bungle could be a potential eye-sore. ''[[User:AfterLifeLochie|AfterLifeLochie]] 13:22, 3 December 2012 (MSK)''&lt;br /&gt;
&lt;br /&gt;
== APT Minecraft Tekkit window. ==&lt;br /&gt;
&lt;br /&gt;
Lochie, I was viewing your new forum thread on ComputerCraft APT and realised you were running Tekkit. I am glad that not all of the Mod Admins are so hardcoming on the Technic Team. Yours, [[User:Jonjon1234|Jonjon1234]] 15:51, 14 December 2012 (MSK)&lt;br /&gt;
&lt;br /&gt;
== Program Listing? ==&lt;br /&gt;
&lt;br /&gt;
Question for you:  As a rookie to CC, I find it really hard to track down APIs or Programs in the forums for such.  Sites like Turtlescripts have spawned trying to be a better browseable index of programs.&lt;br /&gt;
&lt;br /&gt;
Would it make sense to have a Program Catalog on the site?  I was thinking relatively lightweight, a table with the name, author, summary, current supported version, and a link to the Programs forum thread for it.  Possibly have different sections for the major groupings, such as API, OS, Turtles, etc.  I can do a mock-up version of what I'm describing if I'm describing poorly.  Having posted a couple programs (and more to come), I'd have no issue creating a forum thread, then adding it to a Wiki page.  I'd prefer the visibility. [[User:Rihlsul|Rihlsul]] 07:04, 27 March 2013 (MSK)&lt;br /&gt;
&lt;br /&gt;
== Why did you revert my edits? ==&lt;br /&gt;
&lt;br /&gt;
I just noticed my new version on [[Login_with_Roaming_Profiles|this page]] was removed, can you please tell me why? [[User:Latias1290|Latias1290]] 05:45, 28 August 2013 (GMT)&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Turtle_GPS_self-tracker_expansion_(tutorial)&amp;diff=5965</id>
		<title>Turtle GPS self-tracker expansion (tutorial)</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Turtle_GPS_self-tracker_expansion_(tutorial)&amp;diff=5965"/>
				<updated>2013-08-28T05:42:59Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: Created page with &amp;quot;This tutorial will teach you how to make a Turtle more efficient in keeping track of its location when using the GPS API. This is essentially an API that use...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial will teach you how to make a [[Turtle]] more efficient in keeping track of its location when using the [[Gps_(API)|GPS API]]. This is essentially an API that uses the native Turtle movement API while using its own movement as a sensor to keep track of its location, so it only requires a GPS signal once, until it is turned off. This API requires every Turtle you want to use the API with to have it installed. I recommend using an [[Advanced_Computer|Advanced Computer]] to write it on, move it to a [[Disk]] with a [[Disk_Drive|disk drive]] and moving it to the Turtle. Alternatively, if you are on Singleplayer or a Multiplayer admin and have access to the mod file, you can move it into the turtle/rom folder to have it automatically installed on every new turtle that is placed.&lt;br /&gt;
&lt;br /&gt;
Important: When starting, the program assumes that it is facing west, so first you must face West and then place the turtle. Here are some ways to check where you are facing:&lt;br /&gt;
You can see the sun/moon rising right in front of you. You are facing East.&lt;br /&gt;
You can see the sun/moon falling right in front of you. You are facing West.&lt;br /&gt;
Clouds go west. Check where they go.&lt;br /&gt;
Press F3 and locate the number behind &amp;quot;f&amp;quot;. This one is below &amp;quot;x&amp;quot;, &amp;quot;y&amp;quot; and &amp;quot;z&amp;quot;. If this number is 0, you are facing North. If this number is 1, you are facing West. If this number is 2, you are facing South. If this number is 3, you are facing East.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
''Note: This will only work on a Turtle. That said, even if it worked on a [[Computer|computer]], it wouldnt have any practical use because a computer cant move.''&amp;lt;br /&amp;gt;&lt;br /&gt;
Before you start, you must add this to the program that you want to use it with at the top line:&lt;br /&gt;
 os.loadApi(&amp;quot;tst&amp;quot;)&lt;br /&gt;
This will allow the program to use the API. This tutorial assumes that you use the file name &amp;quot;tst&amp;quot; for the API, but if you like to you can change it. You must then also change every reference to &amp;quot;tst&amp;quot; in your program, including the line above.&lt;br /&gt;
Write this in the computer/turtle:&lt;br /&gt;
&lt;br /&gt;
 -- Turtle Self-tracking System created by Latias1290.&lt;br /&gt;
 -- Copyright (c) Dirk Kok 2013.&lt;br /&gt;
 &lt;br /&gt;
 local xPos, yPos, zPos = nil&lt;br /&gt;
 face = 1&lt;br /&gt;
 cal = false&lt;br /&gt;
 &lt;br /&gt;
 function setLocation() -- get gps using other computers&lt;br /&gt;
  xPos, yPos, zPos = gps.locate()&lt;br /&gt;
  cal = true&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function manSetLocation(number x, number y, number z) -- manually set location&lt;br /&gt;
  xPos = x&lt;br /&gt;
  yPos = y&lt;br /&gt;
  zPos = z&lt;br /&gt;
  cal = true&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function getLocation() -- return the location&lt;br /&gt;
  if xPos != nil then&lt;br /&gt;
   return xPos, yPos, zPos&lt;br /&gt;
  elseif xPos == nil then&lt;br /&gt;
   return nil&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function turnLeft() -- turn left&lt;br /&gt;
  if face == 0 then&lt;br /&gt;
   face = 1&lt;br /&gt;
  elseif face == 1 then&lt;br /&gt;
   face = 2&lt;br /&gt;
  elseif face == 2 then&lt;br /&gt;
   face = 3&lt;br /&gt;
  elseif face == 3 then&lt;br /&gt;
   face = 0&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function turnRight() -- turn right&lt;br /&gt;
  if face == 0 then&lt;br /&gt;
   face = 3&lt;br /&gt;
  elseif face == 1 then&lt;br /&gt;
   face = 0&lt;br /&gt;
  elseif face == 2 then&lt;br /&gt;
   face = 1&lt;br /&gt;
  elseif face == 3 then&lt;br /&gt;
   face = 2&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function forward() -- go forward&lt;br /&gt;
  turtle.forward()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   if face == 0 then&lt;br /&gt;
    zPos = zPos - 1&lt;br /&gt;
   elseif face == 1 then&lt;br /&gt;
    xPos = xPos - 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    zPos = zPos + 1&lt;br /&gt;
   elseif face == 3 then&lt;br /&gt;
    xPos = xPos + 1&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function back() -- go back&lt;br /&gt;
  turtle.back()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   if face == 0 then&lt;br /&gt;
    zPos = zPos + 1&lt;br /&gt;
   elseif face == 1 then&lt;br /&gt;
    xPos = xPos + 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    zPos = zPos - 1&lt;br /&gt;
   elseif face == 2 then&lt;br /&gt;
    xPos = xPos - 1&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function up() -- go up&lt;br /&gt;
  turtle.up()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   yPos = yPos + 1&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 function down() -- go down&lt;br /&gt;
  turtle.down()&lt;br /&gt;
  if cal == true then&lt;br /&gt;
   yPos = yPos - 1&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Not Calibrated.&amp;quot;)&lt;br /&gt;
  end&lt;br /&gt;
  &lt;br /&gt;
  function jump() -- perform a jump. useless? yup!&lt;br /&gt;
   turtle.up()&lt;br /&gt;
   turtle.down()&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
== How to Use ==&lt;br /&gt;
This might seem daunting at the first moment. But dont worry, I will walk you through it. Note that to use it properly, you must always put &amp;quot;tst.&amp;quot; in front of it, or how you named it followed by a dot. So if I wanted to have my turtle go 1 block forward, I typed &amp;quot;tst.forward()&amp;quot;. Note that if you do not do either tst.getLocation OR tst.setLocation(coords), the API will print &amp;quot;Not Calibrated.&amp;quot; every time you use a command. This will not prevent you from using it, however.&lt;br /&gt;
&lt;br /&gt;
=== setLocation ===&lt;br /&gt;
To use this, you will need at least 4 computers equipped with a Wireless Modem, and having it host a GPS. More info about that [[Gps_(API)|here]] and [[Gps_(program)|here]].&lt;br /&gt;
&lt;br /&gt;
=== manSetLocation ===&lt;br /&gt;
For this one you will need to know the location of your turtle. Any location will work, but the API loses its point if you use another coordinate set.&lt;br /&gt;
A good way to obtain the coordinates is to open up the debug screen(press F3), stand on the turtle, write down the x, y and z fields, substract 1 from the Y coordinate and use these.&lt;br /&gt;
&lt;br /&gt;
=== getLocation ===&lt;br /&gt;
This one is pretty simple. It returns the coordinates. Note that you will have to overwrite all of them.&lt;br /&gt;
For example, if we had the variables x, y and z, and we wanted to have the value set to our location, we did this:&lt;br /&gt;
 x, y, z = tst.getLocation()&lt;br /&gt;
Simple right? Note that this will return nil if you are not calibrated, which means if you do it before you do setLocation or manSetLocation, x, y and z will be null!&lt;br /&gt;
&lt;br /&gt;
=== forward, back, up, down, turnLeft and turnRight ===&lt;br /&gt;
This one is pretty easy as well. It makes your turtle move 1 block in the direction you used(its obvious which function goes where) and update its location according to where it went.&lt;br /&gt;
&lt;br /&gt;
=== jump ===&lt;br /&gt;
This one works a bit different. It makes the turtle go up, then go down. &amp;quot;But thats useless!&amp;quot; you might say, and indeed it is!&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Turtle&amp;diff=5964</id>
		<title>Turtle</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Turtle&amp;diff=5964"/>
				<updated>2013-08-28T04:10:16Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: /* its correct */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Turtles''' are essentially robots, and were added in the 1.3 update. They run an OS, like the [[Computer|Computers]], named [[TurtleOS]]. They have the ability to place, break and detect blocks, move around and drop items in their inventory. The programs they run are stored on its internal memory or [[Floppy Disk|floppy disks]].&lt;br /&gt;
&lt;br /&gt;
The 1.4 update was focused on turtles, and expanded the turtle's ability to use tools. Turtles are capable of using pickaxes, hoes, axes, shovels and swords. The update added &amp;quot;Crafty Turtles&amp;quot;, which have the ability to craft using their inventory - and part of this upgrade saw the number of inventory slots in the Turtle raised to 16 - over the previous 9 slot inventory. The 1.4 update also included a new fuel system for the turtles.&lt;br /&gt;
&lt;br /&gt;
The 1.55 update added advanced turtles. Advanced Turtles are made of gold and are able to display color and have mouse input on their display. Their exterior looks are also gold. They're just like [[Advanced Computer|Advanced Computers]].&lt;br /&gt;
&lt;br /&gt;
Turtles are submersible and lavaproof. As such, they are extremely useful for mining near bedrock, where heavy lava flows can prevent access to diamonds and other rare finds.&lt;br /&gt;
&lt;br /&gt;
If you would like to know more about how to program them, have a look at the [[Turtle (API)|Turtle API]].&lt;br /&gt;
&lt;br /&gt;
Keep in mind, that turtles will not keep their programs unless they are labelled. To do so, you simply need to type in &amp;quot;label set labelName&amp;quot;. This will label your turtle with the specified label, in this case &amp;quot;labelName&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Floppy Disks and Peripherals==&lt;br /&gt;
Turtles do not have a built-in [[Disk Drive]]. As such, they need a [[Disk Drive]] placed beside them to access [[Floppy Disk|Floppy Disks]]. However, if the Turtle is of the Wireless family, the [[Disk Drive]] (and other peripherals) must be placed on a side other than the side the [[Wireless Modem|wireless modem]] is on. Any other peripherals, such as [[Monitor|Monitors]] and [[Printer|Printers]] can be interacted using the peripheral API.&lt;br /&gt;
&lt;br /&gt;
==Power source==&lt;br /&gt;
Turtles require fuel to operate - this means Turtles must be powered from any item that works in a regular furnace, like coal and lava. The turtle gains 0.6 &amp;quot;movement&amp;quot; per half second the fuel would have burnt in a furnace. The Turtle can move 1 block for each fuel count it has, for example, coal yields 96 block movements. For more information, go to the [[Turtle.refuel]] page.&lt;br /&gt;
&lt;br /&gt;
=== Optional Non-fuel mode ===&lt;br /&gt;
In this mode, Turtles use their internal Redstone Engine, and as such, they do not need to be re-charged, or receive any other form of external power. This is because Redstone continuously emits low levels of energy, and the Turtle's engine is very efficient. This mode can be turned on by editing the turtle config file (config/mod_CCTurtle.cfg) and setting &amp;lt;var&amp;gt;turtleNeedsFuel&amp;lt;/var&amp;gt; to &amp;lt;var&amp;gt;0&amp;lt;/var&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Farming==&lt;br /&gt;
Turtles equipped with a [[diamond hoe]] can till dirt so it can later be used for Farming. An example of a use for this would be using it to till, plant, and harvest your wheat farm and dropping any product in a chest for you.&lt;br /&gt;
&lt;br /&gt;
==Mining==&lt;br /&gt;
Turtles crafted with a [[diamond pickaxe]], [[diamond axe]], or [[diamond shovel]], can break blocks, chop wood, mine stone and ores, and even break dirt and gravel (depending on the tool you used on it). The tools equipped on the Turtle have no durability, and so can be used indefinitely without the need for any additional materials. When a Turtle breaks the block, the Turtle receives the item directly into it's inventory. Different tools yield different drops - for example, an axe can break anything, but it won't drop ores.&lt;br /&gt;
&lt;br /&gt;
==Crafting==&lt;br /&gt;
Turtles with a [http://www.minecraftwiki.net/wiki/Crafting_Table Crafting Table] can craft items if they have the correct materials to do so, and all other slots outside the crafting-zone are empty.&lt;br /&gt;
&lt;br /&gt;
==Melee==&lt;br /&gt;
Turtles equipped with a [[diamond sword]] can attack players and mobs. When a Turtle kills a mob it will leave the experience orbs on the ground, but add the loot to its inventory. Turtles can also attack with any tool, where the [[diamond axe]] is the second best after the [[diamond sword]].&lt;br /&gt;
&lt;br /&gt;
==Inventory Interaction==&lt;br /&gt;
Turtles can interact with blocks that have inventories. This includes chests, furnaces, [[Printer|printers]] and even blocks with inventories in other mods. (This means a turtle cannot interact with a player's inventory, unless you use a third party peripheral). Turtles can interact with such inventories by using [[Turtle.suck|turtle.suck, turtle.suckDown, turtle.suckUp]] (To retrieve the first item in the inventory. The turtle finds the first item by scanning the first row from left to right, then the second row from left to right, etc.) Turtles can also place items inside inventories, by using [[Turtle.drop|turtle.drop, turtle.dropUp, turtle.dropDown]], which places items on the first item slot available (Using the same system as the one described for retrieving items).&lt;br /&gt;
&lt;br /&gt;
In special inventories, with just a few slots on the top or bottom, for example furnaces, you can specify which slot to place an item in by positioning the turtle in the corresponding location to the front face of the inventory. For example in a furnace, you would use a turtle at the bottom of the furnace for it to place fuel in the furnace, a turtle at the top to place objects to smelt, and a turtle to the right to retrieve the smelted objects (Note that you can do this with just 1 turtle moving around)&lt;br /&gt;
&lt;br /&gt;
==Recipes==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+'''Crafting ingredients'''&lt;br /&gt;
|-&lt;br /&gt;
|Turtle&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A1=iron_ingot |B1=iron_ingot |C1=iron_ingot&lt;br /&gt;
 |A2=iron_ingot |B2=Computer   |C2=iron_ingot&lt;br /&gt;
 |A3=iron_ingot |B3=chest      |C3=iron_ingot&lt;br /&gt;
 |Output=turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|Advanced Turtle&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A1=Gold_Ingot |B1=Gold_Ingot |C1=Gold_Ingot&lt;br /&gt;
 |A2=Gold_Ingot |B2=Computer   |C2=Gold_Ingot&lt;br /&gt;
 |A3=Gold_Ingot |B3=chest      |C3=Gold_Ingot&lt;br /&gt;
 |Output=Advanced_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|}&lt;br /&gt;
Turtles can be equipped with different peripherals and tools. A turtle can only have one tool and one peripheral, however the crafting table can act as a tool, or peripheral.&lt;br /&gt;
&amp;lt;br&amp;gt;The following tools can be equipped to a turtles: [[diamond pickaxe]], [[diamond axe]], [[diamond shovel]], [[diamond hoe]] and [[diamond sword]]&lt;br /&gt;
&amp;lt;br&amp;gt;The following peripherals can be equipped to a turtles: [[Wireless Modem|wireless modem]] and [[Workbench|crafting tables]].&lt;br /&gt;
&amp;lt;br&amp;gt;Diamond tools must be unused (i.e. not have a durability bar showing) to combine with a turtle.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;'''Turtle recipe and examples for equipping a turtle with tools and peripherals (Note that any variants of the turtle can also be crafted with the Advanced Turtle).'''&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! !! None !! Crafty !! Wireless&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| None&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |B2=turtle&lt;br /&gt;
 |Output=turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |B2=turtle |A2=workbench&lt;br /&gt;
 |Output=Crafty_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |B2=turtle |A2=Modem&lt;br /&gt;
 |Output=wireless_turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Mining&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |B2=turtle |C2=diamond_pickaxe&lt;br /&gt;
 |Output=mining_turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A2=workbench |B2=turtle |C2=diamond_pickaxe&lt;br /&gt;
 |Output=Crafty_Mining_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A2=Modem |B2=turtle |C2=diamond_pickaxe&lt;br /&gt;
 |Output=wireless_mining_turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Farming&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |B2=turtle |C2=diamond_hoe&lt;br /&gt;
 |Output=Farming_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A2=workbench |B2=turtle |C2=diamond_hoe&lt;br /&gt;
 |Output=Crafty_Farming_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A2=Modem |B2=turtle |C2=diamond_hoe&lt;br /&gt;
 |Output=Wireless_Farming_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Melee&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |B2=turtle |C2=diamond_sword&lt;br /&gt;
 |Output=Melee_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A2=workbench |B2=turtle |C2=diamond_sword&lt;br /&gt;
 |Output=Crafty_Melee_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A2=Modem |B2=turtle |C2=diamond_sword&lt;br /&gt;
 |Output=Wireless_Melee_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Felling&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |B2=turtle |C2=diamond_axe&lt;br /&gt;
 |Output=Felling_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A2=workbench |B2=turtle |C2=diamond_axe&lt;br /&gt;
 |Output=Crafty_Felling_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A2=Modem |B2=turtle |C2=diamond_axe&lt;br /&gt;
 |Output=Wireless_Felling_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Digging&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |B2=turtle |C2=diamond_shovel&lt;br /&gt;
 |Output=Digging_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A2=workbench |B2=turtle |C2=diamond_shovel&lt;br /&gt;
 |Output=Crafty_Digging_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A2=Modem |B2=turtle |C2=diamond_shovel&lt;br /&gt;
 |Output=Wireless_Digging_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| Crafty&lt;br /&gt;
|See Above&lt;br /&gt;
|N/A&lt;br /&gt;
|{{Crafting grid&lt;br /&gt;
 |A2=Modem |B2=turtle |C2=workbench&lt;br /&gt;
 |Output=Wireless_Crafty_Turtle |Output-link=turtle&lt;br /&gt;
 }}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{BlocksItemsList}}&lt;br /&gt;
[[Category:Blocks]]&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	<entry>
		<id>https://www.computercraft.info/wiki/index.php?title=Login_with_Roaming_Profiles&amp;diff=5962</id>
		<title>Login with Roaming Profiles</title>
		<link rel="alternate" type="text/html" href="https://www.computercraft.info/wiki/index.php?title=Login_with_Roaming_Profiles&amp;diff=5962"/>
				<updated>2013-08-28T03:53:04Z</updated>
		
		<summary type="html">&lt;p&gt;Latias1290: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This tutorial covers how to make a password server and a password client. The server will host a Lua table of usernames and passwords and the client will remotely connect each start up, ask the user for their username and password and compare it to that on the password server.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Setting Up ==&lt;br /&gt;
First of all, you must know how to craft a [[Wireless_Modem|wireless modem]] and a [[Computer|computer]]. You need to craft at least 2 wireless modems and 2 computers if you want to have a practical use for this system. Then, attach 1 modem to each computer you want to add to the system.&lt;br /&gt;
&lt;br /&gt;
Second, since typing on normal computers is relatively slow and annoying, I recommend to write the programs in [[Advanced_Computers|advanced computers]](because in advanced computers you can click to move the cursor around, and there are colors to distinguis between different statements), copying them into a [[Floppy|disk]] and moving them into each computer you want to include(with their respective programs of course). Alternatively, if you are the server owner(this tutorial assumes you are in Multiplayer because this system does not have any practical use in Singleplayer), you can go into the world folder and write copy/paste the source code into the folders of each computer you want to use. The folders you should use are the named the IDs of the computers(so if you have 3 computers, with the IDs 5, 7 and 9, you should copy them into the folders 5, 7 and 9). &lt;br /&gt;
&lt;br /&gt;
It does not matter wether you are using Normal or Advanced computers for this tutorial. I recommend to use Normal ones for the server.&lt;br /&gt;
&lt;br /&gt;
When writing the programs, I HIGHLY recommend using a [[Disk_Drive|disk drive]] like stated above, so you dont have to write in prograns for every computer you add.&lt;br /&gt;
Remember to read the text behind the --. These are comments, and you can safely leave them in the code.&lt;br /&gt;
&lt;br /&gt;
== Server ==&lt;br /&gt;
 print(&amp;quot;Initializing...&amp;quot;)&lt;br /&gt;
 local validSender = false&lt;br /&gt;
 valid = false&lt;br /&gt;
 tserved, vserved, dserved = 0&lt;br /&gt;
 &lt;br /&gt;
 print(&amp;quot;Loading startup settings...&amp;quot;)&lt;br /&gt;
 count = true -- If you dont want the server to count request statics, set the value of this variable to &amp;quot;false&amp;quot; without qoutes.&lt;br /&gt;
 modemSide = &amp;quot;left&amp;quot; -- change to the side of the computer your modem is on&lt;br /&gt;
 whitelist = true -- If you dont want to use a whitelist, change the value to &amp;quot;false&amp;quot; without quotes. This is not recommended on Multiplayer, but it does not make any difference on a Singleplayer World.&lt;br /&gt;
 &lt;br /&gt;
 print(&amp;quot;Loading user database...&amp;quot;)&lt;br /&gt;
 users = {&amp;quot;username1&amp;quot;, &amp;quot;username2&amp;quot; } -- Change this to the names for the users you want to have. Make sure the usernames are in the same order as in the password table. Changing the order is fine, but you must maintain the same order in both the users and passwords tables. Incorrect orders WILL cause 2 or more users not being able to log in!&lt;br /&gt;
 passwords = {&amp;quot;password1&amp;quot;, &amp;quot;password2&amp;quot; } -- Change this to the passwords for the users defined in the variable above. Again, make sure the passwords for users are in the same order as the usernames.&lt;br /&gt;
 senders = { 1, 2, 3, 4 } -- change this to the ID's of the all computers you want to accept requests from if you use a whitelist. If you do not use a whitelist, DO NOT REMOVE THIS LINE! Doing so will cause the program to crash everytime it is run, even though the variable is not used.&lt;br /&gt;
 &lt;br /&gt;
 print(&amp;quot;Loading core functions...&amp;quot;)&lt;br /&gt;
 function clear()&lt;br /&gt;
 term.clear()&lt;br /&gt;
 term.setCursorPos(1, 1)&lt;br /&gt;
 print(&amp;quot;CCLS Server 1.0 for CC 1.53 (Copyright (c) Dirk Kok 2013)&amp;quot;) &lt;br /&gt;
 print(&amp;quot;There is no user interaction here. Please contact your system administrator for assistance regarding the system.&amp;quot;)&lt;br /&gt;
 if count == true then&lt;br /&gt;
  print(tserved..&amp;quot; total requests received this session.&amp;quot;)&lt;br /&gt;
  print(vserved..&amp;quot; requests completed this session.&amp;quot;)&lt;br /&gt;
  print(dserved..&amp;quot; requests denied this session.&amp;quot;)&lt;br /&gt;
 elseif count == false then&lt;br /&gt;
  print(&amp;quot;Request statics have been disabled.&amp;quot;)&lt;br /&gt;
 else&lt;br /&gt;
  rednet.close(modemSide)&lt;br /&gt;
  term.clear()&lt;br /&gt;
  term.setCursorPos(1, 1)&lt;br /&gt;
  print(&amp;quot;Error: Counter setting is not boolean and the server can not continue.&amp;quot;)&lt;br /&gt;
  print(&amp;quot;The server program will exit automatically in 10 minutes. Or you can hold down Ctrl+T for 1 second.&amp;quot;)&lt;br /&gt;
  print(&amp;quot;After that, please set the variable \&amp;quot;count\&amp;quot; in the source code to either \&amp;quot;true\&amp;quot; or \&amp;quot;false\&amp;quot; WITHOUT QUOTATION MARKS. Doing this with quotation marks will cause the same error.&amp;quot;)&lt;br /&gt;
  sleep(600)&lt;br /&gt;
  shell.exit()&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 print(&amp;quot;Starting up...&amp;quot;)&lt;br /&gt;
 rednet.open(modemSide) -- Opens the modem to wait for incoming login requests&lt;br /&gt;
 &lt;br /&gt;
 clear()&lt;br /&gt;
 &lt;br /&gt;
 while true do &lt;br /&gt;
  validSender = false&lt;br /&gt;
  senderId, message, distance = rednet.receive()&lt;br /&gt;
  for i,v in ipairs(senders) do&lt;br /&gt;
   tserved = tserved + 1&lt;br /&gt;
   if v == senderId then&lt;br /&gt;
    validSender = true&lt;br /&gt;
    break&lt;br /&gt;
   else&lt;br /&gt;
    rednet.send(senderId, &amp;quot;301&amp;quot;, true) -- Send response code 301 - which means Not Whitelisted.&lt;br /&gt;
    dserved = dserved + 1&lt;br /&gt;
    clear()&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
  if validSender then&lt;br /&gt;
   for i,v in ipairs(users) do&lt;br /&gt;
    if message == v then&lt;br /&gt;
  password = passwords[i]&lt;br /&gt;
  rednet.send(senderId, password, true)&lt;br /&gt;
  vserved = vserved + 1&lt;br /&gt;
  clear()&lt;br /&gt;
  break&lt;br /&gt;
    else&lt;br /&gt;
  rednet.send(senderId, &amp;quot;300&amp;quot;, true) -- Send response code 300 - which means Bad Auth.&lt;br /&gt;
  dserved = dserved + 1&lt;br /&gt;
  clear()&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Client ==&lt;br /&gt;
 os.pullEvent = os.pullEventRaw&lt;br /&gt;
 local failed = true&lt;br /&gt;
 busr = &amp;quot;nsliq&amp;quot; -- If you ever happen to be unable to log in for some reason, you can use this username as a backup.&lt;br /&gt;
 bpass = &amp;quot;zuFUkVEjQKjkLQhTdpFMheNF&amp;quot; -- If you ever happen to be unable to log in for some reason, you can use this password as a backup.&lt;br /&gt;
 &lt;br /&gt;
 password_server = 0 -- change to the ID of your password server computer&lt;br /&gt;
 rednet.open(&amp;quot;left&amp;quot;) -- change to the side your rednet modem is on&lt;br /&gt;
 while true do&lt;br /&gt;
 term.clear()&lt;br /&gt;
 term.setCursorPos(1,1)&lt;br /&gt;
 print(&amp;quot;Welcome to CCLS 1.0.&amp;quot;)&lt;br /&gt;
 print(&amp;quot;Please select an option.&amp;quot;)&lt;br /&gt;
 print(&amp;quot;[1] Login&amp;quot;)&lt;br /&gt;
 print(&amp;quot;[2] Shutdown&amp;quot;)&lt;br /&gt;
 write(&amp;quot;&amp;gt; &amp;quot;)&lt;br /&gt;
 input = read()&lt;br /&gt;
 if input == &amp;quot;2&amp;quot; then&lt;br /&gt;
  os.shutdown()&lt;br /&gt;
 elseif input == &amp;quot;1&amp;quot; then&lt;br /&gt;
  print(&amp;quot;Please login.&amp;quot;)&lt;br /&gt;
  write(&amp;quot;Username: &amp;quot;)&lt;br /&gt;
  username = read()&lt;br /&gt;
  write(&amp;quot;Password: &amp;quot;)&lt;br /&gt;
  password = read(&amp;quot;*&amp;quot;)&lt;br /&gt;
  if username == busr then&lt;br /&gt;
  if password == bpass then&lt;br /&gt;
 print(&amp;quot;Access granted&amp;quot;)&lt;br /&gt;
 break&lt;br /&gt;
  end&lt;br /&gt;
  end&lt;br /&gt;
  rednet.send(password_server, username, true)&lt;br /&gt;
  senderId, message, distance = rednet.receive(5)&lt;br /&gt;
  if message == &amp;quot;300&amp;quot; then&lt;br /&gt;
  print(&amp;quot;Invalid Username or Password.&amp;quot;)&lt;br /&gt;
  sleep(3)&lt;br /&gt;
  elseif password == message then&lt;br /&gt;
  failed = false&lt;br /&gt;
  term.clear()&lt;br /&gt;
  term.setCursorPos(1,1)&lt;br /&gt;
  print(&amp;quot;Welcome &amp;quot;, username)&lt;br /&gt;
  break;&lt;br /&gt;
  else&lt;br /&gt;
  print(&amp;quot;Invalid Username or Password.&amp;quot;)&lt;br /&gt;
  sleep(3)&lt;br /&gt;
  end&lt;br /&gt;
 else&lt;br /&gt;
  print(&amp;quot;Invalid Command.&amp;quot;)&lt;br /&gt;
  sleep(2)&lt;br /&gt;
 end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Old Server ==&lt;br /&gt;
''Note: This is here for reference for people who need the older version. I recommend using the programs above.''&lt;br /&gt;
&lt;br /&gt;
 os.pullEvent = os.pullEventRaw&lt;br /&gt;
 term.clear()&lt;br /&gt;
 term.setCursorPos(1,1)&lt;br /&gt;
 print(&amp;quot;This is a password server. There is no user interaction here.&amp;quot;)&lt;br /&gt;
 print(&amp;quot;Please find a computer and login there.&amp;quot;) &lt;br /&gt;
 local firstCycle = true&lt;br /&gt;
 local validSender = false&lt;br /&gt;
 local modemSide = &amp;quot;left&amp;quot; -- change to the side of the computer your modem is on&lt;br /&gt;
 local valid = false&lt;br /&gt;
 users = {&amp;quot;username1&amp;quot;, &amp;quot;username2&amp;quot; } --make sure users and passwords line up&lt;br /&gt;
 passwords = {&amp;quot;password1&amp;quot;, &amp;quot;password2&amp;quot; }&lt;br /&gt;
 senders = { 1, 2, 3, 4 } -- computer ID's of the computers you want to accept requests from&lt;br /&gt;
 function bootUp()&lt;br /&gt;
  rednet.open(modemSide)&lt;br /&gt;
 end&lt;br /&gt;
 while true do &lt;br /&gt;
  validSender = false&lt;br /&gt;
  if firstCycle then&lt;br /&gt;
   bootUp()&lt;br /&gt;
   firstCycle = false&lt;br /&gt;
  end&lt;br /&gt;
  senderId, message, distance = rednet.receive()&lt;br /&gt;
  for i,v in ipairs(senders) do&lt;br /&gt;
   if v == senderId then&lt;br /&gt;
    validSender = true&lt;br /&gt;
    break&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
  if validSender then&lt;br /&gt;
   for i,v in ipairs(users) do&lt;br /&gt;
    if message == v then&lt;br /&gt;
     valid = true&lt;br /&gt;
     password = passwords[i]&lt;br /&gt;
     break&lt;br /&gt;
    else&lt;br /&gt;
     valid = false&lt;br /&gt;
    end&lt;br /&gt;
   end&lt;br /&gt;
   if valid then&lt;br /&gt;
    rednet.send(senderId, password, true)&lt;br /&gt;
   else&lt;br /&gt;
    rednet.send(senderId, &amp;quot;Not Valid&amp;quot;, true)&lt;br /&gt;
   end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Old Client ==&lt;br /&gt;
&lt;br /&gt;
 os.pullEvent = os.pullEventRaw&lt;br /&gt;
 local locker = true&lt;br /&gt;
 local failed = true&lt;br /&gt;
 local attempted_login = true&lt;br /&gt;
 local password_server = 0 -- change to the ID of your password server computer&lt;br /&gt;
 rednet.open(&amp;quot;left&amp;quot;) -- change to the side your rednet modem is on&lt;br /&gt;
 while locker do&lt;br /&gt;
  attempted_login = false&lt;br /&gt;
  term.clear()&lt;br /&gt;
  term.setCursorPos(1,1)&lt;br /&gt;
  print(&amp;quot;Welcome to a USERS PC : Roaming Profile Enabled&amp;quot;)&lt;br /&gt;
  print(&amp;quot;What would you like to do?&amp;quot;)&lt;br /&gt;
  print(&amp;quot;[1] Login (*)&amp;quot;)&lt;br /&gt;
  print(&amp;quot;[2] Shutdown&amp;quot;)&lt;br /&gt;
  write(&amp;quot;&amp;gt; &amp;quot;)&lt;br /&gt;
  local input = read()&lt;br /&gt;
  if input == &amp;quot;2&amp;quot; then&lt;br /&gt;
   os.shutdown()&lt;br /&gt;
  elseif input == &amp;quot;1&amp;quot; then&lt;br /&gt;
   attempted_login = true&lt;br /&gt;
   print(&amp;quot;Please login...&amp;quot;)&lt;br /&gt;
   write(&amp;quot;Username: &amp;quot;)&lt;br /&gt;
   local username = read()&lt;br /&gt;
   write(&amp;quot;Password: &amp;quot;)&lt;br /&gt;
   local password = read(&amp;quot;*&amp;quot;)&lt;br /&gt;
   rednet.send(password_server, username, true)&lt;br /&gt;
   senderId, message, distance = rednet.receive(5)&lt;br /&gt;
   if password == message then&lt;br /&gt;
    failed = false&lt;br /&gt;
    locker = false&lt;br /&gt;
    term.clear()&lt;br /&gt;
    term.setCursorPos(1,1)&lt;br /&gt;
    print(&amp;quot;Welcome &amp;quot;, username)&lt;br /&gt;
   else&lt;br /&gt;
    print(&amp;quot;Invalid Username or Password.&amp;quot;)&lt;br /&gt;
    sleep(3)&lt;br /&gt;
   end&lt;br /&gt;
  else&lt;br /&gt;
   print(&amp;quot;Command not recognised...&amp;quot;)&lt;br /&gt;
   sleep(2)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Thoughts and Notes ==&lt;br /&gt;
''Note: You do not have to read these if you use the new system.''&amp;lt;br /&amp;gt;&lt;br /&gt;
Although this may work very well as a login system, it is insecure by the flaw that a malicious sniffer can unnoticeably obtain a copy of the password while it is being sent as described on the [[Rednet_(API)|Rednet API]] page, and use the password to login.&lt;br /&gt;
&lt;br /&gt;
If you change the client code, to &amp;quot;startup&amp;quot; and put it in the root directory, it works very well as a login system.&lt;br /&gt;
You may also want to put in the line &lt;br /&gt;
 os.pullEvent = os.pullEventRaw -- disables Ctrl+T&lt;br /&gt;
as if it doesn't work first time it can be difficult to get out of the program.&lt;br /&gt;
&lt;br /&gt;
If you have either Railcraft or Additional Pipes, find the 'World Anchor' or 'Teleport Tether' block. If your server can afford the resources, place the block within a 3x3 grid of your password server. It will ensure that even if you leave the chunk, the password server still is operational. Otherwise you may find that you cannot login because you've left the chunk and the password server is no longer dealing with requests.&lt;br /&gt;
&lt;br /&gt;
This is a minor security flaw but it is only if someone has access to a computer that is 'whitelisted' to access the password server. The security flaw is that if they use the password Not Valid on that computer they are allowed access;&lt;br /&gt;
&lt;br /&gt;
 if valid then&lt;br /&gt;
  --send client password&lt;br /&gt;
 else&lt;br /&gt;
  --send client Not Valid&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
to fix remove the else statement&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Programs]]&lt;/div&gt;</summary>
		<author><name>Latias1290</name></author>	</entry>

	</feed>