Welcome!

Join our community of MMORPG enthusiasts and private server developers! By registering, you'll gain access to in-depth discussions on source codes, binaries, and the latest developments in MMORPG server files. Collaborate with like-minded individuals, explore tutorials, and share insights on building and optimizing private servers. Join us today and unlock the full potential of MMORPG server development!

Join Today!

Making commands

Experienced Elementalist
Joined
Apr 13, 2010
Messages
280
Reaction score
18
Location
England
Ok so this is the code you need to understand

Code:
if (command.equalsIgnoreCase("helloworld"))
{
sM("Hello World!");
}


Basics
Only tested on delta base.

The first line is what you type in to make the command work. Fir instance, in my example i have out helloworld. Which means in game i would type ::helloworld.
Code:
if (command.equalsIgnoreCase("helloworld"))


Then this is what the command does, here in this example it says hellworld. sM meaning call or say. so in the chat window it would say helloworld
Code:
sM("Hello World!");

Expanding
Well now you have the code things you can add are teleport co ordinates

Code:
if (command.equalsIgnoreCase("telehere"))
{
sM("You are teleported to enter what you want");
toX = x;
toY = y;
}


Enjoy
 
Fucking pathetic.

Not only do you need to learn your code conventions, but your command string should be array integrated.

String[] cmd;
cmd[0] = p.stream.readQString();
cmd[1] = p.stream.readQString().subString(1);

Or something like that. I don't know because I haven't worked on rsps for a while.
 
How is it exactly pathetic? It's that simple. Stability, your coding methods are a little more complicating and longer. They are also older and nowadays they would result in people saying that your client.java is too unorganized and full of useless things.
 
Back