Thread: [718 BEGINNER] How to make tabs more useful (such as music, quest)

Page 1 of 5 123 ... LastLast
Results 1 to 10 of 41
  1. #1 [718 BEGINNER] How to make tabs more useful (such as music, quest) 
    Registered Member Ffsn99b's Avatar
    Join Date
    Aug 2013
    Posts
    137
    Thanks given
    3
    Thanks received
    9
    Rep Power
    16
    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.
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    TWTMP Crew

    ISAI's Avatar
    Join Date
    Sep 2012
    Posts
    1,806
    Thanks given
    572
    Thanks received
    758
    Rep Power
    5000
    Please, please use the "[CODE]" tags?
    Reply With Quote  
     

  4. #3  
    Registered Member Ffsn99b's Avatar
    Join Date
    Aug 2013
    Posts
    137
    Thanks given
    3
    Thanks received
    9
    Rep Power
    16
    Quote Originally Posted by Laurence View Post
    Please, please use the "[CODE]" tags?
    Okay, I'm new to posting on rune-server lol so mind the noobiness
    Reply With Quote  
     

  5. #4  
    TWTMP Crew

    ISAI's Avatar
    Join Date
    Sep 2012
    Posts
    1,806
    Thanks given
    572
    Thanks received
    758
    Rep Power
    5000
    Quote Originally Posted by Ffsn99b View Post
    Okay, I'm new to posting on rune-server lol so mind the noobiness
    Understandable, we all start somewhere! It's formated like this "[CODE]" CODE HERE "[/ CODE]"
    Reply With Quote  
     

  6. #5  
    Reverse Engineering

    freeezr's Avatar
    Join Date
    Dec 2011
    Posts
    1,067
    Thanks given
    280
    Thanks received
    443
    Rep Power
    401
    This has been released before, but gj for bringing it back for those who cant find it.

    Quote Originally Posted by Laurence View Post
    Understandable, we all start somewhere! It's formated like this "[CODE]" CODE HERE "[/ CODE]"
    yeah, so for example ["code]sendTab(125, 187); // music["/code] without the quotation marks would give you
    Code:
    sendTab(125, 187); // music
    which makes it way neater and easier to read. GL

    Reply With Quote  
     

  7. #6  
    Registered Member Ffsn99b's Avatar
    Join Date
    Aug 2013
    Posts
    137
    Thanks given
    3
    Thanks received
    9
    Rep Power
    16
    Quote Originally Posted by Im Frizzy View Post
    This has been released before, but gj for bringing it back for those who cant find it.



    yeah, so for example ["code]sendTab(125, 187); // music["/code] without the quotation marks would give you
    Code:
    sendTab(125, 187); // music
    Ah okay, well sorry for the repost. I just thought I'd elaborate a little on it since I know it might give new coders a hard time figuring it out and not understanding what it does (I've only just started with 718s myself mind you) but as long as it helps some people
    Reply With Quote  
     

  8. #7  
    48 0x69

    Pax M's Avatar
    Join Date
    Oct 2013
    Posts
    2,012
    Thanks given
    36
    Thanks received
    488
    Discord
    View profile
    Rep Power
    2245
    Good job.
    Reply With Quote  
     

  9. #8  
    Banned

    Join Date
    Sep 2011
    Posts
    1,037
    Thanks given
    133
    Thanks received
    257
    Rep Power
    0
    Helpful for people i guess, although i thought this was already released like in 2012
    Reply With Quote  
     

  10. #9  
    Banned

    Join Date
    Jan 2012
    Age
    22
    Posts
    2,705
    Thanks given
    907
    Thanks received
    628
    Rep Power
    0
    Why would you want to remove the music tab? Idiot..
    Reply With Quote  
     

  11. #10  
    Registered Member Ffsn99b's Avatar
    Join Date
    Aug 2013
    Posts
    137
    Thanks given
    3
    Thanks received
    9
    Rep Power
    16
    Quote Originally Posted by Sam Bartlett View Post
    Why would you want to remove the music tab? Idiot..
    Because I don't feel like using music in my server? Lmao
    Reply With Quote  
     

Page 1 of 5 123 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 4
    Last Post: 10-04-2011, 03:47 AM
  2. How to make a shop using PK Points?
    By YOUS-508 in forum Help
    Replies: 4
    Last Post: 11-27-2009, 08:52 PM
  3. how to make you cant use this names:
    By DDS-PKZ in forum Help
    Replies: 3
    Last Post: 09-20-2009, 04:09 PM
  4. How to Make a Server using Windows Vista
    By Full Metalst in forum Tutorials
    Replies: 20
    Last Post: 01-22-2009, 06:57 PM
  5. How to make pots more realistic.
    By i burn piff in forum Tutorials
    Replies: 7
    Last Post: 08-20-2007, 05:15 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •