<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Runescape Private Server</title>
	<atom:link href="http://www.runescapeps.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.runescapeps.com</link>
	<description>Runescape Private Servers Publisher</description>
	<lastBuildDate>Wed, 31 Mar 2010 19:52:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The Basics of Java</title>
		<link>http://www.runescapeps.com/12/the-basics-of-java/</link>
		<comments>http://www.runescapeps.com/12/the-basics-of-java/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 19:51:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[setting]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.runescapeps.com/?p=12</guid>
		<description><![CDATA[Table of Contents (Orange hasn&#8217;t been added, yet) Introduction Quick Reference Fields/Variables Methods Arrays Strings Flow and Control Classes Object Oriented Design Generics Data Structures Efficiency, Big-O Multi-Threading Basic Bytecode How this tutorial applies to RSPS Practice and project ideas Links Introduction Java is a object oriented programming language that was originally developed by James [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-size: medium;">Table of Contents</span></strong></p>
<blockquote><p>(Orange hasn&#8217;t been added, yet)</p>
<ol>
<li>Introduction</li>
<li>Quick Reference</li>
<li>Fields/Variables</li>
<li>Methods</li>
<li>Arrays</li>
<li>Strings</li>
<li>Flow and Control</li>
<li>Classes</li>
<li>Object Oriented Design</li>
<li>Generics</li>
<li>Data Structures</li>
<li>Efficiency, Big-O</li>
<li>Multi-Threading</li>
<li>Basic Bytecode</li>
<li>How this tutorial applies to RSPS</li>
<li>Practice and project ideas</li>
<li>Links</li>
</ol>
</blockquote>
<p><span style="font-size: small;"><strong>Introduction</strong></span></p>
<div>
<blockquote><p>Java is a object oriented programming language that was originally developed by James Gosling at Sun Micro-systems. The language is a interpreted language that is compiled into Bytecode. The JVM then interprets the Bytecode at runtime. This is a very powerful feature, giving Java the ability to live up the phrase &#8220;Write once, run anywhere&#8221;, and is the foundation of Java&#8217;s portability. Any good Java programmer should definently understand at least some basic bytecode, as knowing what your code actually compiles down to is a very powerful bit of knowledge that will help you understand how sometimes 4 lines of code can be better than 3 lines of code when compiled, or how one way of doing something is better than another. Java&#8217;s syntax is very similar to C&#8217;s. It is a very powerful language that is still one of the top languages in use today (along side C, C++, and .NET languages).</p>
<p><img src="http://www.tiobe.com/content/paperinfo/tpci/images/tpci_trends.png" border="0" alt="" /><br />
^ <a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html" target="_blank">http://www.tiobe.com/index.php/conte&#8230;pci/index.html</a></p>
<p>It is a simpler language unless you venture to some of its lower level aspects, and is a great language to learn as your first experience in programming.</p>
<p>(will be expanded)</p></blockquote>
</div>
<p><strong><span style="font-size: small;">Quick Reference</span></strong></p>
<div>
<blockquote><p><strong>Primitive Data Types:</strong></p>
<blockquote><p>Data Type &#8211; Value Range &#8211; Default Value &#8211; Memory Size</p>
<p><strong>int</strong> &#8211; -2,147,483,648 to 2,147,483,647 &#8211; 0 &#8211; 32 bits (4 bytes)<br />
<strong>short</strong> &#8211; -32,768 to 32,767 &#8211; 0 &#8211; 16 bits (2 bytes)<br />
<strong>byte</strong> &#8211; -128 to 127 &#8211; 0 &#8211; 8 bits (1 byte)<br />
<strong>long</strong> &#8211; -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 &#8211; 0 &#8211; 64 bits (8 bytes)<br />
<strong>float</strong> &#8211; ~1.4 E -45 to 3.4028235 E 38 &#8211; 0.0 &#8211; 32 bits(4 bytes)<br />
<strong>double</strong> &#8211; ~1.79769313486231570 E 308 to 4.94065645841246544 E -324 &#8211; 0.0 &#8211; 64 bits (8 bytes)<br />
<strong>boolean</strong> &#8211; true/false &#8211; false &#8211; not precisely defined but it reprsents 1 bit<br />
<strong>char</strong> &#8211; \u0000 to \uffff (0 to 65,535) &#8211; \u0000 (0) &#8211; 16 bits (2 bytes)</p>
<p>Remember that Objects have a default value of null.</p>
<p>Uses:</p>
<p><strong>int</strong>: The default numeric primitive<br />
<strong>short</strong>: Numeric primitive that is more compact within large arrays<br />
<strong>byte</strong>: Smallest numeric primitive, useful for compactness within large arrays<br />
<strong>long</strong>: Large numeric primitive used to represent very large numbers<br />
<strong>float</strong>: Decimal primitive that uses less space than double, useful for large arrays<br />
<strong>double</strong>: Default decimal primitive<br />
<strong>char</strong>: represents a single character in unicode<br />
<strong>boolean</strong>: represents true or false values</p></blockquote>
<p><strong>Special Escape Sequences: (Used in String literals)</strong></p>
<blockquote><p>\n new line<br />
\t tab<br />
\\ backslash<br />
\&#8221; double quote<br />
\&#8217; single quote<br />
\r carriage return<br />
\b back space<br />
\f form feed</p></blockquote>
<p><strong>Access modifiers:</strong></p>
<blockquote><p>modifier &#8211; effect &#8211; use</p>
<p><strong>public</strong> This field/method can be referred to inside of the class and outside of the class.<br />
<strong>private</strong> This field/method can only be accessed inside of this class.<br />
<strong>protected</strong> This field/method can be accessed inside of this class, and any of its subclasses.(REMEMBER, protected access also gives it package access).</p>
<p>No access modifier at all when declared in a global context gives the field/method package access. Packaged access means it can be accessed inside of that class, and by any class inside the same folder as that class.<br />
(will be expanded)</p></blockquote>
<p><strong>Operators</strong></p>
<blockquote><p><strong>Arithmetic Operators</strong></p>
<blockquote><p><strong>+</strong> &#8211; Addition, also used to append Strings<br />
<strong>-</strong> &#8211; Subtraction<br />
<strong>/</strong> &#8211; Division<br />
<strong>*</strong> &#8211; Multiplication<br />
<strong>%</strong> &#8211; Modulus (Remainder operator) returns the remainder through division</p></blockquote>
<p><strong>Incremental Operators</strong></p>
<blockquote><p><strong>++</strong> &#8211; increments by 1<br />
<strong>&#8211;</strong> &#8211; decrements by 1</p></blockquote>
<p><strong>Equality Operators</strong></p>
<blockquote><p><strong>==</strong> &#8211; returns true if the values on either side are equal<br />
<strong>&gt;=</strong> &#8211; returns true if the value on the left is greater than or equal to the value on the right<br />
<strong>&lt;=</strong> &#8211; returns true if the value on the left is less than or equal to the value on the right<br />
<strong>&gt;</strong> &#8211; returns true if the value on the left is greater than the value on the right<br />
<strong>&lt;</strong> &#8211; returns true if the value on the left is less than the value on the right<br />
<strong>!=</strong> &#8211; returns true if the values on either side are not equal</p></blockquote>
<p><strong>Conditional Operators</strong></p>
<blockquote><p><strong>&amp;&amp;</strong> &#8211; condition &#8220;and&#8221;<br />
<strong>||</strong> &#8211; condition &#8220;or&#8221;</p></blockquote>
<p><strong>Bitwise/Bit Shift Operators</strong></p>
<blockquote><p><strong>&amp;</strong> &#8211; bitwise &#8220;and&#8221;<br />
<strong>^</strong> &#8211; bitwise exclusive &#8220;or&#8221;<br />
<strong>|</strong> &#8211; bitwise inclusive &#8220;or&#8221;<br />
<strong>&gt;&gt;</strong> &#8211; shifts the pattern to the right<br />
<strong>&lt;&lt;</strong> &#8211; shifts the pattern to the left<br />
<strong>&gt;&gt;&gt;</strong> &#8211; shifts a 0 into the leftmost position</p></blockquote>
<p><strong>Other Operators</strong></p>
<blockquote><p>instanceof &#8211; type comparison, returns true of the object on the left is of the same type of the value on the right<br />
? : &#8211; condition operator, shortcut for &#8220;if &#8211; else&#8221;.</p></blockquote>
</blockquote>
<p><strong>Conventions</strong></p>
<blockquote><p>Conventions are severely lacking in this community. PLEASE USE THEM!</p>
<p>Classes:<br />
the first letter in each word in a classname should be capitalized. Class names should be nouns and should be relevant to the job they perform/represent. The code within the class should be organized in this order:</p>
<ol>
<li>package</li>
<li>imports</li>
<li>class or interface declaration</li>
<li>static fields</li>
<li>instance fields</li>
<li>constructors</li>
<li>methods</li>
</ol>
<p>Classes and methods should be well commented.</p>
<p>The code itself should also be clean. Method names should be verbs, first letter of the first word lowercase, the first letter of words following should be capitalized. Field should follow the same capitalization pattern of method names, except the names should be nouns. Final field should have capitalized names. You should indent for each block of brackets, indention should traditionally be 4 spaces (most people use tab for simplicity).</p>
<p>for more information on conventions see this link:<br />
<a href="http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html" target="_blank">Conventions</a></p>
<p>Example of conventioned class:</p>
<div>
<div>Code:</div>
<pre dir="ltr">package test;

import java.io.File;

public class Test {

    private final int FILE_COUNT = 5;
    private boolean isDone = false;

    public Test(String[] files) {
        for (int i = 0; i &lt; files.length; i++) {
            closeFile(files[i]);
        }
    }

    private void closeFile(String fileName) {
        new File(fileName).close();
    }
}</pre>
</div>
<p>Note that the code above is pointless. Also, notice that even though the brackets used after the for loop in the constructor are not needed, its good habit to use them anyone to prevent errors.</p>
<p>Encapsulation is also a very good technique to follow in class design, we will cover that when we get the classes though.</p>
<p>(will be expanded)</p></blockquote>
</blockquote>
</div>
<p><span style="font-size: small;"><strong>Fields/Variables</strong></span></p>
<div>
<blockquote><p>In Java, both the terms variable and field are used, in the tutorial we will use both terms. A field is essentially a variable that holds a saved value. There are 4 types of fields:</p>
<ul>
<li><strong>Instance Fields</strong><br />
<blockquote><p>An instance field is a field that has a global scope within a class, they are called instance fields as they are non-static and each instance of that particular class has a separate &#8220;version&#8221;, or value, of this field.</p></blockquote>
</li>
<li><strong>Class Fields</strong><br />
<blockquote><p>Class variables, like instance fields, also have a global scope in a class. The difference being that Class Fields are static, meaning that each instance of that class all shares that same &#8220;version&#8221; or value of the class field.</p></blockquote>
</li>
<li><strong>Local Fields</strong><br />
<blockquote><p>Local Fields have a scope ONLY inside of the method that it is declared it. As a result, Local Fields do not have access modifiers as they are not global. You treat them like any other field, its just that they typically hold temporary values that only can be found in that method.</p></blockquote>
</li>
<li><strong>Parameters</strong><br />
<blockquote><p>Parameters are not fields, they are variables, this is one of the few cases where the terms differ. A parameter is essentially like a local field. Parameters in Java work through call by value (for the most part), and are used to &#8220;send&#8221; a method a value when called.</p></blockquote>
</li>
</ul>
<p>Just remember the general differences for now, I will show a couple examples.</p>
<p>Alright, declaring a field is very simple:</p>
<p>TYPE NAME (= VALUE)*;</p>
<p>Example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int number = 5;</pre>
</div>
<p>*being optional, if you don&#8217;t declare a variable with a value the compiler will assign it a default value listed in the data section of the tutorial.</p>
<p>This basically tells the computer to break off a chunk of memory depending on the type, and assign it the value of 5. Assuming this is in a method, it has no access modifier.</p>
<p>The syntax is the same for all types:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int iNumber = 5;
byte bByte =5;
char cChar = 'f';
float fFloat = 5.7;</pre>
</div>
<p>They all have the same syntax. Now creating a new instance of a class is a bit different but we can explain that later.</p>
<p>Now, we know how to declare a field. Lets put it to some use. Math in Java (or pretty much all languages that have a C based syntax) is fairly obvious:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int a = 5;
int b = 3;
int c = a + b;</pre>
</div>
<p>Makes sense? the value of c is the values of a and b added together. The same syntax for any math operator.</p>
<div>
<div>Code:</div>
<pre dir="ltr">int a = 5;
int b = 3;
int c = a / b;
c = a * b;
c = a - b;</pre>
</div>
<p>Notice that I didn&#8217;t include the type in front of c the second and third times I assigned it values. You only include the fields type when you declare it, after that the compiler knows the type and name of the variable, so you just refer to it by its name to reassign values or use its value.</p>
<p>This is a general overview of Fields/variables, I&#8217;ll explain in more detail as far as different access modifiers etc when we get to that point.</p></blockquote>
</div>
<p><span style="font-size: small;"><strong>Methods</strong></span></p>
<div>
<blockquote><p>Think of a method as something that you throw values into (or at least can), it performs some sort of task, and then returns a value (if its return type isn&#8217;t void at least). Its hard to come up with good metaphors =P. All in all, a method is a series of statements. Statements always end in a semicolon, if you remember from the examples having to do with fields.</p>
<p>If you also remember parameters, a parameter is a value that is given to the method as an argument when it is called, that value is usually required for that method to do its task (why have parameters for no reason?). Multiple methods can have the same name if they have parameters that are different, this is called overloading.</p>
<p>A methods declaration syntax is a bit different:</p>
<p>ACCESS MODIFIER* SPECIAL MODIFIER* TYPE NAME (PARAMETERS) { STATEMENTS }</p>
<p>*being optional once again.</p>
<p>Example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">public int getDouble(int a) {
    int b = a * 2;
    return b;
}</pre>
</div>
<p>Now you may be thinking, &#8220;WHAT THE FFUUU-&#8221;, but don&#8217;t worry! It&#8217;s simple!</p>
<p>I&#8217;ll explain this in order. This method is public, meaning it can be access within and outside of its class/object. This method is also of type int, meaning this method returns an int value. It takes a single parameter of type int, meaning that when this method is called, it must be given an int as an argument. The brackets enclose the body of the Method, for every { you need a }, its a very simple rule that when not followed can lead to unhappy time wasted searching and counting brackets.</p>
<p>A return statement exits the method with the value specified, any code beyond a return statement will not be called and usually you will get an error about unreachable code at compile-time. If the method is of type void (which has no value remember), then you use an empty return statement by just using the word return. You can use a return statement to exit a method early as well.</p>
<p>As of now, this method does nothing. It is just declared and exists. The method doesn&#8217;t actually &#8220;perform&#8221; until it is called. Example of how to call this method:</p>
<div>
<div>Code:</div>
<pre dir="ltr">getDouble(5);</pre>
</div>
<p>Notice, that like fields, we only need to use the method name. Once the method is declared you just access it through its name. Notice also that within the parenthesis we included the number 5. Remember our method having a single parameter of int? There&#8217;s the argument to fulfill the methods parameters.</p>
<p>If a method has parameters, you MUST provide them when called, meaning the following call would not compile:</p>
<div>
<div>Code:</div>
<pre dir="ltr">getDouble();</pre>
</div>
<p>or</p>
<div>
<div>Code:</div>
<pre dir="ltr">getDouble(5, 5, 5);</pre>
</div>
<p>Your arguments when you call the method must match the methods parameters.</p>
<p>Now, remember how we said the method is of type int? That means the method returns an int value, meaning the method call itself can be treated as an int. In a method, if it is not of type void, you MUST return a value. The return type void essentially means that the method doesn&#8217;t have a return value, in which case the return statement isn&#8217;t required.</p>
<p>To return a value, you just use the keyword &#8220;return&#8221; followed by the value.</p>
<p>For example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int a = getDouble(5);</pre>
</div>
<p>The value of a is now 10. Make sense?</p>
<p>You can also create a method of ANY type. Meaning any primitive type, or any object (as long as the class exists, we will explain that later).</p>
<p>Here is a second example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">private double divide(double f, double g) {
    return f / g;
}</pre>
</div>
<p>This may look more complicated than the previous example, but it&#8217;s not! This method is private, meaning it can only be called within its class. It is of type double, meaning it returns a double value. It also takes 2 parameters, both of type double. Now the return may look a bit different, it is essentially the same thing as</p>
<div>
<div>Code:</div>
<pre dir="ltr">private double divide(double f, double g) {
    double result = f / g;
    return result;
}</pre>
</div>
<p>Both are the exact same thing, the first just being more compact. It would be called like this:</p>
<div>
<div>Code:</div>
<pre dir="ltr">double hey = divide(6.0, 3.0);</pre>
</div>
<p>hey now being 2.0.</p>
<p>Now, we will learn our first standard library method (YAY!). It being System.out.println. Now for now, ignore the System.out., just focus on what the method does. It basically prints whatever argument you give it to the command prompt.</p>
<p>Example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">System.out.println("Hello world!");</pre>
</div>
<p>Now to combine what we have done so far:</p>
<div>
<div>Code:</div>
<pre dir="ltr">private void getDouble(double f) {
    return f * 2.0;
}

private void test() {
    System.out.println(divide(getDouble(5.0), 2.0));
}</pre>
</div>
<p>Woah, thats complicated right? Nope! Lets review. This method is private, meaning it can only be called in its class. It is of type void, meaning it has no return value. It has no parameters, meaning it doesn&#8217;t need any arguments, but you still need to include the parenthesis when you call it. Now this part make look kind of crazy to you right now, but its simple. Basically, this will print the value returned by divide when we pass it arguments of the value of getDouble given the argument of 5.0, and the second argument of 2.0.</p>
<p>That may sound complicated, but lets step through call by call:</p>
<p>getDouble(5.0) returns 10.0, so we are essentially calling divide(10.0, 2.0), which in turn returns 5.0, so System.out.println is given the value of 5.0 to print to the command prompt. Just think of it this way, the computer just treats the method calls as the values they return in this situation.</p>
<p>We will get more in depth with methods later on when we discuss classes, (that&#8217;s going to be the fun part of the tutorial).</p></blockquote>
</div>
<p><strong><span style="font-size: small;">Arrays</span></strong></p>
<div>
<blockquote><p>Alright, up to this point we know how to declare some basic values, do some basic math, and understand the over all basics of methods. Now we can discuss arrays! Arrays are essentially a section of memory statically allocated so that values of the same type can be organized in sequence. Put simpler, an array basically holds multiple values of the same type in a multiple &#8220;slots&#8221;.</p>
<p>The general syntax for an array uses [ ].</p>
<div>
<div>Code:</div>
<pre dir="ltr">int oneToFive[] = { 1, 2, 3, 4, 5 };</pre>
</div>
<p>That would be an array of int&#8217;s. Arrays are very useful for storing values in an organized value. You can get the length of an array by using the arrays length field:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int oneToFive[] = { 1, 2, 3, 4, 5 };
System.out.println(oneToFive.length);</pre>
</div>
<p>That would print the number 5 because there are 5 slots in that array. Now you can also declare an empty array:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int[] oneToFive = new int[5];</pre>
</div>
<p>Notice the square brackets, they are now after int, and notice the number within the square brackets at the end, that is the length of the array. Ignore the new operator for now, that will be explained later on.</p>
<p>Accessing specific values in an array is just as easy:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int[] oneToFive = new int[5];
oneToFive[0] = 1;
oneToFive[1] = 2;
oneToFive[2] = 3;
oneToFive[3] = 4;
oneToFive[4] = 5;</pre>
</div>
<p>Now you may be wondering why I only went up to four, remember, the index to the first slot in an array is always the number 0. So in an array that has the length of 5, the slots would be 0, 1, 2, 3, 4. Arrays work hand in hand with loops, which will be explained soon.</p>
<p>You can create an array of any type, primitive or object:</p>
<div>
<div>Code:</div>
<pre dir="ltr">double nums[] = {0.0, 2.3, 4.4};
System.out.println(nums[2]);</pre>
</div>
<p>That would print the number 4.4, as the arrays lenght is 3, so the last slot in the array has an index of 2.</p></blockquote>
</div>
<p><strong><span style="font-size: small;">Strings</span></strong></p>
<div>
<blockquote><p>Since Strings are essentially the most common object used in Java, I decided I might as well dedicate an entire section to them.</p>
<p>A string basically represents a string of characters. Strings are implicitly created meaning you won&#8217;t have to use the new operator unless you&#8217;re converting a byte array or something else into a String.</p>
<div>
<div>Code:</div>
<pre dir="ltr">String hello = "Hello!";</pre>
</div>
<p>There are plenty of nifty String methods that make strings very easy to use.</p>
<p>The equals(String) method, very self explanatory, its case sensitive, and checks to see if 2 strings are equal.</p>
<div>
<div>Code:</div>
<pre dir="ltr">if ("hello".equals("hello"))</pre>
</div>
<p>Remember, Strings are implicitly created, meaning that &#8220;hello&#8221; is literally treated like a String object, which is why the above code is legal.</p>
<p>Another version of the equals method is equalsIgnoreCase(String), it does the same thing but without case sensitivity.</p>
<p>Here are some common string methods:</p>
<p><strong>toLowerCase()</strong> &#8211; returns a lower case version of the string<br />
<strong>toUpperCase()</strong> &#8211; returns a upper case version of the string<br />
<strong>charAt(int)</strong> &#8211; returns the character at the specified index in the string, after all, a string is an array of characters at its core.<br />
<strong>substring(int), substring(int, int)</strong> &#8211; returns a string based off of the given index&#8217;s.<br />
<strong>indexOf(String)</strong> &#8211; returns the index of the first occurrence of the specified string.<br />
<strong>lastIndexOf(String)</strong> &#8211; returns the index of the last occurrence of the specified string.<br />
<strong>startsWith(String)</strong> &#8211; returns whether or not the string begins with the specified string.<br />
<strong>endsWith(String)</strong> &#8211; returns whether or not the string ends with the specified string.<br />
<strong>split(String)</strong> &#8211; returns an array of string resulting from splitting the current string at every occurrence of the specified string, similar to the StringTokenizer.<br />
<strong>toCharArray()</strong> &#8211; returns a character array created from the string.<br />
<strong>getBytes()</strong> &#8211; returns an array of bytes from the string.</p></blockquote>
</div>
<p><strong><span style="font-size: small;">Flow and Control</span></strong></p>
<div>
<blockquote><p>Now we get to the more logic part of programming. Without control and flow, it is impossible to write a program.</p>
<p><strong>Coniditional Statements</strong></p>
<blockquote><p>We will start of with the if statement:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int f = 4;
if (f == 4) {
    System.out.println("F is four");
}</pre>
</div>
<p>Remember those curly brackets from methods? Well here they are again. Brackets are used to enclose blocks of code. For instance, the above code prints &#8220;F is four&#8221;. The if statement simply checks if the condition specified is true, if so it will execute the code within its block, if not it will continue, ignoring the code in its block.</p>
<p>If we have a conditional statement followed by only a single statement to execute, brackets are not needed. If a conditional statement is not followed by no brackets it will only execute the first statement after the condition. The same is true for loops.</p>
<p>Now for some logical operators, they are defined in the very beginning of this tutorial if you need to look back. Like in the above example, == is used in checking for values, = is the ASSIGNMENT operator, it is not the same as == and cannot be used to generate the same effect. Now in addition to ==, we have !=, &amp;&amp;, and ||, meaning equals, not equals, and, and or respectively.</p>
<p>An example of the and:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int f = 4;
if (f &gt; 3 &amp;&amp; f &lt; 5) {
    System.out.println("F is four");
}</pre>
</div>
<p>This code will also print &#8220;F is four&#8221;, and is fairly self explanatory. If f is greater than 3, and f is less than 5&#8230;. is how it should be read, picture it like that in your head and it will make more sense. The || operator can be used in a similar way to mean &#8220;or&#8221;.</p>
<div>
<div>Code:</div>
<pre dir="ltr">int f = 4;
if (f == 3 || f == 4) {
    System.out.println("F is four or three");
}</pre>
</div>
<p>This code will print &#8220;F is four or three&#8221;, as f has the value of 4. I suggest going to the top of this page and reviewing the operators used with conditional statements to make sure you know them.</p>
<p>Now working along side if the if statement, are the else if statement and the else statement.</p>
<p>They work as would be expected:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int f = 3;
if (f == 4) {
    System.out.println("F is four");
} else if (f != 4) {
    System.out.println("F is not four");
}</pre>
</div>
<p>This code would print &#8220;F is not four&#8221;. Read it can be pictured like this: &#8220;If f equals 4 &#8230; else if f does not equal four&#8230;&#8221;. Now we also have the else statement, which stands alone as a &#8220;last resort&#8221;.</p>
<div>
<div>Code:</div>
<pre dir="ltr">int f = 2;
if (f == 4) {
    System.out.println("F is four");
} else if (f == 3) {
    System.out.println("F is three");
} else {
    System.out.println("F is not four or three");
}</pre>
</div>
<p>This code would print &#8220;F is not four or three&#8221;, and Read it can be pictured as &#8220;If f equals 4 &#8230; else if f equals 3 &#8230; else&#8221;. The else block is executed if none of the other conditions are true.</p>
<p>We also have a sort of shortcut, called the conditional(ternary) operator. Its syntax may look weird but its very simple:</p>
<div>
<div>Code:</div>
<pre dir="ltr">CONDITION ? IF TRUE : IF FASE</pre>
</div>
<p>Example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">boolean ass = true;
System.out.println(ass ? "ass" : "no ass");</pre>
</div>
<p>That code would print &#8220;ass&#8221;, as ass is true. Notice how we used it to represent a value, this would do the same without the shortcut:</p>
<div>
<div>Code:</div>
<pre dir="ltr">boolean ass = true;
if (ass) {
    System.out.println("ass");
} else {
    System.out.println("no ass");</pre>
</div>
<p>The operator doesn&#8217;t really provide much other than simplicity and cleaner (sometimes) code.</p>
<p>You can also &#8220;shortcut&#8221; it on booleans, if you noticed in the above example rather than having:</p>
<div>
<div>Code:</div>
<pre dir="ltr">if (ass == true)</pre>
</div>
<p>I simply used:</p>
<div>
<div>Code:</div>
<pre dir="ltr">if (ass)</pre>
</div>
<p>Reason being that a coniditional statement always evaluates to either true or false, so having ass == true is similar to having true == true or false == true (depending if ass is true or false), which is basically pointless. Since we can use</p>
<div>
<div>Code:</div>
<pre dir="ltr">if (ass)</pre>
</div>
<p>You may be wondering how we would &#8220;shortcut&#8221; check if ass is false, that&#8217;s when we use the ! operator, which simply represents &#8220;not&#8221;:</p>
<div>
<div>Code:</div>
<pre dir="ltr">if (!ass)</pre>
</div>
<p>Meaning if ass is false.</p>
<p>Now for more control, next we will explain loops.</p></blockquote>
<p><strong>Loops</strong></p>
<blockquote><p>Now, at this point what we have covered has been very procedural and tedious. Loops are a very powerful tool in any programming language and another fundamental part of control flow. A loop cycles until the specified condition is no longer true, they have a couple different styles though. Exiting a loop early can be done by using the break keyword, if you wish to end a specific cycle early but not entirely exit the loop you would use the continue keyword.</p>
<p>There are a couple types of loops.</p>
<p><strong>For Loop</strong></p>
<blockquote><p>This is the most commonly used loop. Loops are very simple to understand and use. First I will show the syntax of the for loop:</p>
<div>
<div>Code:</div>
<pre dir="ltr">for(int i = 0; i &lt; 20; i++)</pre>
</div>
<p>Lets explain each part of the loop:</p>
<div>
<div>Code:</div>
<pre dir="ltr">for(INITIALIZATION ; CONIDITION ; INCREMENTATION)</pre>
</div>
<p>Simply put, the first &#8220;slot&#8221; in the for loop is executed before the loop begins, it is usually used for declaring your index variable. The second &#8220;slot&#8221; in the for loop is the conidition, the loop will continue to cycle until that conidition is false. The last &#8220;slot&#8221; in the for loop is the incrementation, this is called after each time the loops cycles and is usually used to control the condition (or the amount of times the loop cycles).</p>
<p>Example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">for(int i = 0; i &lt; 20; i++) {
    System.out.println(i);
}</pre>
</div>
<p>The above code will print i until i is no longer less than 20. This idea of looping using an index is very useful when used with arrays:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int nums[] = {3, 5, 2, 3};
for (int i = 0; i &lt; nums.length; i++) {
    System.out.println(nums[i]);
}</pre>
</div>
<p>This loops through every slot in the array and prints its value. Remember that the first slot in an array is 0, so the last slot in an array is the arrays length &#8211; 1.</p>
<p>The &#8220;slots&#8221; in a for loop don&#8217;t always have to be meet, meaning this would result in an infinite loop:</p>
<div>
<div>Code:</div>
<pre dir="ltr">for (;;)</pre>
</div>
<p>You can fill in virtually any conidition, initialization, and post-cycle statement that you wish:</p>
<div>
<div>Code:</div>
<pre dir="ltr">String a ="";
for(;a.length() != 5; a += "a")</pre>
</div>
<p>Is fairly self explanatory, appends the letter &#8220;a&#8221; as long as the strings length is 5.</p></blockquote>
<p><strong>While Loop</strong></p>
<blockquote><p>This loop is probably even simpler than a for loop:</p>
<div>
<div>Code:</div>
<pre dir="ltr">while(CONIDION)</pre>
</div>
<p>This basically continues to run until the conidition is false. It can be set up for comparison to a for loop:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int i = 0;
while (i &lt; 20) {
    //do stuff
    i++;
}</pre>
</div>
<p>This essentially would work like a for loop. Now you may have noticed the 2 forward slashes. That is called a comment. You can place comments into your code and the compiler will ignore that line.</p>
<p>// comments an entire line</p>
<p>/* */ comments everything between the asterics.</p>
<p>The while loop is useful when you don&#8217;t have to loop with a numeric value. It also is useful for infinite loops, which are used more with threads which will be explained later on. But since coniditions always evaluate to true or false, the following syntax is legal and will create a never ending loop:</p>
<div>
<div>Code:</div>
<pre dir="ltr">while (true)</pre>
</div>
</blockquote>
<p><strong><br />
Do While Loop</strong></p>
<blockquote><p>The do while is very similar to a while loop. The only real difference is that it gaurentees at least 1 cycle of the loop as the conidition is checked at the end of the loop rather than the beginning like a while loop.</p>
<div>
<div>Code:</div>
<pre dir="ltr">int i = 5;
do {
    System.out.println("looped");
} while (i != 5);</pre>
</div>
<p>That would print &#8220;looped&#8221; once, as the conidition isn&#8217;t checked until the end of the loop. Note that the syntax is a little different.</p></blockquote>
<p><strong>For Each Loop</strong></p>
<blockquote><p>This loops was essentially designed as a sort of shortcut replacement for iterators, which are used with data structures, which we won&#8217;t talk about until later. We won&#8217;t use the for each loop until later when we discuss data structures, but we might as well cover here as it fits in.</p>
<p>here is the syntax for a for each loop:</p>
<div>
<div>Code:</div>
<pre dir="ltr">for (TYPE NAME : ITERABLE)</pre>
</div>
<p>It basically loops through every value in a structure or array, assigning each value to the specified variable each cycle until there are no more values left.</p>
<div>
<div>Code:</div>
<pre dir="ltr">int nums[] = {3, 4, 3, 2 };
for (int i : nums) {
    System.out.println(i);
}</pre>
</div>
<p>This will loop through each value in the array and print it.</p>
<p>This loop is really meant to be used with a collection of some sort, and really shouldn&#8217;t be used in any other way.</p>
<p>Lets compare:</p>
<div>
<div>Code:</div>
<pre dir="ltr">class a {
    int nums[] = {2, 4, 6, 2, 3, 3, 3, 3, 3};

    void b() {
        for (int i = 0; i &lt; nums.length; i++);
    }

    void c() {
        for (int i : nums);
    }
}</pre>
</div>
<p>Now lets look at the bytecode generated:</p>
<div>
<div>Code:</div>
<pre dir="ltr">void b();
  Code:
   0:    iconst_0
   1:    istore_1
   2:    iload_1
   3:    aload_0
   4:    getfield    #2; //Field nums:[I
   7:    arraylength
   8:    if_icmpge    17
   11:    iinc    1, 1
   14:    goto    2
   17:    return

void c();
  Code:
   0:    aload_0
   1:    getfield    #2; //Field nums:[I
   4:    astore_1
   5:    aload_1
   6:    arraylength
   7:    istore_2
   8:    iconst_0
   9:    istore_3
   10:    iload_3
   11:    iload_2
   12:    if_icmpge    26
   15:    aload_1
   16:    iload_3
   17:    iaload
   18:    istore    4
   20:    iinc    3, 1
   23:    goto    10
   26:    return</pre>
</div>
<p>Notice the difference? Only use the for each loop when working with something that can't get iterated through using an index.</p></blockquote>
</blockquote>
<p><strong>Error Checking</strong></p>
<blockquote><p>Java's error checking is excellent compared to C's, (or even C++'s though they have a similar concept) in my opinion. Error checking has a couple routes. First off, basic error checking (which really isn't much of error checking, more like invalid input checking) is fairly simple:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int doubleNumber(int num) {
    if (num &lt; 1)
        return;
    return num * 2;
}</pre>
</div>
<p>The line checking to make sure that num is positive would be an example of basic input checking. Java has a feature for runtime errors called exceptions, exceptions when caught and dealt with are very simple to manage and make solving problems much easier. When ignored however, searching for runtime errors can become tedious and painstaking. Catching an exception is very simple using the try-catch clause:</p>
<p>try {<br />
/*statements that may produce exceptions */<br />
} catch (EXCEPTION) {<br />
/* code to execute if an exception exception occured<br />
}</p>
<p>Example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">String number = "wut";
try {
    int a = Integer.parseInt(number);
} catch(NumberFormatException e) {
    e.printStackTrace();
}</pre>
</div>
<p>When compiled, this code has no issues, but once ran its a different story. When the program tries to parse "wut" from a String to an integer and exception is thrown for obvious reasons, but the exception is caught and the a trace of calls up until the exception is printed making the cause easier to find. Then the program will continue. Now if we didn't catch that exception, the program would run and then crash once the exception is thrown without being caught.</p>
<p>All exceptions in Java are subclasses of the Exception class, so if you have a block of code that could possibly throw multiple exceptions, if you don't have a specific task for each exception you could just catch Exception:</p>
<div>
<div>Code:</div>
<pre dir="ltr">try {
    /* code */
} catch(Exception e) {
    /* code */
}</pre>
</div>
<p>That would catch any exception thrown in that block. Sometimes, a try-catch statement is required though, and this a good practice. You simple just add a "throws" statement along side the method declaration:</p>
<div>
<div>Code:</div>
<pre dir="ltr">public int parse(String a) throws NumberFormatException {
    Integer.parseInt(a);
}</pre>
</div>
<p>This would force you to check for the exception NumberFormatException when calling the parse method:</p>
<div>
<div>Code:</div>
<pre dir="ltr">try {
    parse("25353");
} catch(NumberFormatException e) {
    System.out.println("Error parsing String to Int");
}</pre>
</div>
<p>We can also forcely throw exceptions within our code using the "throw" statement:</p>
<div>
<div>Code:</div>
<pre dir="ltr">public int parse(String a) {
    if (a.length() &lt; 1)
        throw new NumberFormatException();
    else
        Integer.parseInt(a);
}</pre>
</div>
<p>Notice that we used the new operator, Exceptions are objects.</p>
<p>There is also a balance between exiting a method early if a problem occurs, which is sometimes not forceful enough and the user may not even know that an error occurred, and throwing an exception, which is sometimes to forceful. This is called asserting.</p>
<div>
<div>Code:</div>
<pre dir="ltr">public int parse(String a) {
    assert a.length() &gt; 0;
    Integer.parseInt(a);
}</pre>
</div>
<p>If the length of a is less than 1 than an AssertionError is thrown. This assures that from any point after the assert statement that the asserted condition is true.</p></blockquote>
<p><strong>Switch Statement</strong></p>
<blockquote><p>A switch statement is used for testing a variable for multiple numeric values. You can switch types other than just integer primitives (byte, int, long, short) like char's and enum's, but in reality chars and enums are actually numerical at the core.</p>
<p>A switch statement is generally a pimped out series of goto statements used for checking the value of a variable, it is generally faster and cleaner than using a series of coniditional statements and this community severely lacks the use of the switch.</p>
<p>The syntax is fairly simple:<br />
switch (VARIABLE) {<br />
case VALUE:<br />
//code<br />
}</p>
<p>of course with as many cases as you need. You can also use the break keyword in switch statements to exit the switch, a common mistake is to not use the switch statement, since in reality a switch is a complex series of goto statements and labels, the code will not stop executing after that specific case is over unless you break:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int num = 1;
switch(num) {
    case 1:
        System.out.println("one");
    case 2:
        System.out.println("two");
    case 3:
        System.out.println("three");
}</pre>
</div>
<p>The above code would print "one", "two", and "three" as the program would jump to case 1 and execute from there onward. To prevent this, we use the break statement:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int num = 1;
switch(num) {
    case 1:
        System.out.println("one");
        break;
    case 2:
        System.out.println("two");
        break;
    case 3:
        System.out.println("three");
        break;
}</pre>
</div>
<p>This would print only "one" as it would break out of the switch at the end of the case. Not using break statements can also be a good trick, for example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int num = 3;
if (num == 3 || num == 2)
    System.out.println("Num is two or three");
else
    System.out.println("Num is not two or three");</pre>
</div>
<p>would be the same as:</p>
<div>
<div>Code:</div>
<pre dir="ltr">int num = 3;
switch (num) {
    case 2:
    case 3:
        System.out.println("Num is two or three");
        break;
    default:
        System.out.println("Num is not two or three");
        break;
}</pre>
</div>
<p>Now if num is 2, it would jump to case 2 and continue to run until it hits a break, the same being with case 3. You may be wondering what the default statement is. Default is jumped to if the value of the variable doesn't match any other cases, meaning if num wasn't 2 or 3 it would jump to the default case.</p></blockquote>
</blockquote>
</div>
<p><strong><span style="font-size: small;">Classes</span></strong></p>
<div>
<blockquote><p>Here's the fun part of the tutorial. A class is basically a template that defines the data and actions that specific objects derived from that class can use. It is probably the most important aspect of Java, and it goes hand in hand with object oriented design.</p>
<p>Every java program must include at least a single class. It is required, unlike other languages that allow stand-alone procedural code, java is entirely object oriented.</p>
<p>declaring a class is fairly simple:<br />
(ACCESS MODIFIER)* class NAME</p>
<p>*being optional</p>
<p>example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">public class Test {
    //methods etc.
}</pre>
</div>
<p>If you read my description of a class, you probably noticed the word object, and you may have noticed when we discussed the String. An object is a specific instance of a class. Unless static, every object has its own "version" of the classes data (or public field). This is the difference between static and non-static fields and methods. Non-static fields and methods must be accessed and called on a specific object, while static methods are not called on a specific object and therefore cannot directly modify non-static data.</p>
<p>Example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">public class Test {
    public int number = 5;
}</pre>
</div>
<p>It would be illegal code to attempt this:</p>
<div>
<div>Code:</div>
<pre dir="ltr">Test.number = 3;</pre>
</div>
<p>Because number is non-static, therefore we must access it through a specific instance of that class (object).</p>
<p>Creating an instance of an class is fairly simple also, this is where the "new" operator comes in.</p>
<p>Every class has a constructor, whether you define it or not. A constructor is called when you create a new instance of a class. Constructors are usually used for the purpose of giving that instance specific data that it needs in order to be used.</p>
<p>A constructor is declared just like a method except that it has no type and its name is the same name of the class.</p>
<p>Example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">public class Test {
    public int number;

    public Test() {
        number = 5;
    }
}</pre>
</div>
<p>Now we can create a new instance of that class using the "new" operator:</p>
<div>
<div>Code:</div>
<pre dir="ltr">public Test test = new Test();</pre>
</div>
<p>Like that. Now we can also access non-static number:</p>
<div>
<div>Code:</div>
<pre dir="ltr">test.number;</pre>
</div>
<p>like so.</p>
<p>Accessing data/methods from a class/object is done using a period (.). Now constructors can also take parameters, just like any other method:</p>
<div>
<div>Code:</div>
<pre dir="ltr">public class Test {
    public int number;

    public Test(int i) {
        number = i;
    }
}</pre>
</div>
<div>
<div>Code:</div>
<pre dir="ltr">public Test test = new Test(5);</pre>
</div>
<p>Like that.</p>
<p>AVOID STATIC. Static is typically used for mathematical operations where calling on a specific object isn't necessary, or if the class is abstract and therefore cannot be initialized (we will get into that later). Other than that it is bad practice and causes spaghetti code and bad design.</p>
<p>Classes are also where usability, practicality, and efficiency all clash. Faster is not always better, and neither is prettier. Using a stable and effective combination of both, while keeping your code reusable and easy to understand is only gained through planning and practice. This the point in programming where structure becomes more important, and in order to avoid "glue code", you should plan and think things out before jumping into a project. An example would be when I wrote my basic chat system/instant messaging thing. I rewrote the same project 3 separate times, as I would get half way through and realize that I could have done something better, or that my code was ugly and I found myself creating more and more spaghetti code. Unfortunately, I learned how and why to plan by messing up many times, and I'm a fond believer in the concept of learning though trial and error (though tutorials always help too <img title="Wink" src="images/smilies/wink.png" border="0" alt="" />).</p>
<p>Spaghetti code is when you have unorganized code that is very difficult to follow and understand. As beginners, this is a very common thing to encounter as people tend to just "write whatever works" without caring about its overall design. This may be fine for simple tasks, or even small pieces of work, but in the long run it is a very error prone and pain staking habit. This kind of code is known to produce "interesting" errors that are very difficult to find, as tracing through your code in a logical manner is very difficult without it being properly designed.</p>
<p>Glue code is usually a result of both bad design/lack of design and spaghetti code. It is when you end having to write, well, crappy code to fix or extend onto your project. If you find yourself having to go back and rewrite half your methods, add methods that are basically copy and pasted from another place in your project and modifying a few lines, or are forced to overuse static, then you're most likely dealing with glue code.</p>
<p>But, for now you're probably just thinking "I don't care, I just want my free runescapes to have more players!", that's great, and I realize that the majority of people won't hesitate to add more glue code and spaghetti code into their massive piles of static and illogical code even after reading this tutorial, but I hope my rambling helps at least one person who is reading this tutorial to actually learn something, and not just figure out "how to ad dem ints".</p>
<p>Anyway, back on topic. Similar to the concept of static being used for mathematical operations, it is also used in what is called a utility class.</p>
<p>You can divide classes into 3 unofficial categories:</p>
<p><strong>Utility Classes</strong></p>
<blockquote><p>A purely static class, has static fields and methods. An example would be the Math class from java's library, or the misc class from the majority of RSPS bases.</p>
<p>These typically are used for storing methods that perform some sort of algorithm and don't need to be called on a specific object.</p></blockquote>
<p><strong>Actor Classes</strong></p>
<blockquote><p>These typically perform some sort of job. This is one of the more common classes, an example being the StringTokenizer class. Usually the name ends in -er or -or. Good for more complex jobs than something like a method that can handle along and that may need to be done multiple times.</p></blockquote>
<p><strong>Representative Classes</strong></p>
<blockquote><p>Sort of an unofficial category I just added. Used to represent something, for instance the Player or Client classes in RSPS. Or the String class. These are the most common type of class, and is a wide category as they typically take concepts from the other two.</p></blockquote>
<p><strong>Inheritance</strong></p>
<blockquote><p>Inheritance is the foundation of object oriented design. We will start of with simple superclass - subclass relations. When you extend a class, you inherit that classes methods and fields. You then have the ability to override them, add methods and fields specific to the subclass, or call the superclasses methods or access its fields.</p>
<p>Up til this point, we haven't mentioned the keywords this or super. This is an implicit parameter added by the compiler, it is a reference to the object that owns the method that is being called. As for inheritance, when you extend a class, the subclass is also now type of the superclass, which is why in error checking we can catch just the Exception class as all the specific exceptions are subclasses of Exception, thus making them all type of Exception also. Parent classes should be more general than subclasses, here is a simple example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">class Vehicle {

}

class Truck extends Vehicle {

}

class Car extends Vehicle {

}</pre>
</div>
<p>Now, we could create a method that takes a parameter of type Vehicle, and be able to use objects of all three of these classes and have it work. This concept is called polymorphism, as the compiler doesn't know what specific class the object originated from until compile time.</p>
<div>
<div>Code:</div>
<pre dir="ltr">public void drive(Vehicle v) {

}

drive(new Car());
drive(new Truck());
drive(new Vehicle());</pre>
</div>
<p>Remember, you can always go from more specific to less specific, but never the other way around, meaning the following example would not compile:</p>
<div>
<div>Code:</div>
<pre dir="ltr">public void drive(Car c) {

}

drive(new Car());
drive(new Truck());
drive(new Vehicle());</pre>
</div>
<p>Even know Car is of type Vehicle, we can't go from less specific to more specific.</p>
<p>We will fill in some shit code just to use for out example:</p>
<div>
<div>Code:</div>
<pre dir="ltr">class Vehicle {
    public int tires;
    public Vehicle(int tires) {
        this.tires = tires;
    }

    public void drive() {
    }

    public void park() {
    }
}

class Car extends Vehicle {
    public Car() {
        this(4);
    }

    public Car(int i) {
        super(i);
    }

    public int getTires() {
        return super.tires;
    }
}

class Truck extends Vehicle {
    public Truck() {
        this(4);
    }

    public Truck(int i) {
        super(i);
    }
    public int getTires() {
        return super.tires;
    }
}</pre>
</div>
<p>First of all, lets look at the constructor of Vehicle. Notice the use of the implicit parameter this. Both the parameter and the instance field have the same name, but in Java, the local variable always wins over the global. If we had done tires = tires it would have set the parameters value to itself, in other words not doing really anything, but used the implicit parameter this to refer to the objects global variable.</p>
<p>Look at the constructor of both Car and Truck, you can use the word super to refer to the superclass's constructor, so we can explicitly class the superclass's constructor using the word super like a method call. Calls to super's constructor must always be the first line in the subclasses constructor though. Notice the other constructors for Car and Truck, they use the implicit parameter this to call the other constructor of this object, meaning that it essentially calls the other constructor of the same object. Now take a look at the getTires method for both Car and Truck, they use the word super again, but this time in a similar way that we originally used the implicit parameter. Since the constructor called supers constructor, which in turn set tires value, we can use super.tires to refer to that value.</p>
<p>Using this concept, we can require subclasses to implement their own version of methods using a concept known as abstraction. When you declare an abstract method, you must make the class itself abstract. You cannot "new" an abstract class. Abstract methods do not have a body, they are simply the declarations, and as a result the subclasses must implement the code for the method themselves, which is why you cannot new an abstract class as all of the code doesn't exist for that class.</p>
<div>
<div>Code:</div>
<pre dir="ltr">abstract class Vehicle {
    public abstract void drive();
    public abstract void park();
}

class Car extends Vehicle {
    public void drive() {

    }

    public void park() {

    }
}

class Truck extends Vehicle {
    public void drive() {

    }

    public void park() {

    }
}</pre>
</div>
<p>This is also a powerful concept as it allows you to create "requirements" for the subclasses, if the subclasses do not have the methods that where declared abstract in the parent then you will receive a compile error.</p>
<p>In java, a class can only extend a single class. In languages like C++ there is a feature of multiple inheritance, so the designers of Java made up for this lack by adding interfaces. Think of an interface as a purely abstract class (sort of). The difference being that in an abstract class, you can still have regular fields and methods, but in an interface, everything is abstract and public. You don't need to declare methods in an interface abstract as they already are by default, and just like an abstract class, you cannot new an interface. You can realize (technical term for implement) as many interfaces as you wish. Rather than using the word extends, you use the word implements.</p>
<div>
<div>Code:</div>
<pre dir="ltr">interface Vehicle {
    void drive();
    void park();
}

class Car implements Vehicle {
    public void drive() {

    }

    public void park() {

    }
}

class Truck implements Vehicle {
    public void drive() {

    }

    public void park() {

    }
}</pre>
</div>
<p>And just like abstract classes, interfaces can be treated as a type so you can use it for method parameters etc.</p></blockquote>
</blockquote>
</div>
<p><span style="font-size: small;"><strong>Efficiency</strong></span></p>
<div>Up to this point, coming from a RSPS background, the majority of you probably don't care to much about, or know to much about, efficiency. A key rule; speed does not equal efficiency, and neither does less code. While in a majority of cases, those two things are the ultimate goal, efficiency in itself is typically measured using big-O.</div>
<p>Big-O is a algorithm used to measure efficiency of code to complete a specific task.<br />
There are multiple types of big-O algorithms:</p>
<p><strong>Constant</strong></p>
<blockquote><p>O(1)</p></blockquote>
<p><strong>Logarithmic<br />
</strong></p>
<blockquote><p>O(log N)</p></blockquote>
<p><strong>Linear<br />
</strong></p>
<blockquote><p>O(N)</p></blockquote>
<p><strong>Exponential<br />
</strong></p>
<blockquote><p>O(2^N)</p></blockquote>
<p><strong>Quadratic<br />
</strong></p>
<blockquote><p>O(N^2)</p></blockquote>
<p><strong>Cubic</strong></p>
<blockquote><p>O(N^3)</p></blockquote>
<p>These all have their meanings. N representing the number of operations in relation to the size of data. Meaning constant, being O(1), will always be the same number of processes and speed no matter what data size, and example being opening a file. No matter how large a file is, creating a stream to read/write to that file will always take the same amount of time. Linear is O(N), meaning that the number of processes and time taken is directly proportional to the amount of data, O(N) is usually seen as a single loop. Quadratic, being O(N^2), is usually seen as a nested loop (A loop inside of a loop).</p>
<p>This general notation is used for efficiency. Learn it, embrace it, and use it. big-O is fairly simple to understand once you think about it, the more common algorithms being O(1), O(N), O(N^2), and O(N^3).</p>
<p>Example of O(N):</p>
<div>
<div>Code:</div>
<pre dir="ltr">private void printData() {
    int data[] = {2, 3, 4, 5, 7, 2, 3};
    for (int i = 0; i &lt; data.length; i++)
        System.out.println(data[i]);
}</pre>
</div>
<p>Example of O(N^2):</p>
<div>
<div>Code:</div>
<pre dir="ltr">private void printData() {
    int data[] = {2, 3, 4, 5, 7, 2, 3};
    for(int i = 0; i &lt; data.length; i++)
        for(int k = i; k &lt; data.length; k++)
            System.out.println(data[k]);
}</pre>
</div>
<p><span style="font-size: small;"><strong>Links</strong></span></p>
<div>
<blockquote><p><strong>Tutorials</strong></p>
<blockquote><p><a href="http://java.sun.com/docs/books/tutorial/" target="_blank">http://java.sun.com/docs/books/tutorial/</a></p></blockquote>
<p><strong>IDE&#8217;s</strong></p>
<blockquote><p><a href="http://www.netbeans.org/" target="_blank">http://www.netbeans.org/</a></p>
<p><a href="http://www.eclipse.org/" target="_blank">http://www.eclipse.org/</a></p>
<p><a href="http://www.jetbrains.com/idea/" target="_blank">http://www.jetbrains.com/idea/</a></p></blockquote>
<p><strong>Text Editors</strong></p>
<blockquote><p><a href="http://notepad-plus.sourceforge.net/uk/site.htm" target="_blank">http://notepad-plus.sourceforge.net/uk/site.htm</a></p>
<p><a href="http://www.pnotepad.org/" target="_blank">http://www.pnotepad.org/</a></p></blockquote>
</blockquote>
</div>
<p><strong>Use the javadocs! They will answer a lot of your questions: </strong><br />
<a href="http://java.sun.com/javase/6/docs/api/" target="_blank">http://java.sun.com/javase/6/docs/api/</a></p>
<p><strong>This will also be very useful on specific topics:</strong><br />
<a href="http://java.sun.com/javase/6/docs/" target="_blank">http://java.sun.com/javase/6/docs/</a></p>
<p><strong>This video is good for learning about memory, and pointers:</strong><br />
<a href="http://www.youtube.com/watch?v=W8nNdNZ40EQ&amp;feature=SeriesPlayList&amp;p=84A56BC7F4A1F852" target="_blank">http://www.youtube.com/watch?v=W8nNd&#8230;A56BC7F4A1F852</a><br />
^ The entire series of all 30 videos is quiet good as well.<br />
<span style="color: red;"><br />
<strong>Critic all you want, I tend to word things weird when trying to explain things, that or I might have just simply made a mistake</strong></span></p>
<p><!-- / message --><!-- sig --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.runescapeps.com/12/the-basics-of-java/feed/</wfw:commentRss>
		<slash:comments>2346</slash:comments>
		</item>
		<item>
		<title>Portforwarding Guide</title>
		<link>http://www.runescapeps.com/10/portforwarding-guide/</link>
		<comments>http://www.runescapeps.com/10/portforwarding-guide/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 19:46:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Runescape Private Server]]></category>
		<category><![CDATA[private server]]></category>
		<category><![CDATA[setting]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.runescapeps.com/?p=10</guid>
		<description><![CDATA[Step 1: Find your routers gateway IP Windows 7 1. Click the Windows Orb (Start button) 2. In the search bar at the bottom type CMD. 3. Click the application CMD 4. Type IPCONFIG 5. Find your adapter and then find the gateway IP information, it should look something like: Gateway IP . . . [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Step 1: </strong>Find your routers gateway IP</p>
<p><em>Windows 7</p>
<p></em>1. Click the Windows Orb (Start button)<br />
2. In the search bar at the bottom type CMD.<br />
3. Click the application CMD<br />
4. Type IPCONFIG<br />
5. Find your adapter and then find the gateway IP information, it should look something like: Gateway IP . . . . . . . 192.168.0.1<br />
<strong><br />
Step 2: </strong>Set your PC to a static IP address&#8230;</p>
<p><em>Windows 7</em></p>
<p>1. Click the wireless icon in the right hand sector of the taskbar.<br />
2. Select the bottom link &#8216;Open network and Sharing Center&#8217;<br />
3. In the left hand menu click &#8216;Change adapter settings&#8217;<br />
4. Find your adapter (Should be &#8216;Wireless Network Conenction&#8217; for WiFi users and &#8216;Local Area Connection&#8217; for ethernet users)<br />
5. Right click your adapter and select properties<br />
6. Select &#8216;Internet Protocol Version 4 (TCP/IPv4) and then click the properties button.<br />
7. Click the &#8216;Use the following IP address:&#8217; ratio button<br />
8. Enter the required information, usually the following:</p>
<p>IP Address: 192.168.*.117<br />
Subnet mask: 255.255.255.0<br />
Default gateway: 192.168.*.1</p>
<p>Preferred DNS server: 192.168.*.1<br />
Alternate DNS server: *leave blank*<br />
<strong><br />
*Replace the * with the routers third IP digit so if the gateway IP was 192.168.0.1 you would replace the * with 0.</strong></p>
<p><em>Windows XP</p>
<p></em>1. Navigate to control panel, make sure it&#8217;s on classic view.<br />
2. Click network connections<br />
3. Right click your adapter and select properties<br />
4. Follow steps 6-8 for Windows 7 (above)</p>
<p><strong>Step 3: </strong>Configuring your router</p>
<p>1. Open your preferred browser<br />
2. Enter http:// in the address bar followed by the routers gateway IP so in my example I would type <em><a href="http://192.168.0.1" target="_blank">http://192.168.0.1</a></em><br />
3. You may be asked for a username and password, most of the time it&#8217;s one of the following:</p>
<p>Username: admin<br />
Password: admin or password</p>
<p>4. This is where it gets tricky depending on your router, most routers use similar interfaces so I&#8217;ll do a NETGEAR guide and people using different routers can PM me with their router model and I can assist from there.</p>
<p>5. For this guide I&#8217;ll be using the NETGEAR DG834GT. Once you logon to the routers remote configuration page select &#8216;services&#8217; from the menu on the left hand side. This part often isn&#8217;t required for most other routers, just NETGEARS.</p>
<p>6. Click &#8216;Add custom service&#8217;</p>
<p>7. In the first box enter the name of the service for example: RSPS. In the second box select TCP/UDP. In the third box enter the port you wish to forward (43594) enter this value into the forth box also.</p>
<p>8. Select &#8216;Firewall Rules&#8217; from the left menu.</p>
<p>9. You should see two tables, Outbound services and Inbound services.</p>
<p>10. Under outbound services select &#8216;Add&#8217;</p>
<p>11. In the first drop down menu select the service you created before (RSPS).</p>
<p>12. In the second drop down menu select Always allow.</p>
<p>13. Leave both the LAN IP options as Any and the the the Log as always.</p>
<p>14. Click Apply.</p>
<p>15. Click &#8216;add&#8217; under Inbound services</p>
<p>16. Do what you did for outbound accept you will have a &#8216;Send to LAN&#8217; textbox now. Enter the static IP you set earlier.</p>
<p>17. Your portforwarding is now complete, finally!</p>
<p>Hope you found this guide useful and remember if you need help PM me the router name/model and I&#8217;ll get back to you as soon as I can.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.runescapeps.com/10/portforwarding-guide/feed/</wfw:commentRss>
		<slash:comments>2350</slash:comments>
		</item>
		<item>
		<title>How To Make Your Own RuneScape Private Server?</title>
		<link>http://www.runescapeps.com/9/how-to-make-your-own-runescape-private-server/</link>
		<comments>http://www.runescapeps.com/9/how-to-make-your-own-runescape-private-server/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 09:49:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Runescape Private Server]]></category>
		<category><![CDATA[private server]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.runescapeps.com/?p=9</guid>
		<description><![CDATA[NO! This is not HOW to make a server&#8230;&#8230; Purpose = To Put All Tutorials Into One, I Know There Have Been A Lot Of These Before But You Still Get People Asking Questions On Really Basic Things So I Will Try To Explain Them Here. Dont Post If You Think This Is Just Another [...]]]></description>
			<content:encoded><![CDATA[<p>NO! This is not HOW to make a server&#8230;&#8230;</p>
<p>Purpose = To Put All Tutorials Into One, I Know There Have Been A Lot Of  These Before But You Still Get People Asking Questions On Really Basic  Things So I Will Try To Explain Them Here. Dont Post If You Think This  Is Just Another Nooby Tutorial. I Wont Go Into Detail In Coding A  Server, But This Should Explain How To Add NPC&#8217;s, Add Objects, Add Item  On Item, Item on Object, Cases, Adding Menus, Adding Requirements To  Things, Chests Giving Random Items, Npc Drops. Therefore, If You Know  All This Dont Post If You Think Its Rubbish. Hopefully It Will Actually  Help Someone. This isn&#8217;t a Copy &amp; Past Tutorial As I Will Explain  What Things Happen</p>
<p>&#8212;&#8211; Adding Npc&#8217;s &#8212;&#8211;<br />
All Current Servers Have A File Called Autospawn.cfg. This Is Where All  NPC&#8217;s Are Stored In Your Server Therefore Open This And You Should See A  List Of Npc&#8217;s Like The One Below. Example;</p>
<div>
<div>Code:</div>
<pre dir="ltr">spawn = 461	2844	3351	0	0	0	0	0	1	Rune Store</pre>
</div>
<p>Now I Will Explain Each Part Of This</p>
<div>
<div>Code:</div>
<pre dir="ltr">spawn = 461</pre>
</div>
<p>This Is Telling You What Npc You Want To Spawn, In This Case It  Would Be The Npc 461. To Check All The Other Npc ID&#8217;s Go Into Your  NPC.Cfg File, Hit Ctrl+F and Type In The Name Of The Npc Your Looking  For Then Just Copy Their ID.</p>
<div>
<div>Code:</div>
<pre dir="ltr">2844 3351</pre>
</div>
<p>These Are The X And Y Coordinates Of Where You Want The Npc To  Spawn In Your Server, Some Servers Should Have A Command Already In Them  Such As ::mypos Or Have Your Coordinates Displayed In The Emotes Menu.</p>
<div>
<div>Code:</div>
<pre dir="ltr">0	0	0	0	0	1</pre>
</div>
<p>This Is More Difficult In Explaining, This Code Tells You Where Or  If You Want The Npc To Move Around. At The Moment The Npc Would Not  Move Because There Are No Coordinates Entered And &#8220;Walktype&#8221; Is Set To 1  Which Is Stationary. I Have Added An Example To Show You What A Moving  NPC Should Have</p>
<div>
<div>Code:</div>
<pre dir="ltr">spawn = 1156	3497	9505	0	3490	9500	3500	9520	2	Kalph Worker</pre>
</div>
<p>If You Want The NPC To Move Then Change &#8220;Walktype&#8221; Into 2 And Then  Change The X And Y Positions To How Far You Want The Npc To Walk. The  First X and Y Positions Are ALWAYS Smaller Than The Set Coordinates, The  Other 2 X and Y Positions Are ALWAYS Bigger.</p>
<p>&#8212;&#8211; Adding Objects &#8212;&#8211;<br />
If You Want To Delete Or Add New Global Objects Then You Should Open  Your Client.java file. This Will Only Work If Your Server Already Has  Global Objects Added, Which All Newly Posted Servers Should Have. Hit  Ctrl + F And Find This;</p>
<div>
<div>Code:</div>
<pre dir="ltr">NewObjects() {</pre>
</div>
<p>Under This You Should See One Of These Two;</p>
<div>
<div>Code:</div>
<pre dir="ltr">	       makeGlobalObject(XXXX, YYYY, ID, DIRECTION, 10)</pre>
</div>
<div>
<div>Code:</div>
<pre dir="ltr">	       addGlobalObject(XXXX, YYYY, ID, DIRECTION, 10)</pre>
</div>
<p>Example;</p>
<div>
<div>Code:</div>
<pre dir="ltr">	       makeGlobalObject(2853, 3348, 6552, -1, 10);//altar</pre>
</div>
<p>Explenation;</p>
<div>
<div>Code:</div>
<pre dir="ltr">(XXXX, YYYY</pre>
</div>
<p>These Are Simply Just The X and Y Coordinates Of Where You Want  Your Globalobject To Be Placed.</p>
<div>
<div>Code:</div>
<pre dir="ltr">, ID,</pre>
</div>
<p>Go Find The ID Of The Object You Want To Add And Put It In Here.</p>
<div>
<div>Code:</div>
<pre dir="ltr">, DIRECTION,</pre>
</div>
<p>This will determine which way your object will face.</p>
<div>
<div>Code:</div>
<pre dir="ltr">10)</pre>
</div>
<p>This tells you what the thing you are adding, if your only adding  Objects Then DO NOT change it otherwise it wont work.</p>
<p>&#8212;&#8211; Deleting Objects &#8212;&#8211;<br />
To Delete Global Objects Go Into Client.java, Hit Ctrl + F And Search  For This</p>
<div>
<div>Code:</div>
<pre dir="ltr">Deleteobjects() {</pre>
</div>
<p>Then Scroll Down And You Should See Something Like This</p>
<div>
<div>Code:</div>
<pre dir="ltr">  	       deletethatobject(2785, 3175); //plant</pre>
</div>
<p>This Is Much Simpler Than Adding Objects As All You Need To Do Is  Enter The X &amp; Y Coordinates Of The Object You Want To Delete. NOTE:  If You Delete An Object You Will Not Be Able To Place A New Object In  The Position Of The Deleted Object, If You Want To Place A New Object  Simply Add That Object As It Will Automatically Change The Object Thats  In Its Place.</p>
<p>&#8212;&#8211; Item On Item &#8212;&#8211;<br />
Item On Item Is Simply What It Is, You Use A Certain Item On Another  Item And That Can Give Anything From Money, Any Other Item, Exp,  Messages etc. Go Into Your Client.java (If Your Server Has A Text File  With Item on Items Then Open That) And Under Any Command You Can Add  This</p>
<div>
<div>Code:</div>
<pre dir="ltr">				else if(itemUsed == 243 &amp;&amp; useWith == 233) {
					deleteItem(243, getItemSlot(243), 1);
					addItem(241, 1);
				}</pre>
</div>
<p>Explenation;</p>
<div>
<div>Code:</div>
<pre dir="ltr">			else if(itemUsed == 243 &amp;&amp; useWith == 233) {</pre>
</div>
<p>This Is Just Telling Which Items Will Be Used Together. However,  This Will Only Go One Way. You Will Need To Create Another One Of These  If You Wanted The Item 233 To Be Used With Item 243. At This Time Only  243 Can Be Used With 233.</p>
<div>
<div>Code:</div>
<pre dir="ltr">					deleteItem(243, getItemSlot(243),</pre>
</div>
<p>1);<br />
This Is Telling You That When You Use The Two Items That The Item 243  Will Be Deleted From Your Inventory.</p>
<div>
<div>Code:</div>
<pre dir="ltr">					addItem(241, 1);</pre>
</div>
<p>When You Use The Two Items Together You Will Receive The Item 241.  If Your Wondering, I Used This For Herblore When Your Adding Herbs To  The Vial Of Water.</p>
<p>This Is As Simple As It Gets, If You Want Anything Else You Should Try  It On Your Own, All I Have Done Is Just Explained What Will Happen When  You Use Two Items. You Can Also Add Messages, Requirements And Much  More. Just So You Know What It Looks Like I Have Posted An Example Of A  Much Complicated Item On Item Below:</p>
<div>
<div>Code:</div>
<pre dir="ltr">				else if(itemUsed == 99 &amp;&amp; useWith == 231) {
					if(playerLevel[15] &gt;= 28) {
						deleteItem(99, getItemSlot(99), 1);
						deleteItem(231, getItemSlot(231), 1);
						addItem(139, 1);
						addSkillXP(20000, 15);
					} else {
						sendMessage("You need a higher herblore level to make this potion.");
					}</pre>
</div>
<p>&#8212;&#8211; Item On Object &#8212;&#8211;<br />
This Is Also Simple, You Use A Certain Item On A Certain Object And That  Can Teleport You, Give You Items, Exp, Open Interfaces etc. First, Go  Into Your Client.java, Hit Ctrl + F And Find This</p>
<div>
<div>Code:</div>
<pre dir="ltr">+atObjectID+" atObjectY: "+atObjectY+" itemS</pre>
</div>
<p>IF When You Searched For The Code Above And You Couldn&#8217;t Find  Anything Like It Then Try Find This</p>
<div>
<div>Code:</div>
<pre dir="ltr">atObjectID ==</pre>
</div>
<p>You Should Find Something Like This</p>
<div>
<div>Code:</div>
<pre dir="ltr">                                if (useItemID == ITEMID &amp;&amp; atObjectID == OBJECTID)
                                {
				teleportToX = XXXX;
				teleportToY = YYYY;
                                sendMessage("---- YOUR MESSAGE -----");
                                sendMessage("---- YOUR MESSAGE 2 ---");
                                }</pre>
</div>
<p>This Is A Simple Item On Object, Again, You Can Make It Much More  Complex By Adding Things Such As Exp, Level Requirements etc. Its  Telling You That When You Use That Item On That Object You Will Be  Teleported And Then You Will Get Two Messages On Your Chat Box.</p>
<p>&#8212;&#8211; Cases for Objects &#8212;&#8211;<br />
Cases Represent Objects That Work On Their Own i.e. Portals. Again, You  Can Make A Case Very Simple By Adding Certain Messages Or Make It More  Complicated. Go Into Your Client.java and Find This</p>
<div>
<div>Code:</div>
<pre dir="ltr">//QUEST_1 OBJECTS</pre>
</div>
<p>If You Cannot Find It In Your Server Then Simply Find A Object  That Makes You Do Something i.e. Haystacks And Search For Their Case. So  Haystacks Would Be Case 300; Because The Object ID Of The Haystack Is  300.<br />
Underneath What You have Just Found You Should See A Lot Of Cases, Find  The Object ID You Want To Use (Make Sure The Object Is Usable) And Then  Simply Name it &#8220;Case OBJECTID;&#8221;. Example;</p>
<div>
<div>Code:</div>
<pre dir="ltr">case 4499:
break;</pre>
</div>
<p>You Should always add a &#8220;break;&#8221; to show that you are ending that  code. Thats it, nothing is added yet so lets add a teleport to this  case.</p>
<div>
<div>Code:</div>
<pre dir="ltr">case 4499:
teleportToX = XXXX;
teleportToY = YYYY;
break;</pre>
</div>
<p>This will teleport you to those coordinates when you click on that  object. This is at its simplest and it can be used for a ladder or  portal. I have coded in a custom castle wars minigame and i used cases  for my portals. This is an example of what i coded.</p>
<div>
<div>Code:</div>
<pre dir="ltr">case 4388: // zammy home
if (playerHasItem(4513) == true &amp;&amp; playerHasItem(4514) == true){
sendMessage("You cannot enter with other god items.");
sendMessage("They have been removed.");
deleteItem(4513, getItemSlot(4513), 1);
deleteItem(4514, getItemSlot(4514), 1);
teleportToX = 2441;
teleportToY = 3090;
} else {
if (playerEquipment[playerCape] == 4514 &amp;&amp; playerEquipment[playerHat] == 4513) {
sendMessage("You cannot enter with zammy items.");
sendMessage("Please use the bankbooth and store them safely.");
} else {
if (playerEquipment[playerCape] == 4516 &amp;&amp; playerEquipment[playerHat] == 4515) {
teleportToX = 2422;
teleportToY = 9526;
sendMessage("You are teleported to the waiting arena.");
sendMessage("Use the portal to begin castle wars.");
} else {
if (playerHasItem(4516) == true &amp;&amp; playerHasItem(4515) == true){
sendMessage("Please put on your cape and hat.");
} else {
if (playerHasItem(4516) == false &amp;&amp; playerHasItem(4515) == false){
addItem(4515, 1);
addItem(4516, 1);
sendMessage("You get your hat and cape.");
}
}
}
}
}
break;</pre>
</div>
<p>Feel free to use this, to explain what this does. If The Other  Player Has The Opposing God Items On Or In Their Inventory They Will Be  Removed. If The Player Does Not Have A Cape Or Hood They Will Get One  And By Only Allowed To Enter If They Wear It. Like I Said You Can Add  Anything To Cases .</p>
<p>&#8212;&#8211; Adding Menus &#8212;&#8211;<br />
In This Part I Will Only Show You How To Add A Menu When You Click On  The Skill Icon. Feel Free To Use This If You Need To But I Wont Tell You  All Of The Menus. To add a menu so when you click on a skill icon it  opens go into your client.java and find</p>
<div>
<div>Code:</div>
<pre dir="ltr">case 21234: // Burst Of Strength</pre>
</div>
<p>Above that you should see a line and then above that line you can  add all the cases for skill menus.</p>
<div>
<div>Code:</div>
<pre dir="ltr">case 2161: // attackskillmenu
{
Attackskillmenu();
}
break;</pre>
</div>
<p>This is just an example of one, the attack skill menu. To add a  working menu find this</p>
<div>
<div>Code:</div>
<pre dir="ltr">public void updatePlayers()</pre>
</div>
<p>If you using a prviously coded server then when you scroll down  you should see already made menus. Then just add this one under the last  }.</p>
<div>
<div>Code:</div>
<pre dir="ltr">	public void Attackskillmenu()
	{

					sendQuest("", 8144);  //Title
					clearQuestInterface();
					sendQuest("", 8145);
					sendQuest("", 8149);
					sendQuest("", 8151);
				        sendQuest("", 8152);
					sendQuest("", 8153);
					sendQuestSomething(8143);
					showInterface(8134);
					flushOutStream();
				}</pre>
</div>
<p>In the title box enter the name of the skill menu.</p>
<div>
<div>Code:</div>
<pre dir="ltr">					sendQuest("", 8145);</pre>
</div>
<p>This is the title of the page.</p>
<div>
<div>Code:</div>
<pre dir="ltr">					sendQuest("", 8145);
					sendQuest("", 8149);
					sendQuest("", 8151);
				        sendQuest("", 8152);
					sendQuest("", 8153);</pre>
</div>
<p>Here you just put in what you want your menu to have. If it has a  gap in number that means that there is a space between lines. Just add  more numbers if you want to have a bigger menu. If you wanted to have a  menu open by command then you could use something like this below;</p>
<div>
<div>Code:</div>
<pre dir="ltr">if (command.startsWith("Attackskillmenu")) {
Attackskillmenu();
}</pre>
</div>
<p>&#8212;&#8211; Item Requirements &#8212;&#8211;<br />
Here I Will Explain How to Add Item Requirements i.e. 80 attack for d  bow. First of all go into your client.java and find this.</p>
<div>
<div>Code:</div>
<pre dir="ltr">public int GetCLRanged(int ItemID) {</pre>
</div>
<p>When you search this underneath you should see a lot of these;</p>
<div>
<div>Code:</div>
<pre dir="ltr">:
			if (ItemID == 10713) {
			return 99;
	}</pre>
</div>
<p>This outlines The Item ID (10713) and then the return 99; tells  you what level you need to be able to wear it. As this is under Range it  means that you need 99 range to be able to wear that specific item. You  can find more underneath or above that one for all different levels. (  This may be different on other sources, im using Czar)</p>
<p>&#8212;&#8211; Chests Giving Random Items &#8212;&#8211;<br />
Here we can add a chest that will give random items when the person  clicks on it. We will need to modify/add two files, item2 and  client.java. First of all go into your item2 and search for</p>
<div>
<div>Code:</div>
<pre dir="ltr">public static int runerock</pre>
</div>
<p>under the whole thing you should see.</p>
<div>
<div>Code:</div>
<pre dir="ltr">public static int runerock[] = {451,451,451,451,451,451,451};

    public static int randomRuneRock()
    {
    	return runerock[(int)(Math.random()*runerock.length)];
    }</pre>
</div>
<p>This tells you that when you click on this particular rock that  you will only get the item 451 (rune ore). Dont use this as a base for  mining because it sucks.</p>
<div>
<div>Code:</div>
<pre dir="ltr">public static int runerock[] = {451,451,451,451,451,451,451};</pre>
</div>
<p>This is showing what you are declaring, you have to rename  runerock to anything that you want. Where you have the 451 items you  should also delete them. The item on the left hand side will be the most  likely item received from the rock and the item furthest right will be  the least likely item recieved from the rock.</p>
<div>
<div>Code:</div>
<pre dir="ltr">    public static int randomRuneRock()
    {
    	return runerock[(int)(Math.random()*runerock.length)];</pre>
</div>
<p>Where you have runerock you would have to change to what you named  it in the first code. Heres an example of what a barrows chest would  look like.</p>
<div>
<div>Code:</div>
<pre dir="ltr">public static int Barrows[] = {4708,4710,4712,4714,4716,4718,4720,4722,4724,4726,4728,4730,4732,4734,4736,4738,4743,4745,4747,4749,4751,4753,4755,4757,4759};

    public static int randomBarrows()
    {
    		return Barrows[(int)(Math.random()*Barrows.length)];
    }</pre>
</div>
<p>This is showing you that the item 4708 will be the most likely  item received from the chest and that item 4759 will be the least  likely.<br />
To add this to a chest go into your client.java and find a case for that  chest (look at cases at the top for help)</p>
<div>
<div>Code:</div>
<pre dir="ltr">case 10284:
addItem(Item2.randomBarrows(), 1);
teleportToX = XXXX;
teleportToY = YYYY;
break;</pre>
</div>
<p>This would give the person an item from the barrowschest and then  teleport them outside.</p>
<p>&#8212;&#8211; Npc Drops &#8212;&#8211;<br />
Npc Drops are kind of similar to random chests but Npc Drops aren&#8217;t  added in client.java. First of all, go into your item2 and do thesame  thing that you did in random chests. Just copy + paste an already done  code and rename it to what you want. You can use this if you want but  its just an example.</p>
<div>
<div>Code:</div>
<pre dir="ltr">public static int NAME[] = {ID,ID,ID,ID,ID,ID,ID,ID};

    public static int randomNAME()
    {
    	return NAME[(int)(Math.random()*NAME.length)];
    }</pre>
</div>
<p>Where you can see NAME change it to what ever you like but it has  to be kept the same. Where you can see ID then add item ID&#8217;s that you  want, the one on the left will be the most likely to drop and the one on  the right will be the least likely to drop. When you have done that go  into your NPChandler and find this.</p>
<div>
<div>Code:</div>
<pre dir="ltr">npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller</pre>
</div>
<p>Keep searching until you find something similar to this:</p>
<div>
<div>Code:</div>
<pre dir="ltr">if(npcs[NPCID].npcType == NPCID) {
ItemHandler.addItem(Item2.randomNAME(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);</pre>
</div>
<p>Here where you can see NPCID just enter the NPC that when you kill  will drop those items. Where You Can see NAME enter the name you  entered earlier in item2 so that it can load it here when they die.  Thats IT!</p>
<p>And There You Have it. I Hoped This Helped With Any Problems That You  Were Having. If You Still Have Problems Post Them Here. NO FLAMING PLS  TY!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.runescapeps.com/9/how-to-make-your-own-runescape-private-server/feed/</wfw:commentRss>
		<slash:comments>2166</slash:comments>
		</item>
		<item>
		<title>Runescape Private Server Webclient Tutorial Version 317</title>
		<link>http://www.runescapeps.com/7/runescape-private-server-webclient-tutorial-version-317/</link>
		<comments>http://www.runescapeps.com/7/runescape-private-server-webclient-tutorial-version-317/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 16:43:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Runescape Private Server]]></category>
		<category><![CDATA[private server]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[version 317]]></category>
		<category><![CDATA[webclient]]></category>

		<guid isPermaLink="false">http://www.runescapeps.com/?p=7</guid>
		<description><![CDATA[This is a basic webclient tutorial for 317 clients. Last Updated: *Check the Revision History* Difficulty: Medium (Based on the poll above) Purpose: To turn your 317 client into a webclient for your rsps. Browser&#8217;s Tested on: Google Chrome, Internet Explorer, Mozilla Firefox, Opera. Client&#8217;s Tested on: Should work on all 317 clients Classes Modified: [...]]]></description>
			<content:encoded><![CDATA[<p>This is a basic webclient tutorial for 317 clients.</p>
<p><strong><span style="color: red;">Last Updated:</span></strong> *Check the Revision History*<br />
<strong><span style="color: red;">Difficulty:</span></strong> Medium (Based on the poll above)<br />
<strong><span style="color: red;">Purpose:</span></strong> To turn your 317 client into a webclient for your rsps.<br />
<strong><span style="color: red;">Browser&#8217;s Tested on:</span></strong> Google Chrome, Internet Explorer, Mozilla Firefox, Opera.<br />
<strong><span style="color: red;">Client&#8217;s Tested on:</span></strong> Should work on all 317 clients<br />
<strong><span style="color: red;">Classes Modified:</span></strong> Signlink.java, Client.java, Class30_Sub2_Sub1_Sub1.java<br />
<strong><span style="color: red;">Table of Contents:</span></strong></p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;"><span style="text-decoration: underline;"><strong><span style="color: red;">Section 1 &#8211; Updates/Requirements</span></strong></span><br />
1.1 &#8211; Revision History<br />
1.2 &#8211; Requirements<br />
1.3 &#8211; Files Needed<br />
<span style="text-decoration: underline;"><strong><span style="color: red;">Section 2 &#8211; Tutorial</span></strong></span><br />
2.1 &#8211; Step 1 &#8211; Signlink.java<br />
2.2 &#8211; Step 2 &#8211; Client.java<br />
2.3 &#8211; Step 3 &#8211; Class30_Sub2_Sub1_Sub1.java(Sprites)<br />
2.4 &#8211; Jarring and Signing<br />
2.5 &#8211; Webclient Web Page<br />
2.6 &#8211; End of tutorial details<br />
<span style="text-decoration: underline;"><strong><span style="color: red;">Section 3 &#8211; Extra</span></strong></span><br />
3.1 &#8211; Frequently Asked Questions<br />
3.2 &#8211; Credits</td>
</tr>
</tbody>
</table>
</div>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><span style="text-decoration: underline;"><strong><span style="color: red;">Section 1 &#8211; Updates/Requirements</span></strong></span></p>
<p><strong><span style="color: red;">1.1 &#8211; Revision History:</span></strong></p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Code:</div>
<pre class="alt2" style="text-align: left; margin: 0px; width: 640px; height: 162px; overflow: auto; border: 1px inset; padding: 6px;" dir="ltr">1/2/09 - Downloading cache percentage will appear in the client(no more jframe)
1/3/09 - Downloads cache faster.
4/1/09 - Tutorial re-written.
4/2/09 - Uploaded "Cache + Sprites Zipping" video to youtube.
4/25/09 - Tutorial updated.
4/28/09 - Step 2.6 was updated.
5/3/09 - Step 2.3 was updated.
8/22/09 - New FAQ question and updated browser's tested on list.
10/16/09 - Tutorial updated.</pre>
</div>
<p><strong><span style="color: red;">1.2 &#8211; Requirements</span></strong><br />
1. Regular Web host or VPS(Virtual Private Server) or Dedi(Dedicated Server) &#8211; For the webclient page, client.jar(Should be around 600kb), cache.zip(usually is around 16mb)<br />
2. Jar maker &#8211; Download below<br />
3. A 317 client<br />
4. Patience and Time</p>
<p><strong><span style="color: red;">1.3 &#8211; Files to download:</span></strong><br />
Jar Maker: <a href="http://www.goldenstudios.or.id/products/utilities/jarmaker/JARMaker.zip" target="_blank">http://www.goldenstudios.or.id/produ&#8230;r/JARMaker.zip</a></p>
<p><span style="text-decoration: underline;"><strong><span style="color: red;">Section 2 &#8211; Tutorial:</span></strong></span><br />
A video on what to do. I know it&#8217;s not very well made but it might help in some way.<br />
<span style="text-decoration: underline;"><strong>Webclient tutorial video:</strong></span> <a href="http://www.youtube.com/watch?v=l7o4uNTrdEQ&amp;fmt=22" target="_blank">http://www.youtube.com/watch?v=l7o4uNTrdEQ&amp;fmt=22</a><br />
You can subscribe if you want. Maybe someday I will decide to re-make a better explained webclient tutorial video.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong><span style="color: red;">2.1 &#8211; Step 1 &#8211; Signlink.java</span></strong><br />
Open up Signlink.java and search for <span style="color: red;">findcachedir()</span>. In that method you will see something like this:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">s = &#8220;&#8221;;<br />
s1 = &#8220;./cache/&#8221;;</td>
</tr>
</tbody>
</table>
</div>
<p>highlight those 2 lines and replace it with the following:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">s = &#8220;C:/.<span style="color: red;">yourclientname</span>_file_store_32/&#8221;;<br />
s1 = &#8220;&#8221;;</td>
</tr>
</tbody>
</table>
</div>
<p>replace <span style="color: red;">yourclientname</span> with the name of your client &#8211; no spaces. For example: C:/.ricscape_file_store_32/<br />
Save signlink.java and close it.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong><span style="color: red;">2.2 &#8211; Step 2 &#8211; Client.java</span></strong><br />
Open up client.java and search for <span style="color: red;">Class44 method67</span> and replace it with this one:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Code:</div>
<pre class="alt2" style="text-align: left; margin: 0px; width: 640px; height: 498px; overflow: auto; border: 1px inset; padding: 6px;" dir="ltr">private Class44 method67(int i, String s, String s1, int j, byte byte0, int k)
	  {
	    byte abyte0[] = null;
	    int l = 5;
	    try
	    {
	      if(aClass14Array970[0] != null)
	      {
	        abyte0 = aClass14Array970[0].method233(true, i);
	      }
	      if(abyte0 == null)
						      {
							method13(15, (byte)4, "Downloading Cache");
downloadcache("YOUR CACHE URL LINK HERE", "cache.zip", "", "cache");
}
if(aClass14Array970[0] != null)
	      {
	        abyte0 = aClass14Array970[0].method233(true, i);
	      }
	    }
	    catch(Exception exception) { }
	    if(abyte0 != null);
	    if(abyte0 != null)
	    {
	      Class44 class44 = new Class44(44820, abyte0);
	      return class44;
	    }
	    int i1 = 0;
	    do
	    {
	      if(abyte0 != null)
	      {
	        break;
	      }
	      String s2 = "Unknown error";
	      method13(k, (byte)4, "Client updated - please reload client");
	      //method13(k, (byte)4, (new StringBuilder()).append("Requesting ").append(s).toString());
	      Object obj = null;
	      try
	      {
	        int j1 = 0;
	        DataInputStream datainputstream = method132((new StringBuilder()).append(s1).append(j).toString());
	        byte abyte1[] = new byte[6];
	        datainputstream.readFully(abyte1, 0, 6);
	        Class30_Sub2_Sub2 class30_sub2_sub2 = new Class30_Sub2_Sub2(abyte1, 891);
	        class30_sub2_sub2.anInt1406 = 3;
	        int l1 = class30_sub2_sub2.method412() + 6;
	        int i2 = 6;
	        abyte0 = new byte[l1];
	        for(int j2 = 0; j2 &lt; 6; j2++)
	        {
	          abyte0[j2] = abyte1[j2];
	        }

	        while(i2 &lt; l1)
	        {
	          int k2 = l1 - i2;
	          if(k2 &gt; 1000)
	          {
	            k2 = 1000;
	          }
	          int l2 = datainputstream.read(abyte0, i2, k2);
	          if(l2 &lt; 0)
	          {
	            s2 = (new StringBuilder()).append("Length error: ").append(i2).append("/").append(l1).toString();
	            throw new IOException("EOF");
	          }
	          i2 += l2;
	          int i3 = (i2 * 100) / l1;
	          if(i3 != j1)
	          {
	            method13(k, (byte)4, (new StringBuilder()).append("Loading ").append(s).append(" - ").append(i3).append("%").toString());
	          }
	          j1 = i3;
	        }
	        datainputstream.close();
	        try
	        {
	          if(aClass14Array970[0] != null)
	          {
	            aClass14Array970[0].method234(abyte0.length, abyte0, (byte)2, i);
	          }
	        }
	        catch(Exception exception3)
	        {
	          aClass14Array970[0] = null;
	        }
	      }
	      catch(IOException ioexception)
	      {
	        if(s2.equals("Unknown error"))
	        {
	          s2 = "Connection error";
	        }
	        abyte0 = null;
	      }
	      catch(NullPointerException nullpointerexception)
	      {
	        s2 = "Null error";
	        abyte0 = null;
	        if(!signlink.reporterror)
	        {
	          return null;
	        }
	      }
	      catch(ArrayIndexOutOfBoundsException arrayindexoutofboundsexception)
	      {
	        s2 = "Bounds error";
	        abyte0 = null;
	        if(!signlink.reporterror)
	        {
	          return null;
	        }
	      }
	      catch(Exception exception1)
	      {
	        s2 = "Unexpected error";
	        abyte0 = null;
	        if(!signlink.reporterror)
	        {
	          return null;
	        }
	      }
	      if(abyte0 == null)
	      {
	        for(int k1 = l; k1 &gt; 0; k1--)
	        {
	          if(i1 &gt;= 3)
	          {
	            method13(k, (byte)4, "Game updated - please reload page");
	            k1 = 10;
	          } else
	          {
	            method13(k, (byte)4, (new StringBuilder()).append(s2).append(" - Retrying in ").append(k1).toString());
	          }
	          try
	          {
	            Thread.sleep(1000L);
	          }
	          catch(Exception exception2) { }
	        }

	        l *= 2;
	        if(l &gt; 60)
	        {
	          l = 60;
	        }
	        aBoolean872 = !aBoolean872;
	      }
	    } while(true);
	    Class44 class44_1 = new Class44(44820, abyte0);
	    if(byte0 != -41)
	    {
	      throw new NullPointerException();
	    } else
	    {
	      return class44_1;
	    }
  }</pre>
</div>
<p>Replace the following:<br />
<span style="color: red;">YOUR CACHE URL LINK HERE</span><br />
<span style="color: red;">cache.zip</span><br />
which is in this line:<br />
downloadcache(&#8220;YOUR CACHE URL LINK HERE&#8221;, &#8220;cache.zip&#8221;, &#8220;&#8221;, &#8220;cache&#8221;);<br />
You only replace what&#8217;s in the first 2 quotes.</p>
<p>The first quote is your link.<br />
Your cache link must end with .zip<br />
For example:<br />
<span style="color: red;">http://yoursite.com/cache.zip</span></p>
<p>The second quote is the extraction, so it would like this:<br />
&#8220;cache.zip&#8221;<br />
Unless your zip file has a different name. If it does then you would put:<br />
&#8220;zipfilename.zip&#8221;</p>
<p>This is the most important method and without it your webclient will not work.<br />
On top of <span style="color: red;">Class44 method67</span> put this:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Code:</div>
<pre class="alt2" style="text-align: left; margin: 0px; width: 640px; height: 498px; overflow: auto; border: 1px inset; padding: 6px;" dir="ltr">    public String name;
    public String dir;

public void downloadcache(String url, String name1, String dir1, String type)
    {
        dir = dir1;
        name = name1;
        try
        {
            URLConnection connection = (new URL(url)).openConnection();
            String f[] = url.split("/");
            File file = new File(f[f.length - 1]);
            int length = connection.getContentLength();
            InputStream instream = connection.getInputStream();
            try{new File(signlink.findcachedir()+dir).mkdir();}catch(Exception e){}
            FileOutputStream outstream = new FileOutputStream(signlink.findcachedir()+dir+file);
            int size = 0;
            int copy;
            byte[] buffer = new byte[4096];
            while((copy = instream.read(buffer)) != -1)
            {
                outstream.write(buffer, 0, copy);
                size+= copy;
                int percentage = (int)(((double)size / (double)length) * 100D);
                method13(percentage, (byte)4, "Downloading Cache - "+percentage+"%");
            }
            if(length != size)
            {
                instream.close();
                outstream.close();
            } else
            {
                method13(5, (byte)4, "Unpacking files...");
                instream.close();
                outstream.close();
                unZipFile();
                deleteFile();
                method13(10, (byte)4, "Unpacking was complete");
            }
        }
        catch(Exception e)
        {
            System.err.println("Error connecting to server.");
            e.printStackTrace();
        }
    }
    public void writeStream(InputStream In, OutputStream Out) throws IOException
    {
        byte Buffer[] = new byte[4096];
        int Len;
        while((Len = In.read(Buffer)) &gt;= 0)
        {
            Out.write(Buffer, 0, Len);
        }
        In.close();
        Out.close();
    }

    public void unZipFile()
    {
        try
        {
            ZipFile ZipFile = new ZipFile(signlink.findcachedir()+dir+name);
            for(Enumeration Entries = ZipFile.entries(); Entries.hasMoreElements();)
            {
                ZipEntry Entry = (ZipEntry)Entries.nextElement();
                if(Entry.isDirectory())
                {
                    (new File(signlink.findcachedir()+dir+Entry.getName())).mkdir();
                } else
                {
                    writeStream(ZipFile.getInputStream(Entry), new BufferedOutputStream(new FileOutputStream(signlink.findcachedir()+dir+Entry.getName())));
                }
            }
            ZipFile.close();
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }

    public void deleteFile()
    {
        try
        {
            File file = new File(signlink.findcachedir()+dir+name);
            file.delete();
        }
        catch(Exception e)
        {
            e.printStackTrace();
        }
    }</pre>
</div>
<p>Once you have added those method&#8217;s in your client.java, scroll all the way up still you see import&#8217;s then add the following under the rest of them.</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Code:</div>
<pre class="alt2" style="text-align: left; margin: 0px; width: 640px; height: 130px; overflow: auto; border: 1px inset; padding: 6px;" dir="ltr">import java.awt.Dimension;
import java.net.URL;
import java.net.URLConnection;
import javax.swing.*;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;</pre>
</div>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong><span style="color: red;">2.3 &#8211; Step 3 &#8211; Class30_Sub2_Sub1_Sub1.java(Sprites)</span></strong><br />
Now for the sprite part. Which most people don&#8217;t do right. I don&#8217;t know why. =\<br />
Open up Class30_Sub2_Sub1_Sub1.java and replace all:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">./Sprites/</td>
</tr>
</tbody>
</table>
</div>
<p>with this</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">C:/.<span style="color: red;">yourclientname</span>_file_store_32/Sprites/</td>
</tr>
</tbody>
</table>
</div>
<p>Like this:<br />
<img src="http://img5.imageshack.us/img5/5042/likethisr.png" border="0" alt="" /><br />
Do the same for the background</p>
<p>Once you have changed the location your client reads the sprites from, save the file and close it.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong><span style="color: red;">2.4 &#8211; Jarring and Signing</span></strong><br />
Before we start make sure you have downloaded the jar maker(located above).<br />
Note: When you jar your client the cache and sprites folder can not be in the client folder. Move or delete them.<br />
If you have already downloaded the jar maker then run the jar maker and watch the following video.</p>
<p>Jarring and signing video: <a href="http://www.youtube.com/watch?v=9obXgxm_9qY&amp;fmt=18" target="_blank">http://www.youtube.com/watch?v=9obXgxm_9qY&amp;fmt=18</a></p>
<p>Once you have jarred and signed the client, Put the cache files(Everything inside the cache folder) and sprite &#8220;folder&#8221; in a zip file.</p>
<p>To understand what I mean watch this video:<br />
<a href="http://www.youtube.com/watch?v=KUPvCEObZuk" target="_blank">http://www.youtube.com/watch?v=KUPvCEObZuk</a></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong><span style="color: red;">2.5 &#8211; Webclient Web Page</span></strong><br />
Create a new html or php page with the following (This is an example of how it should be):</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">&lt;HTML&gt;<br />
&lt;HEAD&gt;<br />
&lt;TITLE&gt;Your Webclient&lt;/TITLE&gt;<br />
&lt;META HTTP-EQUIV=&#8221;PRAGMA&#8221; CONTENT=&#8221;NO-CACHE&#8221;&gt;<br />
&lt;/HEAD&gt;</p>
<p>&lt;BODY&gt;</p>
<p>&lt;applet name=&#8221;yourclientname&#8221; width=&#8221;765&#8243; height=&#8221;503&#8243; archive=&#8221;client.jar&#8221; code=&#8221;client.class&#8221;&gt;<br />
&lt;param name=&#8221;java_arguments&#8221; value=&#8221;-Xmx1024m&#8221;&gt;<br />
&lt;/applet&gt;</p>
<p>&lt;/BODY&gt;<br />
&lt;/HTML&gt;</td>
</tr>
</tbody>
</table>
</div>
<p>Replace yourclientname with the name of your client.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong><span style="color: red;">2.6 &#8211; End of tutorial details</span></strong><br />
This is what your webclient should do if you did this tutorial right:<br />
<a href="http://www.youtube.com/watch?v=4wzI6JJP-Ds&amp;fmt=22" target="_blank">http://www.youtube.com/watch?v=4wzI6JJP-Ds&amp;fmt=22</a></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><span style="text-decoration: underline;"><strong><span style="color: red;">Section 3 &#8211; Extra</span></strong></span><br />
<strong><span style="color: red;">3.1 &#8211; Frequently Asked Questions</span></strong><br />
<strong>Question:</strong> What&#8217;s a good free file host for my cache.zip?<br />
<strong>Answer:</strong> You can use any host that allows direct linking. I personally use this site:<br />
<a href="http://www.fileden.com/" target="_blank">http://www.fileden.com/</a></p>
<p><strong>Question:</strong> Ric, it&#8217;s too hard. Can you make it for me?<br />
<strong>Answer:</strong> No, I don&#8217;t do this for people anymore. You gotta learn how to make a webclient for when you update your client.</p>
<p><strong>Question:</strong> I get a blank page with a red X on it. What do I do?<br />
<strong>Answer:</strong> Right click and press Java Console and read the error.</p>
<p><strong>Question:</strong> The java console says it cannot find client.class, What should I do?<br />
<strong>Answer:</strong> I recommend deleting all the class files and recompile your client.</p>
<p><strong>Question:</strong> I get the 1,2,3,4,5 error. What do I do?<br />
<strong>Answer:</strong> Something is missing, corrupted or done wrong.</p>
<p><strong>Question:</strong> I get a java heap space error, What do I do?<br />
<strong>Answer:</strong> Make sure you have &lt;param name=&#8221;java_arguments&#8221; value=&#8221;-Xmx1024m&#8221;&gt; in your applet code.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.runescapeps.com/7/runescape-private-server-webclient-tutorial-version-317/feed/</wfw:commentRss>
		<slash:comments>3434</slash:comments>
		</item>
		<item>
		<title>How to make a Runescape Webclient for Version 525</title>
		<link>http://www.runescapeps.com/5/how-to-make-a-runescape-webclient-for-version-525/</link>
		<comments>http://www.runescapeps.com/5/how-to-make-a-runescape-webclient-for-version-525/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 16:36:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Runescape Private Server]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[version 525]]></category>
		<category><![CDATA[webclient]]></category>

		<guid isPermaLink="false">http://www.runescapeps.com/?p=5</guid>
		<description><![CDATA[Purpose: Webclient on 525 Difficulty: 5/10 Tested On: Any 525 base. Step 1: Open client2 and remove this part or quote it out Code: this.frame = new JFrame("Client name"); this.frame.setLayout(new BorderLayout()); this.frame.setResizable(true); this.jp.setLayout(new BorderLayout()); this.jp.add(this); this.jp.setPreferredSize(new Dimension(765, 503)); this.frame.getContentPane().add(this.jp, "Center"); this.frame.pack(); this.frame.setVisible(true); That removes the frame so it instead is embedded into the page. Step [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Purpose:</strong> Webclient on 525<br />
<strong>Difficulty:</strong> 5/10<br />
<strong>Tested On:</strong> Any 525 base.</p>
<p><strong>Step 1:</strong> Open client2 and remove this part or quote it out</p>
<div>
<div>Code:</div>
<pre dir="ltr"> this.frame = new JFrame("Client name");
    this.frame.setLayout(new BorderLayout());
    this.frame.setResizable(true);
      this.jp.setLayout(new BorderLayout());
      this.jp.add(this);
      this.jp.setPreferredSize(new Dimension(765, 503));
      this.frame.getContentPane().add(this.jp, "Center");
      this.frame.pack();
      this.frame.setVisible(true);</pre>
</div>
<p>That removes the frame so it instead is embedded into the page.<br />
<strong>Step 2:</strong><br />
go to class73 and change the cache Directory to C:/cache525</p>
<p><strong>Step 3:</strong> (IF you want an IP changer, otherwise skip this)<br />
put this at the top below the public class client2</p>
<div>
<div>Code:</div>
<pre dir="ltr">  public String IPaddr = "";</pre>
</div>
<p>Then under;</p>
<div>
<div>Code:</div>
<pre dir="ltr"> props.put("worldid", "2");
      props.put("members", "1");
      props.put("modewhat", "0");
      props.put("modewhere", "0");
      props.put("safemode", "0");
      props.put("game", "0");
      props.put("js", "1");
      props.put("lang", "0");
      props.put("affid", "0");
      props.put("highmem", "1");</pre>
</div>
<p>Put;</p>
<div>
<div>Code:</div>
<pre dir="ltr">IPaddr = JOptionPane.showInputDialog(null,"Please enter IP address:");</pre>
</div>
<p>Finally replace the &#8220;Getcodebase&#8221; Method with this if your using IP changer</p>
<div>
<div>Code:</div>
<pre dir="ltr">  public URL getCodeBase() {
    try {
      return new URL("http://"+IPaddr);
    } catch (Exception localException) {
      localException.printStackTrace();
      return null;
    }
  }</pre>
</div>
<p><strong>Step 4</strong>: Compile, Then Assuming you have JAR maker, (if you don&#8217;t, its found here: <a href="http://www.goldenstudios.or.id/products/utilities/jarmaker/JARMaker.zip" target="_blank">http://www.goldenstudios.or.id/produ&#8230;r/JARMaker.zip</a>)<br />
JAR the Client, Set the manifest template to client2 as main class<br />
Then Sign it by Generating the Keystore And signing as Usual, if you don&#8217;t know how, find another webclient tutorial (this is a fast one) And Upload to your website, the HTML file is this:</p>
<div>
<div>Code:</div>
<pre dir="ltr"><span style="color: #000080;">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;</span>
<span style="color: #000080;">&lt;html style=<span style="color: #0000ff;">"width:100%;height:100%;"</span>&gt;</span>
<span style="color: #000080;">&lt;head&gt;</span>
<span style="color: #000080;">&lt;title&gt;</span>525 Webclient<span style="color: #000080;">&lt;/title&gt;</span><span style="color: #000080;">&lt;/head&gt;</span>

<span style="color: #000080;">&lt;center&gt;</span>
<span style="color: #000080;">&lt;body BGCOLOR=<span style="color: #0000ff;">"#000000"</span>&gt;</span><span style="color: #000080;">&lt;applet name=RuneScape id=game width=765 height=503 archive='rs2_525.jar' code='client2.class' mayscript&gt;</span>
<span style="color: #000080;">&lt;param name=worldid value=60&gt;</span>
<span style="color: #000080;">&lt;param name=members value=1&gt;</span>
<span style="color: #000080;">&lt;param name=modewhat value=0&gt;</span>
<span style="color: #000080;">&lt;param name=modewhere value=0&gt;</span>
<span style="color: #000080;">&lt;param name=safemode value=0&gt;</span>
<span style="color: #000080;">&lt;param name=lang value=0&gt;</span>
<span style="color: #000080;">&lt;param name=affid value=0&gt;</span>
<span style="color: #000080;">&lt;param name=settings value=stringpassedtoserverwhenconnecting&gt;</span>
<span style="color: #000080;">&lt;param name=cookieprefix value=&gt;</span>
<span style="color: #000080;">&lt;param name=cookiehost value=.google.com&gt;</span>
<span style="color: #000080;">&lt;param name=plug value=0&gt;</span>
<span style="color: #000080;">&lt;param name=js value=1&gt;</span>
<span style="color: #000080;">&lt;param name=game value=0&gt;</span>
<span style="color: #000080;">&lt;/applet&gt;</span>
<span style="color: #000080;">&lt;/body&gt;</span></pre>
</div>
<p><img id="ncode_imageresizer_container_1" src="http://i43.tinypic.com/280ikh0.png" border="0" alt="" width="751" height="469" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.runescapeps.com/5/how-to-make-a-runescape-webclient-for-version-525/feed/</wfw:commentRss>
		<slash:comments>2330</slash:comments>
		</item>
		<item>
		<title>How to make a server ? (RuneScape private server tutorial)</title>
		<link>http://www.runescapeps.com/1/how-to-make-a-server/</link>
		<comments>http://www.runescapeps.com/1/how-to-make-a-server/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 08:16:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Runescape Private Server]]></category>
		<category><![CDATA[private server]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.runescapeps.com/?p=1</guid>
		<description><![CDATA[This is the most known RuneScape private server tutorial/guide ever created according to many statistics made by major search engines like Google, Yahoo and such. In this tutorial you will learn how to make a simple RuneScape private server yourself. » Chapter 1 Downloading JDK First we will need to download Java Sun&#8217;s JDK. You [...]]]></description>
			<content:encoded><![CDATA[<p>This is the most known RuneScape private server tutorial/guide ever created according to many statistics made by major search engines like Google, Yahoo and such.<br />
In this tutorial you will learn how to make a simple RuneScape private server yourself.</p>
<h3>» Chapter 1</h3>
<h4>Downloading JDK</h4>
<div id="tut1">
<p>First we will need to download Java Sun&#8217;s JDK.<br />
You can download it at <a href="http://java.sun.com/javase/downloads/index.jsp" target="_blank">this</a> page.<br />
Click on the most recent JDK version (At the time this has been written: JDK 6 Update 7).<br />
On this page you will have to select your platform, in this guide we will be using Windows as default platform.<br />
Select &#8216;Multi-Language&#8217; and check the &#8216;I agree&#8217; box.<br />
Check the box &#8216;I agree&#8217; and click on one of the 2 downloads you can choose and install it.</p>
<p>We prefer the <em>Offline Installation</em>.</p>
<p>This chapter has been finished. Click <a href="javascript:animatedcollapse.toggle('tut1');"><strong>here</strong></a> to hide this chapter if you want to, you can simply reactivate this chapter by clicking on it again.</p>
<h3>» Chapter 2</h3>
<h4>Downloading &amp; Installing <em>No-IP</em></h4>
<div id="tut2">
<p>If you do not have your own domain name for your server, you might want to make it easier for people to find your server instead of telling them your whole IP address with all the numbers.<br />
You can do this by using No-IP, No-IP allows you to register a sort of sub-domain redirecting to your IP.</p>
<p>You will be able connect to your server through that No-IP address, there are many extensions available such as the default <em>YourServer.no-ip.org</em>, more information about that later in this chapter.</p>
<p>First of all, go to the official No-IP site by clicking <a href="http://www.no-ip.com/newUser.php">here</a> and start filling in the details it is asking for.<br />
Make sure you are filling in the right details.<br />
They will not use this to contact you, but if you&#8217;re hosting something illegal while you do not know it, it is better for the police to have these details about you, instead of having them to get you into big troubles.</p>
<p>Once you have completed your registration please go to the <a href="http://www.no-ip.com/downloads.php">Download page</a>.<br />
Select your operating system, in this tutorial we will be using Windows as default, and has therefore been selected in the picture below.</p>
<p><img src="http://www.runescapeps.com/images/selectos.PNG" alt="" /></p>
<p>After that you will have to click on &#8220;Download&#8221;, which will lead you to the download.com website where the download will start automatically.</p>
<p>After the download is completed, install the program and start it up.<br />
If you did everything right, you will now have this screen:</p>
<p><img src="http://www.runescapeps.com/images/no-ipmainadd.PNG" alt="" /></p>
<p>On this menu everything will happen.<br />
Click on &#8220;Add&#8221; on the bottom of the menu, as highlighted in the picture.<br />
This will open your browser and bring you to the No-IP website.<br />
On the navigation click &#8220;Add host&#8221; and if right, you will receive this form:</p>
<p><img src="http://www.runescapeps.com/images/no-ipaddhost.PNG" alt="" /></p>
<p>In the hostname field fill in your server name, and select the domain you&#8217;d like to have as I said above.<br />
Default is no-ip.org/biz/com.<br />
Host Type should be DNS Host (A) and the IP address is already filled in.<br />
Scroll down and click Create Host.</p>
<p>If done, g</p>
<p>o back to the main menu of No-IP and click the &#8220;Refresh&#8221; on the bottom, and your No-IP is configured completely!</p>
<p>This chapter has been finished. Click <a href="javascript:animatedcollapse.toggle('tut2');"><strong>here</strong></a> to hide this chapter if you want to, you can simply reactivate this chapter by clicking on it again.</p>
<h3>» Chapter 3</h3>
<h4>Opening 43594 Usage</h4>
<div id="tut3">
<p>This will be easy, so we&#8217;ll be going through this a bit fast to skip some unnecessary time.<br />
Open Network &amp; Internet Connections on your computer.<br />
Right click on the connection you&#8217;re using to connect to the internet and click properties.<br />
Now open the Advanced tab and click on firewall settings.<br />
Open the Exceptions tab and at the bottom you should see a button &#8220;Add Port&#8221;.<br />
Click on it, and add your server name or whatever you want it to be at the Name field.</p>
<p>At the Port number fill in: 43594<br />
43594 is the default port of RuneScape (Private) Servers.<br />
And make sure the TCP box has been checked.</p>
<p><img src="http://www.runescapeps.com/images/firewallportadd.PNG" alt="" /></p>
<p>This chapter has been finished. Click <a href="javascript:animatedcollapse.toggle('tut3');"><strong>here</strong></a> to hide this chapter if you want to, you can simply reactivate this chapter by clicking on it again.</p>
<h3>» Chapter 4</h3>
<h4>Port forwarding <em>(Based on Linksys)</em></h4>
<div id="tut4">This chapter can be skipped if you do not have a router.<br />
Otherwise, we wish you good luck on this because this will probably be one of the most difficult chapters in the tutorial.</div>
<p>There are many kind of routers, although the Linksys router is the most used router, and therefore we will base this tutorial on a Linksys router.<br />
If you do not have a Linksys router but use another, we advise you to visit the <a href="http://www.portforward.com/english/routers/port_forwarding/routerindex.htm">Port Forward</a> site where you can find your router, and follow their tutorial basing it on port 43594</p>
<p>.</p>
<p>Ok, open your browser and connect to <a href="http://192.168.1.1/">http://192.168.1.1</a>.<br />
If you did everything right, you will now get this login screen:</p>
<p><img src="http://www.portforward.com/english/routers/port_forwarding/Linksys/WRT54GC/WRT54GC1.jpg" alt="" /><br />
Enter your username and password now. By default the username is blank, and the password is admin.</p>
<p>Click the Ok button to log in to your router.<br />
If you cannot login with that, we cannot longer help you port forward, either the person that setup your router did not use the default password and username, or configured something wrong.</p>
<p>Once logged in you will come on a webpage with some settings.<br />
Click on the &#8220;Applications and Gaming&#8221; tab and if right you will now see something like:</p>
<p><img src="http://www.portforward.com/english/routers/port_forwarding/Linksys/WRT54GC/WRT54GC3.jpg" alt="" /><br />
On an empty row start filling in this:</p>
<table>
<tbody>
<tr>
<th>Application Name:</th>
<td>RSPS</td>
</tr>
<tr>
<th>Start &#8211; End Port:</th>
<td>43594-43594</td>
</tr>
<tr>
<th>Protocol:</th>
<td>Both</td>
</tr>
<tr>
<th>To IP Address:</th>
<td>Local IP address (Read below).</td>
</tr>
<tr>
<th>Enabled:</th>
<td>Checked/Yes</td>
</tr>
</tbody>
</table>
<p><strong>How do I find my local IP address?</strong><br />
Go to <em>Start -&gt; Run</em> and type <em>cmd</em> and in the black box type &#8216;ipconfig&#8217;. You will see your local IP address there.</p>
<p>Save the settings and you are done.</p>
<p>This chapter has been finished. Click <a href="javascript:animatedcollapse.toggle('tut4');"><strong>here</strong></a> to hide this chapter if you want to, you can simply reactivate this chapter by clicking on it again.</p>
<h3>» Chapter 5</h3>
<h4>Downloading a server source</h4>
<div id="tut5">Alright, this is not really difficult<br />
Every server has been programmed, and we assume you do not want to spend months writing a complete server from scratch, therefore people release sources of their server.</div>
<p>This means they are giving you the files of their server and you can just use them for your server.<br />
You can download sources at our forums by clicking <a href="http://www.runelocus.com/forums/forumdisplay.php?f=17">here</a>.</p>
<p>This chapter has been finished. Click <a href="javascript:animatedcollapse.toggle('tut5');"><strong>here</strong></a>to hide this chapter if you want to, you can simply reactivate this chapter by clicking on it again.</p>
<h3>» Chapter 6</h3>
<h4>The error &#8216;The system could not find the path specified.&#8217; error.</h4>
<div id="tut6"><em>Open up &#8220;My Computer&#8221;.</em></div>
<p><img src="http://i184.photobucket.com/albums/x231/Rylee1010/server9.jpg" border="0" alt="" /></p>
<p><em>Click &#8220;View System information&#8221;</em></p>
<p><img src="http://i184.photobucket.com/albums/x231/Rylee1010/server10.jpg" border="0" alt="" /></p>
<p><em>Click &#8220;Advanced&#8221;.</em></p>
<p><img src="http://i184.photobucket.com/albums/x231/Rylee1010/server11.jpg" border="0" alt="" /></p>
<p><em>Click &#8220;Environment Variables&#8221;.</em></p>
<p><img src="http://i184.photobucket.com/albums/x231/Rylee1010/server12.jpg" border="0" alt="" /></p>
<p><em>Under &#8220;User Variables&#8221; click &#8220;New&#8221;.</em></p>
<p><img src="http://i184.photobucket.com/albums/x231/Rylee1010/server13.jpg" border="0" alt="" /></p>
<p><em>Name it &#8220;CLASSPATH&#8221; and for the &#8220;Variable Value&#8221; (<strong>only if you have JDK 6u1</strong>) put this in: <strong>CLASSPATH=C:\Program Files\Java\jdk1.6.0_01\bin;%CLASSPATH%;</strong> If you have JDK 6u2, you must enter <strong>CLASSPATH=C:\Program Files\Java\jdk1.6.0_02\bin;%CLASSPATH%;</strong> for the variable value.</em></p>
<p><img src="http://i184.photobucket.com/albums/x231/Rylee1010/server14.jpg" border="0" alt="" /></p>
<p><em>Under &#8220;User Variables&#8221; click &#8220;New&#8221;.</em></p>
<p><img src="http://i184.photobucket.com/albums/x231/Rylee1010/server13.jpg" border="0" alt="" /></p>
<p><em>Name it &#8220;PATH&#8221; and for the &#8220;Variable Value&#8221; (<strong>only if you have JDK 6u1</strong>) put this in: <strong>C:\Program Files\Java\jdk1.6.0_01\bin</strong> If you have JDK 6u2, you must enter <strong>C:\Program Files\Java\jdk1.6.0_02\bin</strong> for the variable value.</em></p>
<p><img src="http://i184.photobucket.com/albums/x231/Rylee1010/server15.jpg" border="0" alt="" /></p>
<p><em>Click &#8220;OK&#8221;.</em></p>
<p><img src="http://i184.photobucket.com/albums/x231/Rylee1010/server16.jpg" border="0" alt="" /></p>
<p><em>Click &#8220;OK&#8221;.</em></p>
<p><img src="http://i184.photobucket.com/albums/x231/Rylee1010/server17.jpg" border="0" alt="" /></p>
<p><em>Your computer now recognizes Java.</em></p>
<p>This chapter has been finished. Click <a href="javascript:animatedcollapse.toggle('tut6');"><strong>here</strong></a>to hide this chapter if you want to, you can simply reactivate this chapter by clicking on it again.</p>
<h3>» Chapter 7</h3>
<h4>Edit sources; Examples</h4>
<div id="tut7">
<p><span style="text-decoration: underline;">Making yourself an Administrator in-game</span><br />
<em>Testscape</em> &amp; Many other sources</p>
<p>Open your client.java and press Ctrl + F.<br />
You will now get an search box, fill in:</p>
<div>
<div>Code:</div>
<pre dir="ltr">//start of moderator/admin list, 1 = mod, 2 = staff, 3 = admin</pre>
</div>
<p>You willl see something like this</p>
<div>
<div>Code:</div>
<pre dir="ltr">if (playerName.equalsIgnoreCase("admin"))
                {
                    playerRights = 3;
                }</pre>
</div>
<p>If you look at it instead of just directly editing it and not learning something you know what this is.<br />
Its just like &#8216;If the name of the player is: admin give him playerrights 3 (Owner rights)&#8217;<br />
Player Rights 4 = Hidden Admin<br />
Player Rights 3 = Server Owner<br />
Player Rights 2 = Server Admin<br />
Player Rights 1 = Server Player Moderator</p>
<p>In Jorsa PK (Pimpscape) based servers you can just open the data folder and open admins/administrators/staff.txt and add a new player to it.</p>
<p><span style="text-decoration: underline;">Adding NPC&#8217;s</span><br />
To add NPC&#8217;s you work in autospawn.cfg, not client.java.</p>
<p>Open it and you will see many things looking like eachother.<br />
Now add this somewhere</p>
<div>
<div>Code:</div>
<pre dir="ltr">spawn = NpcID    CoordX    CoordY    0    0    0    0    0    2    NPC Name</pre>
</div>
<p>Change NpcID to the ID of the npc.<br />
Change CoordX and CoordY to the coords where you want the npc to be.<br />
If you don&#8217;t know how to get the coords press F4 (Moparscape client).</p>
<p>Also, no your not a ub3r good coder when you made a command or added a npc.</p>
<p><span style="text-decoration: underline;">Compiling</span><br />
After every update in the .java files you have to compile it.<br />
Compiling will make .class files off them and your server runs on them.<br />
For just an easy compiler make a new text file with notepad.<br />
Add this to it:</p>
<div>
<div>Code:</div>
<pre dir="ltr">@echo off
title Server Compiler
"C:\Program Files\Java\YOURJAVAVERSION\bin\javac.exe" -cp . *.java
pause</pre>
</div>
<p>Now open My Computer, head to C:/Program Files/Java and find the &#8216;jre&#8217; folder.<br />
Copy the folder name and replace &#8216;YOURJAVAVERSION&#8217; with the folder name.</p>
<p>Click Save As and save it as a batch file.<br />
To save it as a batch file you can either make it end with .bat or clicking &#8216;All files&#8217; at filetype, and adding &#8216;.bat&#8217; at the end.</p>
</div>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.runescapeps.com/1/how-to-make-a-server/feed/</wfw:commentRss>
		<slash:comments>3910</slash:comments>
		</item>
	</channel>
</rss>

