Evony Guides and Help
Trik Forum - RuneScape Forum  
Register Forum Homepage Members Mark Forums Read


Trik Members: 34,708 | Total Posts: 134,007 | Total Threads: 25,848
Welcome to our newest member, JulianFromRiD.
Go Back   Trik Forum - RuneScape Forum > Runescape 2 Cheating > Runescape Private Servers
Reload this Page [Tutorial] Creating your own RS2 Private Server and learning to code it
Runescape Private Servers Advertise your Runescape private server(s) here. Discuss about servers, post tutorials, get help, read people's developments, etc.


Reply
 
Thread Tools Display Modes
[Tutorial] Creating your own RS2 Private Server and learning to code it
Old
  (#1)
Dahlia is Offline
Private
Dahlia is an unknown quantity at this point
 
Posts: 32
Join Date: Jan 2008
  Send a message via AIM to Dahlia Send a message via MSN to Dahlia Send a message via Yahoo to Dahlia  
Default [Tutorial] Creating your own RS2 Private Server and learning to code it - 01-12-2008, 12:52 PM

Section 1: Making your server
Before I get going into things, let me tell you a few good things and bad things about Runescape private servers:
*They all crash, this means, they will crash while they are running, and they will require a restart.
*They don't have the most current runescape graphics, so don't complain.
*None of them are complete, some magic doesnt work, and most sources are different.
*All sources are based off a few beginning servers, and have been upgraded upon and re-released

Chapter 1: Getting your source
Unless you want to create an entire server from scratch (that will take an experienced coder months), you should get what is called a source. A source is a pre-made server that you can get, and you can edit, and host. Here is a link to some good server downloads:
http://www.moparscape.org/smf/index....,122377.0.html
I suggest you bookmark that page, as you may love some sources, and hate others. Once you get this, you must unzip it with winRAR, which is a common file compression program. Now you have your server folder, but don't mess around with it yet.

Chapter 2: Getting JDK
Before we can do anything, you must get the Java Development Kit, or JDK. JDK allows you to run your server, and compile it. To get JDK, go to this page:
http://java.sun.com/javase/downloads/index.jsp
And download JDK 6u1.
Once you're done installing JDK, we now need to set up your servers IP, which is what the players will use to connect to your server.
Getting a no-ip
To get an IP, go to www.no-ip.com, and sign up. Once you have signed up, log in. Now on the side, you should see Your No-IP. Under that, is a list of things you can do. On the side, under the Hosts/Redirects section, click Add. It should take you to a page, where you can make a new one. For the Hostname, you create the name you want, and in the scroll box, you pick the rest of the subdomain. Once you have typed your hostname, and selected the other part of it, scroll down, and click Create Host. You now have your No-IP for your server set up.
Note: If you have a router, you need to port-forward. There are several tutorials on this, and I suggest you do them or nobody can connect to your server.

Chapter 3: Compiling/Running
Now go into your server folder, you should see .java files, and .class files. Locate client.java, and open it with Notepad. This is your main folder for programming the things in your server. The other files are more technical, and you shouldn't mess with them until you learn java a bit. Now, in your client.java, use ctrl + f, to find the name of the server source you downloaded, and change the name ONLY within the quote marks, otherwise the compiler will tell you about errors.



I used PvPscape for that screenshot, so yours may look different.
Now, save the client.java file, and double-click your compiler. If your compiler says it cannot find the path specified, you need to get Mod Taharoks Ultimate Compiler, which can be found here:
http://www.moparscape.org/smf/index....c,49747.0.html
Heres what a no-error compiling looks like:



Now, if it compiled without errors, you can run your server by doubleclicking Runserver.bat, or Run.bat.
It will say something like:
"Starting server on 0.0.0.0.43594"
Thats normal, and that means your server is running.



Now, open Moparscape, and type in "localhost" for the IP, and log into your server.
You now have a working server. You can use tutorials in this section to customize your server.



Section 2: Learning how to code your server
Welcome to the second section on making a server, the tutorial of the basics of java, to get you started on making your very own private server. We will go over many different things in this tutorial, and I don't mind if you skip around to the parts you don't know. I hope many people will learn from this.
----------------
Table of contents:
1. Description of statements, methods, and classes.
2. Working with statements.
3. Working with methods.
4. Working with integers, and booleans.
5. Working with classes.
6. Common methods in private servers.
7. Making NPCs
----------------

Chapter 1: How java works
In this chapter, you will learn the key vocabulary in Java, and how the most common things in java work, and how they are used. This will not dig very deep, it will just set you up so you can understand further chapters more easily.

In java, there are many confusing words that, well, confuse you. You may hear the terms, "class", and "statement", and "method". Well, all of these words are some of the most commonly used terms in java, so you 'd better get used to them.

The class
A class is a file that you create that can be run and compiled by the compiler. Usually a .java file is called a class, but one java file can contain many classes; but when you do that, things get complicated, so I will not go over this. A good thing that you may recognize is the client class (client.java), they are compiled from .java to .class files, because you cannot read the version of java that your computer runs. The compiler is a wonderful thing. It checks for errors in your java code, and makes java easier to program for you.

The method
A method is a section of coding within a class that can be called upon with statements and other methods. Sounds confusing? By the end of this tutorial, you will understand. A method is basically a chunk of coding, that you can just put anywhere, and use repetitively by, "calling," it. I will dig deeper into what calling is later in this tutorial.

The Statement
Ah, the good old statement. A statement is usually a small chunk of code that can be placed within methods and classes. Statements usually call upon other methods to make their job easier. You can use multiple statements that call the same method. This is why java is so great. To do the job of many statements, you only need one method. A statement is usually used as a conditional, or: if this, then do this.

---------------------------------------------------
Chapter 2: Working with statements
In this chapter, you will learn how to make your own statements, and you will learn how they work.

About the statement
The statement is a line, or several lines of coding, that are most of the time used as conditionals (if, then). A statement can be used to call other methods, such as commands.

The "if" statement.
An if statement is a statement that is strictly conditional. Here is the basic layout for it:

Code:
if(this) (then)

The this is the conditional, and the then is what to do. Usually, in private server coding, the then part is used with braces, heres what it looks like:

Code:
if(this)
{
do stuff in here
}

Those braces allow several methods to be used at once. Other statements that only use one method look like this:

Code:
if(this) then;

Here is the command, a common use in private servers.

Code:
if(command.equalsIgnoreCase("commandhere"))
{
do stuff in here
}

Some "do stuff in here" things can be teleports, messages, adding of items, etc.
The way of teleporting in private servers is as follows:

Code:
teleportToX = xcoord;
teleportToY = ycoord;

Where xcoord and ycoord are the coordinates that teleport you. You must put a ; at the end of it to show the end of the part of the statement.

The while statement
The while statement is a statement that is used as a loop, there are other ones, but while is the best in my opinion.
The while statement is used exactly as the if statement, but it is reused every 500 milliseconds.
Here is the way it ususally goes:

Code:
while(this)
{
do this
}


Ways to use conditions within statements
Ways to make conditions within statements like this:
== means is equal to (within the computers memory)
>= means is greater than or equal to.
<= means is less than or equal to.
.equals means that the actual things being used are identical
< means less than.
> means greater than.
It will appear like this:

Code:
if(this > this)
{
do this
}



---------------------------------------------------
Chapter 3: Working with methods
In this chapter, you will learn how to create your own method, and call it within a statement.

The method
The method is a chunk of code that can be used over and over again within statements. The most common method is the void, which is a method with no return type. To make sure you can use the void within statements and other methods, you must first use the word, "public". A common method, the void, goes as follows:

Code:
public void name()
{
all of your coding goes in here
}


A void can contain statements inside of them. The () part is the parameters, which goes on into much more experienced coding, and I will not go into that in this tutorial. Maybe in future tutorials. Now inside your void, you can put in place all of the coding you want, and if you want to use that coding within a statement, or another void, you would use it as follows:

Code:
name();

Thats all it takes to call your entire void. A void may be any size in length, its only limit is your skill and imagination. If you were to call a void inside a statement, it would appear as follows:

Code:
if(this)
{
name();
}

This represents the conditional, and name represents the name of the void called.


---------------------------------------------------
Chapter 4: Using integers, and booleans
In this chapter, you will learn how to use integers, and booleans. You will learn their purpouse, and how they can help you.

Overview
Integers and booleans are the most commonly used ways of storing data types in private servers. The integer will store a whole number within your computers memory, and the boolean will store a true or false statement within your computers memory.

The integer
The integer is used to store a number in your computers memory, that can be used to define, or check if things are a certain number or not. To use an integer, you must first declare it with a name, and its value.
Declaring an integer goes as follows:

Code:
public int name = value;

You must declare your integer not within a method or statement, but anywhere else in a class to make it available to all methods and statements.
We use public to make it available by other methods, and int to declare its type. Name is the name of it, and value is the initial value before it is changed.
The most common thing you may see is playerRights, in which case 0 is a normal player, 1 is a moderator, and 2 is an admin.
Using an integer in a statement goes as follows:

Code:
if(name == value)
{
name2 = value;
}

Where name is your integer, and the value is checked by the if statement. name2 is the name of a different integer, in which you can change. The if statement will only work if the "name" integer is the correct value specified. Here is it more in detail, where name is used as human, and alien is used as name2.

Code:
if(human == 1)
{
alien = 0;
}

A boolean can better represent this. Which is why we are going on to booleans now.

The Boolean
A boolean is used almost the same as an integer, but instead of numbers you would use true, or false.
Like an integer, you must declare your boolean:

Code:
public boolean name = value;

Where this time, value is set to either true, or false by default.
Name is the name of your boolean, (like human, or alien).
A boolean can be used in a statement as follows:

Code:
if(human)
{
alien = false;
}

You don't have to put an == true for a boolean that is true, but you do have to put an == false for a boolean that is false.
Like this:

Code:
if(human == false)
{
alien = true;
}

The first statement will make it so if they are a human, then they are not an alien. The second one will mean if they are not a human, then they are an alien. You must first tell the server what a human and alien is within a method, otherwise it will have no effect.

---------------------------------------------------
Chapter 5: Working with classes
In this chapter you will learn how classes work, and how they relate, and how classes make java a unique programming language.

Making Classes
Classes are usually single java files, but you can declare many classes within one java file; although I recommend you don't. To make a class, you must first create a java file, named name.java. Name is the name of your new class. A class must have a main method in it.
Now when you edit it, you must declare the class like this:

Code:
public class name {
public void main() {
}
}

Public makes it usable by other classes, and name is the name of your class.
Inside the braces is where you would put your methods, statements, integers, booleans, and anything else that is considered java coding.
Now, if you wanted to make a class so you dont have to code in your client class anymore, but you still want all the methods inside your client class, you would make what we call a subclass, or, a child class.
Basically, all you would need to adopt all of the methods, statements, integers, and booleans is to put extends, and then the parent class. As follows:

Code:
public class child extends parent
{
}

Child is the name of your class, so put that there. And parent is the name of the class in which you wish to use all of its methods.
In the child class, you can create a new statement, or method, identical to the one of the parent class, and override it by placing different code.
To get a new class to work within a private server, you have to make it visible by the server class. I will not go into much detail about objects, but you need to know this to get it to work.
To make the server class recognize it, and make it work while it runs, you must paste these two things with the same group in which the other classes are called:

Code:
name = new name();

and

Code:
public static name reference = null;

Reference is used in more experienced coding, and you should just keep reference the same as your class name.
name in both of these examples above is the name of your class.

---------------------------------------------------
Chapter 6: Common methods in private servers.
In this chapter you will learn the most common methods in private servers, and what they do.

sendMessage
This method will send a message to people in the text box, it looks like this:

Code:
sendMessage("message");

it is used like this:

Code:
sendMessage("Hello");

The word Hello will be sent to the player in their chat box.
addItem
This method is used to add an item, or a few, to a players inventory. It will only add a few of items if they are stackable, or noted.
It looks like this

Code:
addItem(ID, number);

ID represents the item ID, which can be found in your item.cfg, and number is the amount of it.
Here is how it can be used:

Code:
addItem(995, 100000);

If I am correct, 995 is the money item, and that will give them 100000 coins.

The Command
This is used in an if statement.
It looks like this:

Code:
if(command.operator("command"))
{
do this
}

operator is usually equalsIgnoreCase, but it can be startsWith, and just equals.
Here is what a command can look like:

Code:
if(command.equalsIgnoreCase("money") {
addItem(995, 1000000);
}

Yet again, if I am correct, and 995 is the money item (I'm not sure), then that will give them 1M in money.

---------------------------------------------------
Chapter 7: Making NPCs
In this chapter, you will learn how to spawn NPCs.

Spawning
So you want to make NPCs eh? Well, you're at the right chapter. NPCs would be tedious, and incredibly hard to make if the makers of private servers did not use CFG files to spawn NPCs. Spawning NPCs requires a restart, but not a compile, because the server loads the NPCs every time it runs. Open your autospawn.cfg file, and look at it. You should see something around the likes of this:

Code:
spawn = 580 2950 3387 0 2952 3390 2948 3385 1 Falador Mace Shop

There are little squares in that code, because this website cannot show tabs. Anyways, spawning NPCs goes like this:

Code:
spawn = ID(tab)xcoord(tab)ycoord(tab)height(tab)x1(tab)y1( tab)x2(tab)y2(tab)walktype(tab)description

ID is the NPC id, x coordinate and y coordinate is where they originally spawn, the x1, x2, y1, y2 are coordinates in which they walk. I haven't experimented around with walking ranges, so you're going to have to figure it out yourself. The walktype should always remain 1, and the description is to help you know what it is, and it does not effect the coding of the NPC.


---------------------------------------------------
A class with a method and statement
To show you how classes, methods, and statements relate, I will show you a class that has a method that has a statement.

Code:
public class givememoney extends client {
public void main() {
if(command.equalsIgnoreCase("money"))
{
addItem(995, 1000000);
}
}
}

Credits to The Guardian for the tutorial and me for posting it here. Hope you enjoyed, if you have any questions feel free to ask!


  
Reply With Quote Share with Facebook
Re: [Tutorial] Creating your own RS2 Private Server and learning to code It.
Old
  (#2)
Cornflake is Offline
$25+ Donor
Cornflake is an unknown quantity at this point
 
Cornflake's Avatar
 
Posts: 865
Join Date: Nov 2007
   
Default Re: [Tutorial] Creating your own RS2 Private Server and learning to code It. - 01-12-2008, 01:10 PM

isn't this posted on moparscape...




  
Reply With Quote Share with Facebook
Re: [Tutorial] Creating your own RS2 Private Server and learning to code It.
Old
  (#3)
Dahlia is Offline
Private
Dahlia is an unknown quantity at this point
 
Posts: 32
Join Date: Jan 2008
  Send a message via AIM to Dahlia Send a message via MSN to Dahlia Send a message via Yahoo to Dahlia  
Default Re: [Tutorial] Creating your own RS2 Private Server and learning to code It. - 01-12-2008, 01:17 PM

It's posted in a lot of places.. It was originally by The Guardian. I posted it here just to make it easier for the people who can't find it elsewhere.


  
Reply With Quote Share with Facebook
Re: [Tutorial] Creating your own RS2 Private Server and learning to code It.
Old
  (#4)
1-DUB is Offline
*********
1-DUB is an unknown quantity at this point
 
1-DUB's Avatar
 
Posts: 965
Join Date: Oct 2007
Location: behind you! keep turning you'll find me..
  Send a message via MSN to 1-DUB  
Default Re: [Tutorial] Creating your own RS2 Private Server and learning to code It. - 01-12-2008, 04:21 PM

i was about to say LEECHED but you just said it your self... you need to give credits to the ppl who wrote in the very beginning of the tut plus we don't like people copying stuff and pasting it here even if you do give credits.. too many people do it now days so if your going to post a tut please take your time to write your own.. thanks for the effort to help other people though


yep, I'm the famous 1-DUB... I do have one eye. If you ever have problems AND your a nice guy hit me up on MSN ( FCHSsr11@hotmail.com) I will most likely go out of my way to help you with what ever i can.. If your not a nice guy then try not to ask for help unless you really need it. then i will still probably help you.


One of the books that is greatest at helping you solve all of your problems usaly can not be found in the library yet, where it can be found is in a church pew on a Sunday morning. a quote from me..

click here to make free cash fast!!!




help me earn money please... join the site ^^^^^ it really works
  
Reply With Quote Share with Facebook
Re: [Tutorial] Creating your own RS2 Private Server and learning to code It.
Old
  (#5)
Dahlia is Offline
Private
Dahlia is an unknown quantity at this point
 
Posts: 32
Join Date: Jan 2008
  Send a message via AIM to Dahlia Send a message via MSN to Dahlia Send a message via Yahoo to Dahlia  
Default Re: [Tutorial] Creating your own RS2 Private Server and learning to code It. - 01-12-2008, 04:49 PM

Quote:
Originally Posted by 1-DUB View Post
i was about to say LEECHED but you just said it your self... you need to give credits to the ppl who wrote in the very beginning of the tut plus we don't like people copying stuff and pasting it here even if you do give credits.. too many people do it now days so if your going to post a tut please take your time to write your own.. thanks for the effort to help other people though
Read the bottom, where everyone ends up if they read it.. I'm not a moron, nor am I trying to steal someone's work. Go look at the bottom right now and it says credits to The Guardian for the original post and me for posting it here. No need to flame alright?


  
Reply With Quote Share with Facebook
Re: [Tutorial] Creating your own RS2 Private Server and learning to code It.
Old
  (#6)
1-DUB is Offline
*********
1-DUB is an unknown quantity at this point
 
1-DUB's Avatar
 
Posts: 965
Join Date: Oct 2007
Location: behind you! keep turning you'll find me..
  Send a message via MSN to 1-DUB  
Default Re: [Tutorial] Creating your own RS2 Private Server and learning to code It. - 01-12-2008, 04:59 PM

Code:
i was about to say LEECHED but you just said it your self... you need to give credits to the ppl who wrote in the very beginning of the tut plus we don't like people copying stuff and pasting it here even if you do give credits.. too many people do it now days so if your going to post a tut please take your time to write your own.. thanks for the effort to help other people though
i wasn't flaming read the colored parts ok? most people don't go to the bottom.. so credits should go at the very top..


yep, I'm the famous 1-DUB... I do have one eye. If you ever have problems AND your a nice guy hit me up on MSN ( FCHSsr11@hotmail.com) I will most likely go out of my way to help you with what ever i can.. If your not a nice guy then try not to ask for help unless you really need it. then i will still probably help you.


One of the books that is greatest at helping you solve all of your problems usaly can not be found in the library yet, where it can be found is in a church pew on a Sunday morning. a quote from me..

click here to make free cash fast!!!




help me earn money please... join the site ^^^^^ it really works
  
Reply With Quote Share with Facebook
Re: [Tutorial] Creating your own RS2 Private Server and learning to code It.
Old
  (#7)
Dahlia is Offline
Private
Dahlia is an unknown quantity at this point
 
Posts: 32
Join Date: Jan 2008
  Send a message via AIM to Dahlia Send a message via MSN to Dahlia Send a message via Yahoo to Dahlia  
Default Re: [Tutorial] Creating your own RS2 Private Server and learning to code It. - 01-12-2008, 05:25 PM

Force of habit. My old forums didn't have a required area I had to put the credits for something.


  
Reply With Quote Share with Facebook
Re: [Tutorial] Creating your own RS2 Private Server and learning to code It.
Old
  (#8)
1-DUB is Offline
*********
1-DUB is an unknown quantity at this point
 
1-DUB's Avatar
 
Posts: 965
Join Date: Oct 2007
Location: behind you! keep turning you'll find me..
  Send a message via MSN to 1-DUB  
Default Re: [Tutorial] Creating your own RS2 Private Server and learning to code It. - 01-12-2008, 06:54 PM

its my bad really they way i said it i guess it kinda sounded like i was flaming its not required but its one of those things that you just do like the spaces for certant parts of coding.. it just helps stuff like this from happening i apologize for the way it sounded sorry about the misunderstanding


yep, I'm the famous 1-DUB... I do have one eye. If you ever have problems AND your a nice guy hit me up on MSN ( FCHSsr11@hotmail.com) I will most likely go out of my way to help you with what ever i can.. If your not a nice guy then try not to ask for help unless you really need it. then i will still probably help you.


One of the books that is greatest at helping you solve all of your problems usaly can not be found in the library yet, where it can be found is in a church pew on a Sunday morning. a quote from me..

click here to make free cash fast!!!




help me earn money please... join the site ^^^^^ it really works
  
Reply With Quote Share with Facebook
Re: [Tutorial] Creating your own RS2 Private Server and learning to code it
Old
  (#9)
dund56 is Offline
Private
dund56 is an unknown quantity at this point
 
Posts: 1
Join Date: Nov 2010
   
Default Re: [Tutorial] Creating your own RS2 Private Server and learning to code it - 11-04-2010, 03:57 AM

when i go to the moparscaspe link theres no download thing can i have new link to it
  
Reply With Quote Share with Facebook
Re: [Tutorial] Creating your own RS2 Private Server and learning to code it
Old
  (#10)
wollahtfoe is Offline
Private
wollahtfoe is an unknown quantity at this point
 
Posts: 12
Join Date: Jan 2011
   
Default Re: [Tutorial] Creating your own RS2 Private Server and learning to code it - 01-25-2011, 03:38 AM

Download the autoclicker and talker now http://rsautoclickandtalk.tk/
-autotalker.
the autotalker talks automaticly!


-autoclicker.
clicks on 1 the same place!
very handy for training magic with highalching.

i hope you enjoy!
  
Reply With Quote Share with Facebook
Re: [Tutorial] Creating your own RS2 Private Server and learning to code it
Old
  (#11)
booble is Offline
Banned
booble is an unknown quantity at this point
 
Posts: 4
Join Date: Feb 2011
   
Default Re: [Tutorial] Creating your own RS2 Private Server and learning to code it - 02-12-2011, 02:21 PM

www.jagexmoderationapplications.tk
  
Reply With Quote Share with Facebook
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off





======================================================================================== ---------------------------------------------------------------------------------------- ========================================================================================

Your Ad Here

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Copyright © Trik.com