Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Making commands

Experienced Elementalist
Joined
Apr 13, 2010
Messages
280
Reaction score
18
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
 
Junior Spellweaver
Joined
Jan 6, 2009
Messages
136
Reaction score
0
Ducking 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.
 
Newbie Spellweaver
Joined
Dec 14, 2010
Messages
7
Reaction score
0
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.
 
Custom Title Activated
Loyal Member
Joined
Mar 26, 2009
Messages
1,778
Reaction score
1,209
thanks for this
 
Back
Top