PDA

View Full Version : Adding/understanding commands



Mohammad
October 9th, 2010, 05:03
Hello,
Today i swore some one made a thread telling how to make a command and wasn't proper so i planned to make this.

To start off ill say some common errors caused when sources are different so for example you try adding a delta command to a devolution command.
(some normal ones)
some time you'll get this error:

client.java:####: cannot find symbol
symbol : method sendMessage(java.lang.String)
location: class client
sendMessage("text here....");
^

This means it cannot understand the method "sendMessage"
In that case change
sendMessage into
sM don't forget the capitals!

Next one is this:



client.java:####: cannot find symbol
symbol : method frame99(int)
location: class client
c.frame99(0);
^
Change that into
sendFrame99(0); don't forget the capitals!

other one is this:


client.java:12733: cannot find symbol
symbol : variable teleportToX
location: class client
c.teleportToX = 3123;
^
client.java:12734: cannot find symbol
symbol : variable teleportToY
location: class client
c.teleportToY = 3242;
^
There you need to change the
c.teleportToX and
teleportToY
To
toX = 3123; and
toY = 3242;

Some people might see this:

c.teleportTo = 3222 , 3222;

Do the thing same as above but this one is like first one is
toX and the second one
is
toY

If you see this error:


client.java:####: cannot find symbol
symbol : method sendMessage(java.lang.String)
location: class client
c.sendMessage("[text here....]);
Try making that into this:

client.java:####: cannot find symbol
symbol : method sendMessage(java.lang.String)
location: class client
sendMessage("[text here....]);

If it did not work then make it this:

client.java:####: cannot find symbol
symbol : method sendMessage(java.lang.String)
location: class client
sM("text here....");
--------------------------------------------------------------------------------------------------------------------
Okay,
Now for adding commands!

Go to client.java and search for
private void customCommand(String command) {
Right under that put your command in.

--------------------------------------------------------------------------------------------------------------------
Now for editing commands when you see something like this:

if (command.startsWith("@@@@") && (playerRights >= #)) {

In @@@@ type in your command name and in the # type the player rights (for editting)

I made this because i used to have problems converting but when i found out how to do it i made a thread for it.

If you see any other kinds of error let me know and I'll be happy to help!