Hey ya'll, this tutorial is based on making certain tabs (mainly quest and music) more useful in RSPS's as usually they aren't coded to do anything or just displayed. The source I am using is 718 Matrix.
This tutorial is BEGINNER level only. It also says BEGINNER in the thread title. If you are already aware of doing this, then I suggest to go look at another thread than just put "DUDE I KNEW THIS ALREADY THIS IS SO EASY". It's for the new guys okay?
Difficulty: 2/10 (clear step-by-step instructions, copy and paste and minor tweaks, basic java common-sense)
How it looks (quest tab):

Files edited:
InterfaceManager.java
ButtonHandler.java
We'll do the Music tab, although you can easily switch/add the quest tab too.
First, open InterfaceManager.java
Find public void sendFullScreenInterfaces()
You should see this line of code in it:
Code:
sendTab(125, 187); // music
replace it with
Code:
sendReplacedMusicTab();
Next go to public void sendFixedInterfaces() underneath and find the following line of code:
Code:
sendTab(185, 187);// music
replace it with
Code:
sendReplacedMusicTab();
Now, we need to code our replaced tab.
For the purpose of this tutorial I am going to use the jester interface (506). If you want to use another interface, then change 506 to the new interface. It will probably require different childIds (explained later on) so bear that in mind too.
Copy and paste the following within InterfaceManager.java:
Code:
public void sendReplacedMusicTab() {
sendTab(resizableScreen ? 125 : 185, 506);
player.getPackets().sendIComponentText(506, 0, "1");
player.getPackets().sendIComponentText(506, 2, "2");
player.getPackets().sendIComponentText(506, 12, "3");
player.getPackets().sendIComponentText(506, 8, "4");
player.getPackets().sendIComponentText(506, 6, "5");
player.getPackets().sendIComponentText(506, 10, "6");
player.getPackets().sendIComponentText(506, 4, "7");
player.getPackets().sendIComponentText(506, 14, "8");
}
For beginners, to explain how it works:
sendTab(resizableScreen ? 125 : 185, 506); - this line is sending the tab to the appropriate positions, as 125 is its location in fixed mode and 185 in full screen. While 506 is the interface id I am using, you can change it to the interface you want to use.
Think of it like this -
sendTab(resizableScreen ? fixed screen id : full screen id, interface id);
If you want to use the quest tab instead/too, it would be:
sendTab(resizableScreen ? 114 : 174, interface id);
Every interface has their own id and their own childIds. Each player.getPackets().sendIComponentText line display a string, when given the right childId (the childIds of the interface here are 0,2,12,8,6,10,14). It also has 506 in the line since it is sending the text for that interface. Each line here is sending text to those childIds. Also note these childIds need to be used in the ButtonHandler if you're using buttons and giving them functions. A template string to use would be:
Code:
player.getPackets().sendIComponentText(interfaceId, childId, "text displayed goes here");
Now you want to give these buttons a function? No problem! (note the following leaves them blank but you can easily add your coding)
Next, open ButtonHandler.java
Find this: (you can put the statement in a lot of places actually but just for guidance reasons we'll put it here)
Code:
else if (interfaceId == 271) {
WorldTasksManager.schedule(new WorldTask() {
@Override
public void run() {
if (componentId == 8 || componentId == 42)
player.getPrayer().switchPrayer(slotId);
else if (componentId == 43
&& player.getPrayer().isUsingQuickPrayer())
player.getPrayer().switchSettingQuickPrayer();
}
});
}
After the last curly bracket, copy and paste the following:
Code:
else if (interfaceId == 506) {//Custom tab buttons
switch(componentId) {
case 2:
break;
case 12:
break;
case 8:
break;
case 6:
break;
case 10:
break;
case 4:
break;
case 14:
break;
}
}
As you can see, each childId from the interface has also appeared here. If they are a button, pressing them would do whatever function is listed here. So to add what each button does, put your code inbetween the case (childId) and breaks.
NOTE: These buttons are empty, although the skeleton has been done for you so you can add your own functionality. The jester interface is 506 again so that's why we are using it here. Change to yours as appropriate. If you're going to have custom tabs on both quest and/or music (or any others), you will need to code something similar to the above with the right interface id and child ids.
Although this is fairly simple tutorial, you can add your own things such as a pk points system to the unused tabs making your server more unique
.
If there's any problems, post below and I'll try to help.