Thread: [MEGAGUIDE] How To Improve Your Java Quickly and Make a SUCCESSFUL Server [MEGAGUIDE]

Page 1 of 6 123 ... LastLast
Results 1 to 10 of 57
  1. #1 [MEGAGUIDE] How To Improve Your Java Quickly and Make a SUCCESSFUL Server [MEGAGUIDE] 
    Registered Member Incipio's Avatar
    Join Date
    Jul 2011
    Posts
    183
    Thanks given
    20
    Thanks received
    34
    Rep Power
    3
    Note: This is useful for NEW people. If you are a good Java coder, you'll find this most likely useless, and possibly even badly written. Also, guide will not be finished for quite a while, I've been really busy.


    Hi everyone, I'm Incipio of RuneServer. If you're reading this, then you are interested in RuneScape Private Servers. You may have already tried starting a few, only

    to have your advertisements owned by comments such as "noob leecher, gtfo", "another boring server", or "wow, u fail". Or maybe you've just started coding, and you

    want to see how to improve your skills.

    I'm not going to lie to you. You'll need a good amount of patience to excel at Java (and read this ). A lack of patience is the reason almost all servers released

    nowadays NEVER succeed. The "owners" are just too lazy to learn a little Java and code something INTERESTING.

    This tutorial is divided into Stages. Some things will take longer, some will be shorter. I will mark the approximate length of the Stage next to the name.

    If you don't want to read all this, the important parts are this color.

    STAGE 1 - BASICS - 1~7 days

    Before you start, you need to know the basics of Java. If you have some sort of experience with ANY other programming language, whether it's the built-in language

    on a TI-84 (that's all the experience I had), or with C++, Python, C#, even BASIC, then this will be much easier for you. Even if you don't have the experience, the

    basics are really easy to understand.

    First, you will have to be familiar with basic statements. These are easy to learn - it's almost in plain English.

    Code:
    if (CONDITION) {
          //do something here
    } else if (CONDITION) {
         //do something else
    }
    This is a basic if-else statement. It's simple, and should be obvious to you. If the condition is true, then something will happen. Otherwise (or else), something else

    will be done.

    There's a lot of other statements, but this is the big important one. You MUST be able to instantly identify this.

    An important thing here is syntax. This is all those little parentheses and brackets. You should train yourself to remember all these tiny

    things from the very beginning. Every day, a lot of people post errors in the Help section that are caused by a missing bracket or semicolon.

    Now, towards the end of stage 1, you should start to know your data types.

    For RSPS coding, you will most likely only ever encounter the following:
    • int (Very common. Basically, allows for a number to go up to about 2.147 billion. It can also go to the negative of that amount.)
    • long (Only used for the system time as far as I know. It stores a bigger value than int. It can also go to the negative of that amount.)
    • double (Used for decimals.)
    • boolean (Stores a true/false value. 0 is false, 1 is true. Used for a variety of purposes.)
    • string (Stores a string of characters, like "Incipio of Rune-Server wrote this!")
    • char (I've seen it used once, I've never needed it.)


    Read this: [Only registered and activated users can see links. ]
    It explains how to declare variables. It's for C++ but the method is the same.


    What you should know after Stage 1...

    • Basic statements such as if-else
    • Data types
    • How to declare your own data types


    STAGE 2 - ABSORBING - 3 ~ 14 days

    This is probably the longest stage. In this stage, you will learn a lot about how private servers are coded. First, download a highly customized source. PI is the most

    common, so use it. By customized, I don't mean something with 102412084712048 custom items. I mean that a lot of new things have been added to the server.

    Something like this: [Only registered and activated users can see links. ]
    Plenty of minigames, Player Owned Shops, PK Points, Spirit Shield Making, etc. Great for learning.

    Now, you should have your source downloaded. Instead of hosting it instantly and being called a leecher, learn from it!

    Read the following COMPLETELY. You can skip parts that are repetitive, but you should read through the code. And don't just LOOK at it. You need

    to UNDERSTAND.


    A lot of this is in src>server>model.

    Starting from easy to understand to difficult to understand...

    MAKE SURE YOU LOOK CAREFULLY AT SYNTAX!!

    1. Config.java (Mostly self-explanatory, should be simple. But now you know for the future what things you have in there)
    2. Commands.java (Just by the command names, you should be able to figure out a lot of new things. Adding and deleting items, sending messages, rolling random

      numbers, etc. Lot of new stuff to be learned here)
    3. PlayerAssistant.java (Getting harder. If your source is highly customized, then you should find all kinds of interesting things in here.)
    4. CombatAssistant.java (This is where most of the math comes in. About the same difficulty as PlayerAssistant.)
    5. Client.java (LOOOOONNNGGGG read. Definitely worth it. This is where a lot of the first things you add will go to, so you should know everything inside it.)


    After you've read all that (should take quite a while), you should have learned a lot about Java, especially for RSPS.

    If there's something on the below list you haven't seen, search for it.


    What you should know after Stage 2...

    • Adding/deleting items
    • Better grasp of syntax for various things
    • Switch + Cases
    • Some knowledge of dialogues
    • Using random numbers
    • c.sendMessage()
    • How to use animations + GFX (don't need to know ID's)
    • Basic interface stuff
    • Sending global messages (like ::yell, but with a default message)



    STAGE 3 - LET THE FUN BEGIN - 1 ~ 5 days


    Finally, you can do some coding!

    We'll start with some simple commands. Commands are by far the easiest things to add, since generally, there will be a command similar to what you are adding. In

    this case, you can just copy it and adjust it a little to match your needs.

    First, you should know commands go AFTER this part:
    Code:
     public void playerCommands(Client c, String playerCommand)
    It's probably safest to put a command between other commands so you know they're in the right place. But, be careful not to accidentally put the command in the

    middle of another command!
    So, put your new command BEFORE one of these:
    Code:
    if (playerCommand.
    You should know by now the basic layout of a command.

    Code:
    if (playerCommand.equalsIgnoreCase("thecommandname")) {
    				//some action here
    			}


    We'll start with commands that don't take any input (unlike ::item or ::ban). Because of this, we will use equalsIgnoreCase. This means

    the command that the player types has to EXACTLY equal what's between the quotes.

    For commands with input, startsWith will be used instead.

    FIRST COMMAND - MAKEMERICH - Level: Easy Peasy

    This command will give you 2.147b (max gold)

    Please, try figuring it out yourself before looking at the hints! Remember, find another command that does something similar (in this case, ::item also adds an item)

    and then take the part and put it into your new command!

    If you really can't do it, then look at the second spoiler for the code. Figure out what you didn't know, and remember it.

    Hints
    Spoiler for Hints:

    --- Use c.getItems().addItem(ITEM ID HERE, AMOUNT TO ADD HERE);
    --- The ID of gold is 995
    --- 2.147b is 2147000000


    Spoiler for Answer:


    if (playerCommand.equalsIgnoreCase("makemerich") {
    c.getItems().addItem(995, 2147000000);
    }





    SECOND COMMAND - RANDOM - Level: Easy

    This command will display a random number.

    Please, try figuring it out yourself before looking at the hints! Remember, find another command that does something similar (in this case, ::yell also displays

    something) and then take the part and put it into your new command!

    If you really can't do it, then look at the second spoiler for the code. Figure out what you didn't know, and remember it.

    Hints
    Spoiler for Hints:

    --- Use Misc.random(AMOUNT)
    --- Use c.sendMessage();


    Spoiler for Answer:


    if (playerCommand.equalsIgnoreCase("random") {
    int random = Misc.random(1337);
    c.sendMessage(random);
    }




    THIRD COMMAND - ONEANDTWO - Level: Average

    This command will show the first and second numbers inputted after the command :neandtwo

    Please, try figuring it out yourself before looking at the hints! Remember, find another command that does something similar (in this case, ::item also splits

    arguments of a command) and then take the part and put it into your new command!

    If you really can't do it, then look at the second spoiler for the code. Figure out what you didn't know, and remember it.

    Hints
    Spoiler for Hints:

    --- Use String[] args = playerCommand.split(" "); to set up an Array called args. It will split the command between each space (" "). If you don't know what an array is,

    go here: [Only registered and activated users can see links. ]. It's C++, but the concept is the same. It stores multiple values
    --- Integer.parseInt(args[1]); is a value of the args array
    --- Declare two ints
    --- Set the ints equal to the args[1] and args[2] (args[0] is the command)
    --- Use c.sendMessage to display the numbers


    Spoiler for Answer:


    if (playerCommand.equalsIgnoreCase("oneandtwo") {
    String[] args = playerCommand.split(" ");
    int one = Integer.parseInt(args[1]);
    int two = Integer.parseInt(args[2]);
    c.sendMessage("First: " + one + " Second: " + two);
    }

    c.sendMessage can send multiple things at once using the + sign.



    For the remainder of this stage, just create other random little commands. They don't have to be hard, you just need the practice.
    If you are able to create something like ::item or ::ipban, then your work here is done.


    What you should know after Stage 3...

    • Creating Commands
    • Basic methods used in commands (methods are things like sendMessage, addItem, and parseInt)
    • Difference between commands with and without input
    • Have a lot more experience doing basic coding


    STAGE 4 - SOURCE - 1 ~ 3 days

    Congratulations! If you've made it this far, you've got what it takes to take your private server to the top!

    You'll need a few things though:

    • A GOOD source
    • A name for your server
    • A name for yourself on the server


    We'll go over these one by one.

    First off, your own name. It needs to be UNIQUE. Something that has never been used before, something that you can confidently use for registering on ANY forum.

    For example, Gir, Incipio (derp.), Pilldom, Hydrolyza. These are just a few of the good names that I picked off of this forum.

    Now the bad names. donivan12, rexz0rd, blakeman8192. You should not choose something like this!

    All 7 of the above names are names of random members on Rune-Server. But think. Pilldom is a name EASILY REMEMBERED, unlike blakeman8192. How can you

    expect someone to remember the 8192? Also, the lack of capitalization makes it even worse. Blakeman is better than blakeman.

    Spoiler for If blakeman8192 reads this:

    Sorry about raging on your name No harm intended, just trying to prove a point.


    A name like rexz0rd is decent, but the spelling is hard to remember.

    A name like Epic or Pro is also bad. These names are too common. If your server goes down, people will never recognize you since there's almost no chance you'll

    get the name on another server.

    In short, your name needs to have no numbers, good capitalization, and be unique.


    Now for picking a name for your server.

    Good names: Recoil Rift, HavocWorld, SilabGarza, Near Reality, SoulSplit.
    You may not have noticed, but almost all top servers don't include "scape" in their name.

    Bad names: Gergscape, D4rthscape, SEXY PK X ILE.

    Your server name should be unique but easy to remember.



    Finally, source picking. Your source must be decent. PI is good for a FIRST server. Hyperion is also good, but PI has so many tutorials that you'll learn how to code

    well much faster.

    Important note about PI from LT Smith:
    Quote Originally Posted by LT Smith View Post
    I would not recommend Project-Insanity because it is flamming terrible. Why the hell would you want to use a server with poorly programmed content and loads of

    annoying bugs?
    Besides people who are new to runescape private-servers will learn nothing from just changing a name and pressing run. Eh?
    You should recommend a blank server because the reader will learn loads more about java only if he follows your advice and uses the recommended server.
    The person who takes up your advice will learn more only because blank servers have no content, therefore you will have to program it!

    Hyperion, Runesource and Shard-Revolutions are three decent blank servers!
    Hyperion, Runesource, and Shard-Revolutions ARE good. However, there are only a couple tutorials for these bases. If you are good at figuring things out, start with

    them. You'll quickly learn to convert PI into your base, which will greatly improve your skills. However, I would still recommend starting with PI. When you're ready for

    harder things, then make the switch and you'll be able to catch on to the small changes quickly.
    [COLOR="Lime]
    Some other important info about using PI:[/COLOR]
    Quote Originally Posted by Me View Post
    A LOT of good Java coders will warn against you using PI. They are absolutely right. PI has a large amount of bugs, which will take you a long time to fix, wasting

    time that could be spent adding content that players can actually see in-game.
    Here's where intelligence comes in.
    If other people generally call you anywhere from smart to genius, then go with some other source such as Hyperion. Don't use Delta. It will also get you a lot of

    trolling/flaming when you advertise. Hyperion, Shard, and Emulous(spelling?) are two sources that are rarely flamed. However, it is pretty hard to find a source using

    one of these bases, and even harder to find one that will teach you enough at your current level. If you have strong problem-solving + logic skills, go with one of these

    right from the start. Like many people say, PI WILL give you bad habits. However, most leechers start with PI because they can spam-add things from Tutorials and

    Snippets to their server and call it (unique). If you intend to eventually add a lot of custom/unique content or consider your self creative, then choose something other

    than PI.
    I will warn you though. I'm a smart guy, but I still went with PI. It's just so widely used that I decided it was worth the parts that fail. Using another source will

    challenge you.
    On the other hand, if you've ever been called dumb, have a GPA less than 4.25 (before you ask, that's not my GPA ), or aren't in any honors/AP classes at school, I

    would go with PI.

    Please don't lie to yourself. If you know that there's many people smarter than you, don't go with Hyperion or something.

    The source should not have too many customs (people don't like that). Also, the source should have most memory leaks fixed (or you'll end up

    spending lots of money trying to get it fixed). Finally, it should have some basic stuff added, such as Dragon Claws, x10 hits, etc. Things you won't want to waste

    time on.


    Here's some that I recommend. These are just RECOMMENDATIONS. I pulled these from the first two pages of the downloads section, feel free to dig deeper. Not

    too deep, or you'll be hopelessly outdated.
    [Only registered and activated users can see links. ] --- Commonly used
    [Only registered and activated users can see links. ] --- Looks OK, haven't used it
    [Only registered and activated users can see links. ] --- probably the most widely leeched server now?
    [Only registered and activated users can see links. ] --- 508 maps and full screen. This is what I use.
    [Only registered and activated users can see links. ] --- this is

    "SHARDS", so it's immediately harder because you'll have to figure out most of the coding yourself. The SQL integration is a nice bonus though...

    After you've picked a source, you will start customizing it, starting with basic name changes. Time to go to stage 5! (By the way, stage 4 really shouldn't take a

    stage in a row. But there's a good chance you'll switch between a few sources before settling, which will, when combined, take about a stage).



    What you should know after Stage 4

    • You should now have a source you are happy with, a name for yourself, and a name for your server



    STAGE 5 [Part 1] - MAKE YOUR SOURCE YOUR SOURCE! - 1 ~ 3 days

    NOTE: I will NOT be explaining how to set up your server! There's a billion tutorials on doing it, and I will just be adding an extra, un-needed 1000 words! Use the

    Search button!

    You've picked a source now. Just to see if it works well, run the server and log in to test it out.

    First, go to Config.java.
    A lot of customizing to do here, EXP Rates, Server Name, Admin Settings, etc.
    EXP Rates should be challenging, but not too hard. It should take about 1 hour to get 99 in a combat stat.

    Now, in your explorer search bar, type in the name of the source. It should show you every file in which it occurs. Replace all the occurrences with your server name.

    Do not change the cache download link in the Client files if there is one! It will screw up your client. It will be changed later on when you get a webhost.

    Not all occurrences of the source name will be found. Log in to your server and play around a little. When you see the source name come up, find it and change it!

    Also, FIX TYPOS. When you see a typo, FIX IT!!!!!! THIS IS SUPER IMPORTANT. TYPOS MAKE YOU LOOK STUPID!!! SPELL CORRECTLY AND USE GOOD

    GRAMMAR!!!


    You should now not be seeing any occurrences of the original source name appear. If someone playing your server sees something like "FormationX V3" pop up, it'll

    be embarrassing. I also recommend you change ever c.sendMessage a little so that it's hard to tell what source it originally was. People who know secret dupes

    specific to certain sources will not know your original source, so they won't try them.

    For the rest of the stage, play around with your server.
    Change little things that you notice to improve your server. Details are important!

    EX:
    "wellcum 2 da pkbox" is way worse than
    "Welcome to the PK Box!"

    The first makes you look like a bumbling, retarded, noob leecher. The second makes you look professional, smart, and sophisticated.



    What you should know after Stage 5 [Part 1]

    • Basic file editing
    • How to change a source name into your own server's name
    • How to not sound like an idiot
    • MOST IMPORTANT: KNOW MORE ABOUT THE SOURCE YOU ARE USING


    Stage 5 [Part 2] - CONFIGURATIONS - 1 ~ 7 days

    This may take a little longer if you get bored easily, since this is by far the most boring part of making your server really yours.

    Things to DEFINITELY change (most will be in data>cfg)
    • shops.cfg
    • NPCDrops.TSM (Use notepad to edit)
    • spawn-config.cfg


    Things to POSSIBLY change (don't change too much or you'll ruin your server. Mostly, just take a look at the files)
    • item.cfg
    • npc.cfg


    shops.cfg definitely needs to be changed. It will make it really obvious that you leeched the server. Change small things, remove items you think shouldn't be buy-

    able.

    NPCDrops.TSM can be changed later on. As long as the drops in your server right now are decent, you don't need to change it.

    spawn-config.cfg is pretty important. Move shops to a separate location, add :hops to teleport there. Also, change up training spots a little. Keep some typical ones

    like Rock Crabs, but also add new, unique spots. Don't make it too easy though, like chickens with 12048712894 hp.

    shops.cfg is going to be really boring to completely redo, you can start with just re-arranging the items, then do the boring stuff.



    What you should know after Stage 5 [Part 2]

    • cfg editing
    • A little more command practice
    • Your source should now look much more different.
    • Please don't brag to yourself at this point, you've barely done anything If you always make yourself think you're awesome, you will fail. I'll tell you when you're awesome.



    Stage 6 - BACK TO THE CLASSROOM - 5~15 days

    You may think now that you're a good coder. All I can say is "Nope". You can add a couple commands and make a server look slightly different. But have you added custom systems? Do you know what packets are? Can you completely remake crafting? "Nope".

    Here's where the road gets tougher.

    Here's an official Oracle tutorial.
    [Only registered and activated users can see links. ]
    I want you to read ALL OF IT.
    When you click something like "Classes and Objects", you'll be sent to a new page. On the sidebar, there's a billion things. READ IT ALL. There's also "Questions and Exercises". Do them if you want, but at least look at them.

    This will take you a while, but when you finish, you'll feel much more confident when programming new things.



    What you should know after Stage 6

    • Really, you should know everything on the page provided to you. There are parts you'll never need, but it's good to always have that knowledge.



    Working on this still, it'll be a LONG guide.

    Feel free to thank/rep if you find this helpful! It's taken me an hour to write so far, it takes you 15 seconds (if you don't lag) to press

    thanks and karma






    Feel free to rep/thank if I help!


    [Only registered and activated users can see links. ]
    Reply With Quote  
     


  2. #2  
    Registered Member Incipio's Avatar
    Join Date
    Jul 2011
    Posts
    183
    Thanks given
    20
    Thanks received
    34
    Rep Power
    3
    Reserved for posting random stuff.

    Spoiler for Update Log:
    8.19.11 -- Added a massive paragraph about PI. Also, changed weeks into stages. Added stage 6.
    8.18.11 -- Week 4+5+6 done! I'm bored, I'll go work on my server now.
    8.17.11 -- Posted Tutorial, halfway done with week 4.


    Feel free to rep/thank if I help!


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    The One And Only

    01053's Avatar
    Join Date
    Apr 2011
    Age
    25
    Posts
    2,888
    Thanks given
    416
    Thanks received
    884
    Rep Power
    856
    Nice.


    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Mar 2011
    Posts
    4,064
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    gj contributing,should be helpful to people just learning java
    Reply With Quote  
     

  5. #5  
    Registered Member Pakku's Avatar
    Join Date
    Mar 2010
    Posts
    1,234
    Thanks given
    127
    Thanks received
    111
    Rep Power
    47
    Looks nice, but you should also include that ints and longs and all those can be negative as well.


    Reply With Quote  
     

  6. #6  
    Registered Member Incipio's Avatar
    Join Date
    Jul 2011
    Posts
    183
    Thanks given
    20
    Thanks received
    34
    Rep Power
    3
    Quote Originally Posted by stripies View Post
    Looks nice, but you should also include that ints and longs and all those can be negative as well.
    I added it . Just wondering though, are there any cases where we need negatives?


    Feel free to rep/thank if I help!


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Apr 2009
    Posts
    1,728
    Thanks given
    403
    Thanks received
    210
    Rep Power
    390
    Its good to see someone taking the time to write something like this. Good job.
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Aug 2010
    Posts
    3,284
    Thanks given
    618
    Thanks received
    1,155
    Discord
    View profile
    Rep Power
    5000
    Nice, good job so far.
    Reply With Quote  
     

  9. #9  
    Registered Member Pakku's Avatar
    Join Date
    Mar 2010
    Posts
    1,234
    Thanks given
    127
    Thanks received
    111
    Rep Power
    47
    Quote Originally Posted by Incipio View Post
    I added it . Just wondering though, are there any cases where we need negatives?
    In a RSPS, not sure. Possible. But in other cases other than RSPS, yeah.


    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Dec 2010
    Posts
    88
    Thanks given
    21
    Thanks received
    10
    Rep Power
    4
    Actually a really really nice tutorial. Should be in informative threads though.
    My Tutorials: [Only registered and activated users can see links. ]
    Reply With Quote  
     

Page 1 of 6 123 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Visual Basic/C > Java. Java is for noobs.
    By Mrthunder23 in forum Chat
    Replies: 9
    Last Post: 06-12-2011, 02:18 AM
  2. Replies: 25
    Last Post: 10-26-2009, 10:09 PM
  3. Replies: 7
    Last Post: 09-01-2009, 11:54 AM
  4. Adding menu's for noobs (remember its for noobs)
    By Jordzeh in forum Tutorials
    Replies: 1
    Last Post: 01-20-2008, 09:58 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •