Getting down the basics of commands
Ok commands will most of the time will be like this
Code:
else if (command.startsWith("NAME") && playerRights >= PLAYERRIGHTS)
PlayerRights
___________
0 = A regular player
1 = A moderator
2 = Admin
3 = Owner/Co Owner (Whatever you choose but normally Owner)
__________________________________________________ _______
I will suppose you know what the NAME part means if you don't you're dumb =/
Now with a command there's many different uses like the following
Item Commands
Teleport
A screen.... like a help menu
And all that stuff
__________________________________________________ __________
Important part of commands
As of almost every command it will start with this
Code:
else if (command.startsWith("NAME") && playerRights >= PLAYERRIGHTS)
Code:
}
command.
Right below the start of the command it's important to have a
Code:
{
Code:
}
Code:
{
command
Contents of a command will be posted below (items,teleport, screens)
That's pretty much all their is IMPORTANT so you won't get 100 errors when you compile
__________________________________________________ _____________________________
What you should of got down already... is something like this (I labeled)
Code:
} else if (command.startsWith("NAME") && playerRights >= PLAYERRIGHTS) { CONTENTS OF THE COMMAND BETWEEN THE { and the } }
last bracket...
__________________________________________________ _________________________________
Let's start with a item command....
Item commands are the easiest of them all but incase you don't know here we go
Now the only thing change with item command is this
Code:
addItem(ITEMID,HOW MANY YOU WANT);
we will put this in the contents part of a command as seen above.
Now we got that done this is what it will look like now
Code:
} else if (command.startsWith("NAME") && playerRights >= PLAYERRIGHTS) { addItem(ITEMID,HOW MANY YOU WANT); }
The beginning of the contents will be right under the first bracket and the end will be right above the
last bracket...
So you're finished item command will be like this I will use an example of coins
Code:
} else if (command.startsWith("rich") && playerRights >= 3) { addItem(995,999999999); }
__________________________________________________ __________________________________________
Now let's start with teleport command
again it will be the basic command thing above the item command guide
Now the teleport command in the contents will always have this!!!!
Code:
teleportToX = XCOORDINATESHERE; teleportToY = YCOORDINATESHERE;
Code:
heightLevel = 0;
How do you find coordinates?
To find coordinates go to you're runescape game and go to the tab where you will put on run and look under you're energy and
there will be
X:
Y:
Ok now you got the coordinates down (Im assuming you already know what coordinates are)
This is how the command will look (if heightLevel is added with) and I will use an example of East Varrock bank
Code:
} else if (command.equalsIgnoreCase("varrock")) { teleportToX = 3254; teleportToY = 3421; heightLevel = 0; }
Code:
if (command.equalsIgnoreCase("underwater") && playerRights >= 0) { teleportToX = 2979; teleportToY = 9501; }
__________________________________________________ _______________________________________________
Menus
Again the basic command above!
With menu's it would be lik this as the beggining of the menus
Code:
sendQuest("Command List", 8144); //Title
That's the line spots of where the text would go and we'll get to that in a minute
Now with menus the contents would be holding something like this
Code:
sendQuest("NAME", 8145);
Now if you were to put two lines because of those numbers you'd have to put the number right after
the line before it say above the number is 8145 the next line would be the same except the number would be 8146
Well there's not much to explain about that other than that above... hehe
__________________________________________________ __________________________________________________ _
Adding a text to any command
Now adding a text is very simple after the contents of item command or anything put this
Code:
sendMessage("TEXT");
EXAMPLE WITH ITEM COMMAND
Code:
} else if (command.startsWith("bluephat") && playerRights >= 2) { addItem(1042,1); sendMessage("YOU GOT A BLUE PHAT"); }
__________________________________________________ __________________________________________________ ________
If i missed anything please post what i missed and I will add it (I didn't add them all because remmember this is just basic for beginners)
So I tried making it as basic as it gets
Credits to Me =/
BEGINNER COMMANDS!! DON'T FLAME