Purpose: to get actionbutton id's and making them work(works in interfaces too)Difficulty: 1/10 depends on what you code for the buttonClasses Modified: client.javaStep 1: ok lets say you wanted the button effect volume off to work
so first we click on the button once then we look in serverconsole and you should see something like
ok now we got the id of that button lets move on to step to
Step 2: to make that button work search after case 185 like this
- Code:
-
case 185:
and you should come to this one
- Code:
-
case 185: //clicking most buttons
and now scroll down untill you see this
- Code:
-
switch(actionButtonId) {
after the { so must you add a case like this
- Code:
-
case ACTIONBUTTONID:
so this case for that button will start now like this
- Code:
-
case 3173:
so now we got our case ready so lets add stuff that will happen when you press that button
so start with adding
- Code:
-
sendMessage("you just pressed the effect volume off button");
so it looks like
- Code:
-
case 3173:
sendMessage("you just pressed the effect volume off button");
and that's it but wait if you compile you will get a error
so lets add this under the sendmessage
- Code:
-
break;
so it looks like
- Code:
-
case 3173:
sendMessage("you just pressed the effect volume off button");
break;
now your done save and compile and click the button and you should see something like this when you click it
remember cases are like if's
case : is same as a {
and break; is same as }
except it should be one of each unless you do another switch in that case
what you have learn'd(i hope): how to get action button id's, how to make them work