You can check the first one I made
here
I cannot explain these things well so don't PM me about thing you don't understand. Sorry.
(Somewhat)Advanced commands
Making a command with 2+ parts is easy. You just have to use these below.
Examples:
Code:
String name = command[1];
int id = Integer.parseInt(command[1]);
double id = Double.parseDouble(command[1])
boolean bool = Boolean.parseBoolean(command[1]);
These will make up your 2nd or other part of the command.
This is letting you type an integer for your command
Code:
Integer.parseInt(command[1])
Since this is an array, you need to change "[1]" or keep it depending on which part you want this in the command.
[0] is set as the first in an array instead of [1] so the "[1]" would be set to the second part of the command.[/I]
This command
Code:
if (command[0].equals("guess")) {
int amount = Integer.parseInt(command[1]);
player.setGuess(amount);
}
Would look like this if I typed it
55 = any integer (negative/positive)
This is the same for the other except you need to add "true/false" or "text" depending on what your using.
Examples:
This command
Code:
if (command[0].equalsIgnoreCase("setdoubleexp")) {
boolean bool = Boolean.isDoubleExp = bool;
}
Would look like this if I typed it
Code:
::setdoubleexp true
And this command
Code:
if (command[0].equalsIgnoreCase("shout")) {
String aString = command[1];
player.forceText(aString);
}
Would look like this if I typed it
Code:
::shout "YOUR MESSAGE"
You don't need to add the quotations as those will give you command prompt errors.
Clicking Item Actions
Go into src/org/dementhium/event/impl/interfaces/
Open InventoryListener.java
[First Option]
Search for
Under there you will see
Under that will you have to add the item id as the case number or you can do this just right under if (opcode == 6) {
Code:
if (itemId == ITEMID) {
}
ITEMID = the item id you want there.
If you notice on your command prompt it also says opcode 6 usually when your taking off something.
It can still be used as a first click option.
[Second Option]
Search for
Do the same thing as I said for the first option
The is another option but I'm sure you can find it.
Interface Writing
I will show you how to make this
Into this
Putting things onto the interface just requires the interface id and child id
The child id is somewhat easy to figure out if you have the button id (doesn't always work)
It is something you are replacing if your going to put and item on there or a String
Now for the transformation...
Code:
for(int i = 0; i < 18; i++) {
ActionSender.sendString(player, "", 277, i);
}
ActionSender.sendString(player, "Congratulations!", 277, 3);
ActionSender.sendString(player, "You have completed Korasi's Sword!", 277, 4);
ActionSender.sendString(player, "<col=0000ff>You are awarded", 277, 9);
ActionSender.sendString(player, "Korasi's Sword", 277, 10);
ActionSender.sendString(player, "100K in 1 of 4 skills (EXP Lamp)", 277, 11);
ActionSender.sendString(player, "Elite Void top and bottom", 277, 12);
ActionSender.sendString(player, "2 Quest points", 277, 13);
ActionSender.sendItemOnInterface(player, 277, 5, 1, 19784);
ActionSender.sendString(player, "Quest Points:", 277, (6));
ActionSender.sendString(player, "" + player.getDefinition().getQuestPoints(), 277, (7));
ActionSender.sendInterface(player, 277);
The for loop here is removing all of the things that say like "Line 3" or "qj123"
Code:
for(int i = 0; i < 18; i++) {
ActionSender.sendString(player, "", 277, i);
}
If you didn't use that than you would have an unwanted mess unless you went through all the child id's putting quotation marks.
This is sending a String onto the interface
Code:
ActionSender.sendString(player, "MESSAGE", 277, 6);
277 = the interface Id you want there
6 = the child id on the interface you are changing
(You will understand it once you mess around a little bit)
This is sender an item onto the interface
Code:
ActionSender.sendItemOnInterface(player, 277, 5, 1, 19784);
277 = interface id
5 = child id
1 = amount of items diplayed
19784 = item id
I think I've explained enough...
Thats as advanced as I'm going to get...