Purpose: To Teach About the Basic Java Keywords
The Following Tutorial Is About The most common used in Private servers
boolean
break
case
else
false
if
int
private
public
return
static
String
switch
true
BOOLEAN
A boolean is a value that is either true or false. A boolean can either be public or private
Code:
ProtMage == false &&
ProtRange == false &&
ProtMelee == false
The Above code are all examples of Booleans because they can either be true or false. in this can false
BREAK;
The break keyword is used to close a for, while, or do loop or to mark the end of a case block in a switch statement.
Code:
case 0: // Attack levelup
sendFrame164(6247);
stillgfx(199, absX, absY);
sendFrame126("Congratulations, you just advanced an attack level!", 6248);
sendFrame126("Your attack level is now "+playerLevel[0]+" .", 6249);
sendMessage("Congratulations, you just advanced an attack level.");
stillgfx(199, absY, absX);
NpcDialogueSend = true;
break;
In the Above Example the break; is used to close a case in a switch statement
CASE
The case is used to label each branch in a switch statement
Code:
switch(skill)
{
case 0: // Attack levelup
sendFrame164(6247);
stillgfx(199, absX, absY);
sendFrame126("Congratulations, you just advanced an attack level!", 6248);
sendFrame126("Your attack level is now "+playerLevel[0]+" .", 6249);
sendMessage("Congratulations, you just advanced an attack level.");
stillgfx(199, absY, absX);
NpcDialogueSend = true;
In the above example case 0: is a branch of switch(skill)
ELSE
The else keyword is always used in association with the if keyword in an if−else statement
Code:
if(command.equalsIgnoreCase("Test1")) {
teletox:0000
teleto7:0000
}
else if(teleblock == true)
{
sendMessage("A magical force stops you from teleporting.");
}
Th above example is stating that if they have had tele-block casted on them they will be unable to teleport.
if
The if keyword indicates the start of a block of coding
There are thousands of Examples in you client.java
The if keyword is used for everything
int
An int is a primitive. It is not an Object. And int must be declared before use
An Int can be either puiblic or private
Code:
public int potTimer0 = 0;
public int potTimer1 = 0;
public int potTimer2 = 0;
public int potTimer3 = 0;
public int potTimer4 = 0;
public int potTimer5 = 0;
public int potTimer6 = 0;
Very few people that use private server's accually know what ints are.
STATIC
The static keyword may be applied to a class defined within another class
Code:
public static int more2handed[] = {7158};
public static int more2handed()
{
return more2handed[more2handed.length];
}
SWITCH
The switch statement is used to select execution of one of multiple code blocks based on an expression.
The switch(NPCID) is a switch for the summoning skill. The switch must be closed off by the break; keyword
PLEASE POST FEEDBACK