public static final String[] SKILL_NAMES = { "Attack", "Defence", "Strength", "Hitpoints", "Range", "Prayer", "Magic", "Cooking", "Woodcutting", "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining", "Herblore", "Agility", "Thieving", "Slayer", "Farming", "Runecrafting", "Construction", "Hunter", "Summoning" }; private static int getSkillIndex(String name) { for (int i = 0; i < SKILL_NAMES.length; i++) { if (name.equals(SKILL_NAMES[i])) { return i; } } return -1; } public static void Skills(TextDrawingArea[] TDA) { RSInterface Interface = addInterface(3917); addSprite(20000, 1, "Skill/SKILL"); addText(50240, "Total Level: 0", 0xffff00, false, true, 52, TDA, 2); setChildren(3, Interface); setBounds(20000, 5, 17, 0, Interface); setBounds(20001, 7, 20, 1, Interface); setBounds(50240, 7, 1, 2, Interface); Interface = addInterface(20001); Interface.height = 226; Interface.width = 163; Interface.scrollMax = 258; setChildren(97, Interface); //85 int frame = 1; int[] Height = { 3, 3, 3, 34, 34, 34, 66, 66, 66, 98, 98, 98, 131, 131, 131, 162, 162, 162, 195, 195, 195, 228, 228, 228 }; int[] Width = { 24, 78, 132, 24, 78, 132, 24, 78, 132, 24, 78, 132, 24, 78, 132, 24, 78, 132, 24, 78, 132, 24, 78, 132, }; int[] Height1 = { 15, 15, 15, 48, 48, 48, 80, 80, 80, 111, 111, 111, 145, 145, 145, 175, 175, 175, 208, 208, 208, 241, 241, 241 }; int[] Width1 = { 24+12, 78+12, 132+12, 24+12, 78+12, 132+12, 24+12, 78+12, 132+12, 24+12, 78+12, 132+12, 24+12, 78+12, 132+12, 24+12, 78+12, 132+12, 24+12, 78+12, 132+12, 24+12, 78+12, 132+12, }; int[] skillID1 = { 4004, 4016, 4028, 4006, 4018, 4030, 4008, 4020, 4032, 4010, 4022, 4034, 4012, 4024, 4036, 4014, 4026, 4038, 4152, 12166, 13926, 50204, 50206, 50208 }; int[] skillID2 = { 4005, 4017, 4029, 4007, 4019, 4031, 4009, 4021, 4033, 4010, 4023, 4035, 4013, 4025, 4037, 4014, 4026, 4038, 4152, 12167, 13927, 50205, 50207, 50209 }; int[] X = { 0+2, 54+2, 107+2, 0+2, 54+2, 107+2, 0+2, 54+2, 107+2,0+2, 54+2, 107+2, 0+2, 54+2, 107+2,0+2, 54+2, 107+2,0+2, 54+2, 107+2, 0+2, 54+2, 107+2, }; int[] Y = { 0, 0, 0, 32, 32, 32, 64, 64, 64, 96, 96, 96, 128, 128, 128, 160, 160, 160, 192, 192, 192, 224, 224, 224 }; int[] skillButtonIDs = { 50002, 50003, 50004, 50005, 50006, 50007, 50008, 50009, 50010, 50011, 50012, 50013, 50014, 50015, 50016, 50017, 50018, 50019, 50020, 50021, 50022, 50210, 50220, 50230 }; int[] hoverIDs = { 50023, 50030, 50037, 50044, 50051, 50058, 50065, 50072, 50080, 50087, 50094, 50101, 50108, 50115, 50122, 50129, 50136, 50143, 50150, 50157, 50164, 50215, 50225, 50235 }; String[] skillStrings = { "Combat", "Combat", "Mining", "Combat", "Agility", "Smithing", "Combat", "Herblore", "Fishing", "Range", "Thieving", "Cooking", "Prayer", "Crafting", "Firemaking", "Magic", "Fletching", "Woodcutting", "Runecrafting", "Slayer", "Farming", "Construction", "Hunter", "Summoning" }; String[] skillNames = { "Attack", "Hitpoints", "Mining", "Strength", "Agility", "Smithing", "Defence", "Herblore", "Fishing", "Range", "Thieving", "Cooking", "Prayer", "Crafting", "Firemaking", "Magic", "Fletching", "Woodcutting", "Runecrafting", "Slayer", "Farming", "Construction", "Hunter", "Summoning" }; int[] hoverX = { 15, 25, 28, 15, 25, 28, 15, 25, 28, 15, 25, 28, 15, 25, 28, 15, 25, 28, 15, 25, 28, 15, 25, 28 }; int[] hoverY = { 34, 34, 34, 66, 66, 66, 98, 98, 98, 130, 130, 130, 162, 162, 162, 83, 83, 83, 118, 118, 118, 153, 153, 153 }; int skillCount = 0; for(int i : skillID1){//-.-no addText(i, "%1", 0xffff00, true, true, 52, TDA, 0); setBounds(i, Width[frame-1] + 7, Height[frame-1] + 1, frame, Interface); int[][] valueIndexArray = new int[1][3]; valueIndexArray[0][0] = 1; valueIndexArray[0][1] = getSkillIndex(skillNames[skillCount++]); valueIndexArray[0][2] = 0; interfaceCache[i].valueIndexArray = valueIndexArray; frame++; } int frame1 = 0; skillCount = 0; for(int i : skillID2){ addText(i, "%1", 0xffff00, true, true, 52, TDA, 0); setBounds(i, Width1[frame1] + 7, Height1[frame1] + 1, frame, Interface); int[][] valueIndexArray = new int[1][3]; valueIndexArray[0][0] = 2; valueIndexArray[0][1] = getSkillIndex(skillNames[skillCount++]); valueIndexArray[0][2] = 0; interfaceCache[i].valueIndexArray = valueIndexArray; frame++; frame1++; } int frame2 = 0; for(int i : skillButtonIDs){ addSkillButton(i, 0, "", skillStrings[frame2], 1, hoverIDs[frame2], TDA, skillNames[frame2]); setBounds(i, X[frame2], Y[frame2], frame, Interface); frame++; frame2++; } int frame3 = 0; for(int i : hoverIDs){ setBounds(i, hoverX[frame3], hoverY[frame3], frame, Interface); frame++; frame3++; } addSprite(20200, 0, "Skill/SKILL"); setBounds(20200, 0, 0, 0, Interface); } public static void addSkillButton(int i, int spriteID, String name, String skillGuide, int AT, int hoverID, TextDrawingArea[] TDA, String skillName) { RSInterface Interface = addInterface(i); Interface.id = i; Interface.parentID = i; Interface.type = 5; Interface.atActionType = AT; Interface.contentType = 0; Interface.aByte254 = 0; Interface.mOverInterToTrigger = hoverID; Interface.sprite1 = imageLoader(spriteID, name); Interface.sprite2 = imageLoader(spriteID, name); Interface.width = 53; Interface.height = 32; Interface.tooltip = "View "+skillGuide+" Guide"; Interface = addInterface(hoverID); Interface.isMouseoverTriggered = true; Interface.type = 0; Interface.atActionType = 0; Interface.mOverInterToTrigger = -1; Interface.width = 512; Interface.height = 334; Interface.parentID = hoverID; Interface.id = hoverID; addBox(hoverID+1, 0, false, 0x000000, skillName+" Lvl:\nCurrentXP:\nNext Lvl:\nRemainder:"); setChildren(1, Interface); setBounds(hoverID+1, 0, 0, 0, Interface); } public static void addBox(int id, int byte1, boolean filled, int color, String text){ RSInterface Interface = addInterface(id); Interface.id = id; Interface.parentID = id; Interface.type = 9; Interface.aByte254 = (byte)byte1; Interface.aBoolean227 = filled; Interface.mOverInterToTrigger = -1; Interface.atActionType = 0; Interface.contentType = 0; Interface.textColor = color; Interface.message = text; } public static Sprite getSprite(String s) { Sprite image; try { image = new Sprite(s); if (image != null) { return image; } } catch (Exception e) { e.printStackTrace(); return null; } return image; } public static void addSkillButton(int id) { RSInterface button = addInterface(id); button.type = 5; button.atActionType = 5; button.contentType = 0; button.width = 60; button.height = 27; button.sprite1 = CustomSpriteLoader(33225, ""); button.sprite1 = getSprite("Button"); button.tooltip = "View"; }