A RuneTek3 client (377) that is deobfuscated, converted to Kotlin, and includes QoL improvements.
0

Configure Feed

Select the types of activity you want to include in your feed.

added new right click context menu debug, togglable in the config file

+83 -64
+1
config/EXAMPLE-client-config.yaml
··· 17 17 game: 18 18 roofsEnabled: true 19 19 freeTeleports: true 20 + debugContext: true
+74 -53
src/main/java/com/jagex/runescape/Game.java
··· 9 9 import java.net.MalformedURLException; 10 10 import java.net.Socket; 11 11 import java.net.URL; 12 + import java.text.MessageFormat; 12 13 import java.util.Calendar; 13 14 import java.util.Date; 14 15 import java.util.zip.CRC32; ··· 496 497 private int menuScreenArea; 497 498 private int menuOffsetX; 498 499 private int menuOffsetY; 499 - private int anInt1307; 500 - private int anInt1308; 500 + private int menuWidth; 501 + private int menuHeight; 501 502 private static int drawCycle; 502 503 private int[] anIntArray1310; 503 504 private int[] anIntArray1311; ··· 3662 3663 opcode = -1; 3663 3664 for (int j = 0; j < Model.resourceCount; j++) { 3664 3665 int k = Model.anIntArray1709[j]; 3665 - int l = k & 0x7f; 3666 - int i1 = k >> 7 & 0x7f; 3666 + int x = k & 0x7f; 3667 + int y = k >> 7 & 0x7f; 3667 3668 int j1 = k >> 29 & 3; 3668 3669 int k1 = k >> 14 & 0x7fff; 3669 3670 if (k == i) 3670 3671 continue; 3671 3672 i = k; 3672 - if (j1 == 2 && currentScene.method271(plane, l, i1, k) >= 0) { 3673 - GameObjectDefinition class47 = GameObjectDefinition.getDefinition(k1); 3674 - if (class47.childrenIds != null) 3675 - class47 = class47.getChildDefinition(); 3676 - if (class47 == null) 3673 + if (j1 == 2 && currentScene.method271(plane, x, y, k) >= 0) { 3674 + GameObjectDefinition gameObject = GameObjectDefinition.getDefinition(k1); 3675 + if (gameObject.childrenIds != null) 3676 + gameObject = gameObject.getChildDefinition(); 3677 + if (gameObject == null) 3677 3678 continue; 3678 3679 if (itemSelected == 1) { 3679 - menuActionTexts[menuActionRow] = "Use " + selectedItemName + " with @cya@" + class47.name; 3680 + menuActionTexts[menuActionRow] = "Use " + selectedItemName + " with @cya@" + gameObject.name; 3680 3681 menuActionTypes[menuActionRow] = 467; 3681 3682 selectedMenuActions[menuActionRow] = k; 3682 - firstMenuOperand[menuActionRow] = l; 3683 - secondMenuOperand[menuActionRow] = i1; 3683 + firstMenuOperand[menuActionRow] = x; 3684 + secondMenuOperand[menuActionRow] = y; 3684 3685 menuActionRow++; 3685 3686 } else if (widgetSelected == 1) { 3686 3687 if ((anInt1173 & 4) == 4) { 3687 - menuActionTexts[menuActionRow] = selectedWidgetName + " @cya@" + class47.name; 3688 + menuActionTexts[menuActionRow] = selectedWidgetName + " @cya@" + gameObject.name; 3688 3689 menuActionTypes[menuActionRow] = 376; 3689 3690 selectedMenuActions[menuActionRow] = k; 3690 - firstMenuOperand[menuActionRow] = l; 3691 - secondMenuOperand[menuActionRow] = i1; 3691 + firstMenuOperand[menuActionRow] = x; 3692 + secondMenuOperand[menuActionRow] = y; 3692 3693 menuActionRow++; 3693 3694 } 3694 3695 } else { 3695 - if (class47.options != null) { 3696 + if (gameObject.options != null) { 3696 3697 for (int l1 = 4; l1 >= 0; l1--) 3697 - if (class47.options[l1] != null) { 3698 - menuActionTexts[menuActionRow] = class47.options[l1] + " @cya@" 3699 - + class47.name; 3698 + if (gameObject.options[l1] != null) { 3699 + menuActionTexts[menuActionRow] = gameObject.options[l1] + " @cya@" 3700 + + gameObject.name; 3700 3701 if (l1 == 0) 3701 3702 menuActionTypes[menuActionRow] = 35; 3702 3703 if (l1 == 1) ··· 3708 3709 if (l1 == 4) 3709 3710 menuActionTypes[menuActionRow] = 1280; 3710 3711 selectedMenuActions[menuActionRow] = k; 3711 - firstMenuOperand[menuActionRow] = l; 3712 - secondMenuOperand[menuActionRow] = i1; 3712 + firstMenuOperand[menuActionRow] = x; 3713 + secondMenuOperand[menuActionRow] = y; 3713 3714 menuActionRow++; 3714 3715 } 3715 3716 3716 3717 } 3717 - menuActionTexts[menuActionRow] = "Examine @cya@" + class47.name; 3718 + StringBuilder examineText = new StringBuilder(); 3719 + examineText.append(MessageFormat.format("Examine <col=00ffff>{0}</col>", gameObject.name)); 3720 + if (DEBUG_CONTEXT) { 3721 + examineText.append(" <col=00ff00>(</col>"); 3722 + examineText.append( 3723 + MessageFormat.format("<col=ffffff>{0}</col>", 3724 + Integer.toString(gameObject.id) 3725 + ) 3726 + ); 3727 + examineText.append("<col=00ff00>) (</col>"); 3728 + examineText.append( 3729 + MessageFormat.format("<col=ffffff>{0}, {1}</col>", 3730 + Integer.toString(x + nextTopLeftTileX), 3731 + Integer.toString(y + nextTopRightTileY) 3732 + ) 3733 + ); 3734 + examineText.append("<col=00ff00>)</col>"); 3735 + 3736 + 3737 + } 3738 + menuActionTexts[menuActionRow] = examineText.toString(); 3718 3739 menuActionTypes[menuActionRow] = 1412; 3719 - selectedMenuActions[menuActionRow] = class47.id << 14; 3720 - firstMenuOperand[menuActionRow] = l; 3721 - secondMenuOperand[menuActionRow] = i1; 3740 + selectedMenuActions[menuActionRow] = gameObject.id << 14; 3741 + firstMenuOperand[menuActionRow] = x; 3742 + secondMenuOperand[menuActionRow] = y; 3722 3743 menuActionRow++; 3723 3744 } 3724 3745 } ··· 3734 3755 && npc1.npcDefinition.boundaryDimension == 1 3735 3756 && npc1.worldX == npc.worldX 3736 3757 && npc1.worldY == npc.worldY) 3737 - method82(npc1.npcDefinition, i1, l, npcIds[i2]); 3758 + method82(npc1.npcDefinition, y, x, npcIds[i2]); 3738 3759 } 3739 3760 3740 3761 for (int k2 = 0; k2 < localPlayerCount; k2++) { ··· 3742 3763 if (player != null 3743 3764 && player.worldX == npc.worldX 3744 3765 && player.worldY == npc.worldY) 3745 - method38(playerList[k2], i1, l, player); 3766 + method38(playerList[k2], y, x, player); 3746 3767 } 3747 3768 3748 3769 } 3749 - method82(npc.npcDefinition, i1, l, k1); 3770 + method82(npc.npcDefinition, y, x, k1); 3750 3771 } 3751 3772 if (j1 == 0) { 3752 3773 Player player1 = players[k1]; ··· 3758 3779 && npc.npcDefinition.boundaryDimension == 1 3759 3780 && npc.worldX == player1.worldX 3760 3781 && npc.worldY == player1.worldY) 3761 - method82(npc.npcDefinition, i1, l, npcIds[j2]); 3782 + method82(npc.npcDefinition, y, x, npcIds[j2]); 3762 3783 } 3763 3784 3764 3785 for (int l2 = 0; l2 < localPlayerCount; l2++) { ··· 3767 3788 && player != player1 3768 3789 && player.worldX == player1.worldX 3769 3790 && player.worldY == player1.worldY) 3770 - method38(playerList[l2], i1, l, player); 3791 + method38(playerList[l2], y, x, player); 3771 3792 } 3772 3793 3773 3794 } 3774 - method38(k1, i1, l, player1); 3795 + method38(k1, y, x, player1); 3775 3796 } 3776 3797 if (j1 == 3) { 3777 - LinkedList itemList = groundItems.getTile(plane, l, i1); 3798 + LinkedList itemList = groundItems.getTile(plane, x, y); 3778 3799 if (itemList != null) { 3779 3800 for (Item item = (Item) itemList.last(); item != null; item = (Item) itemList 3780 3801 .previous()) { ··· 3783 3804 menuActionTexts[menuActionRow] = "Use " + selectedItemName + " with @lre@" + itemDefinition.name; 3784 3805 menuActionTypes[menuActionRow] = 100; 3785 3806 selectedMenuActions[menuActionRow] = item.itemId; 3786 - firstMenuOperand[menuActionRow] = l; 3787 - secondMenuOperand[menuActionRow] = i1; 3807 + firstMenuOperand[menuActionRow] = x; 3808 + secondMenuOperand[menuActionRow] = y; 3788 3809 menuActionRow++; 3789 3810 } else if (widgetSelected == 1) { 3790 3811 if ((anInt1173 & 1) == 1) { 3791 3812 menuActionTexts[menuActionRow] = selectedWidgetName + " @lre@" + itemDefinition.name; 3792 3813 menuActionTypes[menuActionRow] = 199; 3793 3814 selectedMenuActions[menuActionRow] = item.itemId; 3794 - firstMenuOperand[menuActionRow] = l; 3795 - secondMenuOperand[menuActionRow] = i1; 3815 + firstMenuOperand[menuActionRow] = x; 3816 + secondMenuOperand[menuActionRow] = y; 3796 3817 menuActionRow++; 3797 3818 } 3798 3819 } else { ··· 3810 3831 if (i3 == 4) 3811 3832 menuActionTypes[menuActionRow] = 270; 3812 3833 selectedMenuActions[menuActionRow] = item.itemId; 3813 - firstMenuOperand[menuActionRow] = l; 3814 - secondMenuOperand[menuActionRow] = i1; 3834 + firstMenuOperand[menuActionRow] = x; 3835 + secondMenuOperand[menuActionRow] = y; 3815 3836 menuActionRow++; 3816 3837 } else if (i3 == 2) { 3817 3838 menuActionTexts[menuActionRow] = "Take @lre@" + itemDefinition.name; 3818 3839 menuActionTypes[menuActionRow] = 684; 3819 3840 selectedMenuActions[menuActionRow] = item.itemId; 3820 - firstMenuOperand[menuActionRow] = l; 3821 - secondMenuOperand[menuActionRow] = i1; 3841 + firstMenuOperand[menuActionRow] = x; 3842 + secondMenuOperand[menuActionRow] = y; 3822 3843 menuActionRow++; 3823 3844 } 3824 3845 3825 3846 menuActionTexts[menuActionRow] = "Examine @lre@" + itemDefinition.name; 3826 3847 menuActionTypes[menuActionRow] = 1564; 3827 3848 selectedMenuActions[menuActionRow] = item.itemId; 3828 - firstMenuOperand[menuActionRow] = l; 3829 - secondMenuOperand[menuActionRow] = i1; 3849 + firstMenuOperand[menuActionRow] = x; 3850 + secondMenuOperand[menuActionRow] = y; 3830 3851 menuActionRow++; 3831 3852 } 3832 3853 } ··· 4150 4171 x -= 17; 4151 4172 y -= 357; 4152 4173 } 4153 - if (x < menuOffsetX - 10 || x > menuOffsetX + anInt1307 + 10 || y < menuOffsetY - 10 4154 - || y > menuOffsetY + anInt1308 + 10) { 4174 + if (x < menuOffsetX - 10 || x > menuOffsetX + menuWidth + 10 || y < menuOffsetY - 10 4175 + || y > menuOffsetY + menuHeight + 10) { 4155 4176 menuOpen = false; 4156 4177 if (menuScreenArea == 1) 4157 4178 redrawTabArea = true; ··· 4162 4183 if (meta == 1) { 4163 4184 int menuX = menuOffsetX; 4164 4185 int menuY = menuOffsetY; 4165 - int dx = anInt1307; 4186 + int dx = menuWidth; 4166 4187 int x = super.clickX; 4167 4188 int y = super.clickY; 4168 4189 if (menuScreenArea == 0) { ··· 8318 8339 menuScreenArea = 0; 8319 8340 menuOffsetX = x; 8320 8341 menuOffsetY = y; 8321 - anInt1307 = width; 8322 - anInt1308 = height + 1; 8342 + menuWidth = width; 8343 + menuHeight = height + 1; 8323 8344 } 8324 8345 8325 8346 if (super.clickX > 553 && super.clickY > 205 && super.clickX < 743 && super.clickY < 466) { ··· 8341 8362 menuScreenArea = 1; 8342 8363 menuOffsetX = x; 8343 8364 menuOffsetY = y; 8344 - anInt1307 = width; 8345 - anInt1308 = height + 1; 8365 + menuWidth = width; 8366 + menuHeight = height + 1; 8346 8367 } 8347 8368 8348 8369 if (super.clickX > 17 && super.clickY > 357 && super.clickX < 496 && super.clickY < 453) { ··· 8364 8385 menuScreenArea = 2; 8365 8386 menuOffsetX = x; 8366 8387 menuOffsetY = y; 8367 - anInt1307 = width; 8368 - anInt1308 = height + 1; 8388 + menuWidth = width; 8389 + menuHeight = height + 1; 8369 8390 } 8370 8391 } 8371 8392 ··· 10144 10165 private void drawMenu() { 10145 10166 int offsetX = menuOffsetX; 10146 10167 int offsetY = menuOffsetY; 10147 - int width = anInt1307; 10148 - int height = anInt1308; 10168 + int width = menuWidth; 10169 + int height = menuHeight; 10149 10170 int colour = 0x5d5447; 10150 10171 Rasterizer.drawFilledRectangle(offsetX, offsetY, width, height, colour); 10151 10172 Rasterizer.drawFilledRectangle(offsetX + 1, offsetY + 1, width - 2, 16, 0);
+2 -11
src/main/java/com/jagex/runescape/cache/media/TypeFace.java
··· 122 122 } 123 123 124 124 public int getStringEffectWidth(String string) { 125 - if (string == null) 126 - return 0; 127 - int width = 0; 128 - for (int character = 0; character < string.length(); character++) 129 - if (string.charAt(character) == '@' && character + 4 < string.length() && string.charAt(character + 4) == '@') 130 - character += 4; 131 - else 132 - width += characterScreenWidths[string.charAt(character)]; 133 - 134 - return width; 125 + return getDisplayedWidth(string); 135 126 } 136 127 137 128 public final int getDisplayedWidth(String string) { ··· 349 340 if (code.equals("yel")) 350 341 return 0xffff00; 351 342 if (code.equals("cya")) 352 - return 65535; 343 + return 0x00ffff; 353 344 if (code.equals("mag")) 354 345 return 0xff00ff; 355 346 if (code.equals("whi"))
+6
src/main/java/com/jagex/runescape/config/Configuration.java
··· 35 35 PASSWORD = (String) login.get("password"); 36 36 ROOFS_ENABLED = (boolean) game.get("roofsEnabled"); 37 37 FREE_TELEPORTS = (boolean) game.get("freeTeleports"); 38 + DEBUG_CONTEXT = (boolean) game.get("debugContextMenu"); 38 39 39 40 if(USERNAME == null) { 40 41 USERNAME = ""; ··· 120 121 * Always light up teleports 121 122 */ 122 123 public static boolean FREE_TELEPORTS = true; 124 + 125 + /** 126 + * When rightclicking objects show id and location 127 + */ 128 + public static boolean DEBUG_CONTEXT = true; 123 129 124 130 125 131 }