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.

anInt1173 -> selectedMask, and some others

+45 -47
+45 -47
src/main/java/com/jagex/runescape/Game.java
··· 395 395 private int loginScreenUpdateTime; 396 396 private int widgetSelected; 397 397 private int anInt1172; 398 - private int anInt1173; 398 + private int selectedMask; 399 399 private String selectedWidgetName; 400 400 private int[] anIntArray1176; 401 401 private int[] anIntArray1177; ··· 3416 3416 } 3417 3417 } 3418 3418 3419 - private void processPLayerMenuOptions(int i, int j, int k, Player player) { 3419 + private void processPlayerMenuOptions(Player player, int x, int y, int index) { 3420 3420 if (player == localPlayer) 3421 3421 return; 3422 3422 if (menuActionRow >= 400) ··· 3431 3431 if (itemSelected == 1) { 3432 3432 menuActionTexts[menuActionRow] = "Use " + selectedItemName + " with @whi@" + s; 3433 3433 menuActionTypes[menuActionRow] = 596; 3434 - selectedMenuActions[menuActionRow] = i; 3435 - firstMenuOperand[menuActionRow] = k; 3436 - secondMenuOperand[menuActionRow] = j; 3434 + selectedMenuActions[menuActionRow] = index; 3435 + firstMenuOperand[menuActionRow] = x; 3436 + secondMenuOperand[menuActionRow] = y; 3437 3437 menuActionRow++; 3438 3438 } else if (widgetSelected == 1) { 3439 - if ((anInt1173 & 8) == 8) { 3439 + if ((selectedMask & 8) == 8) { 3440 3440 menuActionTexts[menuActionRow] = selectedWidgetName + " @whi@" + s; 3441 3441 menuActionTypes[menuActionRow] = 918; 3442 - selectedMenuActions[menuActionRow] = i; 3443 - firstMenuOperand[menuActionRow] = k; 3444 - secondMenuOperand[menuActionRow] = j; 3442 + selectedMenuActions[menuActionRow] = index; 3443 + firstMenuOperand[menuActionRow] = x; 3444 + secondMenuOperand[menuActionRow] = y; 3445 3445 menuActionRow++; 3446 3446 } 3447 3447 } else { ··· 3469 3469 menuActionTypes[menuActionRow] = 677 + c; 3470 3470 if (i1 == 4) 3471 3471 menuActionTypes[menuActionRow] = 876 + c; 3472 - selectedMenuActions[menuActionRow] = i; 3473 - firstMenuOperand[menuActionRow] = k; 3474 - secondMenuOperand[menuActionRow] = j; 3472 + selectedMenuActions[menuActionRow] = index; 3473 + firstMenuOperand[menuActionRow] = x; 3474 + secondMenuOperand[menuActionRow] = y; 3475 3475 menuActionRow++; 3476 3476 } 3477 3477 ··· 3642 3642 } 3643 3643 } 3644 3644 3645 - private void method43(byte byte0) { 3645 + private void handleViewportMouse() { 3646 3646 if (itemSelected == 0 && widgetSelected == 0) { 3647 3647 menuActionTexts[menuActionRow] = "Walk here"; 3648 3648 menuActionTypes[menuActionRow] = 14; ··· 3650 3650 secondMenuOperand[menuActionRow] = super.mouseY; 3651 3651 menuActionRow++; 3652 3652 } 3653 - int i = -1; 3654 - if (byte0 != 7) 3655 - opcode = -1; 3656 - for (int j = 0; j < Model.resourceCount; j++) { 3657 - int k = Model.anIntArray1709[j]; 3658 - int x = k & 0x7f; 3659 - int y = k >> 7 & 0x7f; 3660 - int type = k >> 29 & 3; 3661 - int k1 = k >> 14 & 0x7fff; 3662 - if (k == i) 3653 + int lastHash = -1; 3654 + for (int idx = 0; idx < Model.resourceCount; idx++) { 3655 + int hash = Model.hoveredHash[idx]; 3656 + int x = hash & 0x7f; 3657 + int y = hash >> 7 & 0x7f; 3658 + int type = hash >> 29 & 3; 3659 + int index = hash >> 14 & 0x7fff; 3660 + if (hash == lastHash) 3663 3661 continue; 3664 - i = k; 3665 - if (type == 2 && currentScene.method271(plane, x, y, k) >= 0) { 3666 - GameObjectDefinition gameObject = GameObjectDefinition.getDefinition(k1); 3662 + lastHash = hash; 3663 + if (type == 2 && currentScene.getArrangement(plane, x, y, hash) >= 0) { 3664 + GameObjectDefinition gameObject = GameObjectDefinition.getDefinition(index); 3667 3665 if (gameObject.childrenIds != null) 3668 3666 gameObject = gameObject.getChildDefinition(); 3669 3667 if (gameObject == null) ··· 3671 3669 if (itemSelected == 1) { 3672 3670 menuActionTexts[menuActionRow] = "Use " + selectedItemName + " with @cya@" + gameObject.name; 3673 3671 menuActionTypes[menuActionRow] = 467; 3674 - selectedMenuActions[menuActionRow] = k; 3672 + selectedMenuActions[menuActionRow] = hash; 3675 3673 firstMenuOperand[menuActionRow] = x; 3676 3674 secondMenuOperand[menuActionRow] = y; 3677 3675 menuActionRow++; 3678 3676 } else if (widgetSelected == 1) { 3679 - if ((anInt1173 & 4) == 4) { 3677 + if ((selectedMask & 4) == 4) { 3680 3678 menuActionTexts[menuActionRow] = selectedWidgetName + " @cya@" + gameObject.name; 3681 3679 menuActionTypes[menuActionRow] = 376; 3682 - selectedMenuActions[menuActionRow] = k; 3680 + selectedMenuActions[menuActionRow] = hash; 3683 3681 firstMenuOperand[menuActionRow] = x; 3684 3682 secondMenuOperand[menuActionRow] = y; 3685 3683 menuActionRow++; ··· 3700 3698 menuActionTypes[menuActionRow] = 892; // packet 136 3701 3699 if (l1 == 4) 3702 3700 menuActionTypes[menuActionRow] = 1280; // packet 55 3703 - selectedMenuActions[menuActionRow] = k; 3701 + selectedMenuActions[menuActionRow] = hash; 3704 3702 firstMenuOperand[menuActionRow] = x; 3705 3703 secondMenuOperand[menuActionRow] = y; 3706 3704 menuActionRow++; ··· 3736 3734 } 3737 3735 } 3738 3736 if (type == 1) { 3739 - Npc npc = npcs[k1]; 3737 + Npc npc = npcs[index]; 3740 3738 if (npc.npcDefinition.boundaryDimension == 1 3741 3739 && (npc.worldX & 0x7f) == 64 3742 3740 && (npc.worldY & 0x7f) == 64) { ··· 3755 3753 if (player != null 3756 3754 && player.worldX == npc.worldX 3757 3755 && player.worldY == npc.worldY) 3758 - processPLayerMenuOptions(playerList[i2], y, x, player); 3756 + processPlayerMenuOptions(player, x, y, playerList[i2]); 3759 3757 } 3760 3758 3761 3759 } 3762 - processNpcMenuOptions(npc.npcDefinition, y, x, k1); 3760 + processNpcMenuOptions(npc.npcDefinition, y, x, index); 3763 3761 } 3764 3762 if (type == 0) { 3765 - Player player1 = players[k1]; 3763 + Player player1 = players[index]; 3766 3764 if ((player1.worldX & 0x7f) == 64 3767 3765 && (player1.worldY & 0x7f) == 64) { 3768 3766 for (int j2 = 0; j2 < npcCount; j2++) { ··· 3780 3778 && player != player1 3781 3779 && player.worldX == player1.worldX 3782 3780 && player.worldY == player1.worldY) 3783 - processPLayerMenuOptions(playerList[l2], y, x, player); 3781 + processPlayerMenuOptions(player, x, y, playerList[l2]); 3784 3782 } 3785 3783 3786 3784 } 3787 - processPLayerMenuOptions(k1, y, x, player1); 3785 + processPlayerMenuOptions(player1, x, y, index); 3788 3786 } 3789 3787 if (type == 3) { 3790 3788 LinkedList itemList = groundItems.getTile(plane, x, y); ··· 3800 3798 secondMenuOperand[menuActionRow] = y; 3801 3799 menuActionRow++; 3802 3800 } else if (widgetSelected == 1) { 3803 - if ((anInt1173 & 1) == 1) { 3801 + if ((selectedMask & 1) == 1) { 3804 3802 menuActionTexts[menuActionRow] = selectedWidgetName + " @lre@" + itemDefinition.name; 3805 3803 menuActionTypes[menuActionRow] = 199; 3806 3804 selectedMenuActions[menuActionRow] = item.itemId; ··· 3878 3876 if (classType == 3) 3879 3877 locationHash = currentScene.getFloorDecorationHash(plane, x, y); 3880 3878 if (locationHash != 0) { 3881 - int locationArrangement = currentScene.method271(plane, x, y, locationHash); 3879 + int locationArrangement = currentScene.getArrangement(plane, x, y, locationHash); 3882 3880 int locationIndex = locationHash >> 14 & 0x7fff; 3883 3881 int locationType = locationArrangement & 0x1f; 3884 3882 int locationRot = locationArrangement >> 6; ··· 5480 5478 menuActionRow++; 5481 5479 } 5482 5480 } else if (widgetSelected == 1 && child.isInventory) { 5483 - if ((anInt1173 & 0x10) == 16) { 5481 + if ((selectedMask & 0x10) == 16) { 5484 5482 menuActionTexts[menuActionRow] = selectedWidgetName + " @lre@" + definition.name; 5485 5483 menuActionTypes[menuActionRow] = 361; 5486 5484 selectedMenuActions[menuActionRow] = definition.id; ··· 6694 6692 6695 6693 private boolean method80(int dstY, int j, int dstX, int l) { 6696 6694 int i1 = l >> 14 & 0x7fff; 6697 - int j1 = currentScene.method271(plane, dstX, dstY, l); 6695 + int j1 = currentScene.getArrangement(plane, dstX, dstY, l); 6698 6696 if (j1 == -1) 6699 6697 return false; 6700 6698 int objectType = j1 & 0x1f; ··· 6814 6812 return; 6815 6813 } 6816 6814 if (widgetSelected == 1) { 6817 - if ((anInt1173 & 2) == 2) { 6815 + if ((selectedMask & 2) == 2) { 6818 6816 menuActionTexts[menuActionRow] = selectedWidgetName + " @yel@" + name; 6819 6817 menuActionTypes[menuActionRow] = 67; 6820 6818 selectedMenuActions[menuActionRow] = k; ··· 7478 7476 if (openScreenWidgetId != -1) 7479 7477 method66(4, Widget.forId(openScreenWidgetId), 0, 0, 4, super.mouseX, 23658, super.mouseY); 7480 7478 else 7481 - method43((byte) 7); 7479 + handleViewportMouse(); 7482 7480 if (anInt915 != anInt1302) 7483 7481 anInt1302 = anInt915; 7484 7482 if (anInt1315 != anInt1129) ··· 9406 9404 Widget widget = Widget.forId(second); 9407 9405 widgetSelected = 1; 9408 9406 anInt1172 = second; 9409 - anInt1173 = widget.optionAttributes; 9407 + selectedMask = widget.optionAttributes; 9410 9408 itemSelected = 0; 9411 9409 redrawTabArea = true; 9412 9410 String prefix = widget.optionCircumfix; ··· 9416 9414 if (suffix.indexOf(" ") != -1) 9417 9415 suffix = suffix.substring(suffix.indexOf(" ") + 1); 9418 9416 selectedWidgetName = prefix + " " + widget.optionText + " " + suffix; 9419 - if (anInt1173 == 16) { 9417 + if (selectedMask == 16) { 9420 9418 redrawTabArea = true; 9421 9419 currentTabId = 3; 9422 9420 drawTabIcons = true; ··· 10958 10956 if (spawnObjectNode.classType == 3) 10959 10957 i = currentScene.getFloorDecorationHash(spawnObjectNode.plane, spawnObjectNode.x, spawnObjectNode.y); 10960 10958 if (i != 0) { 10961 - int i1 = currentScene.method271(spawnObjectNode.plane, spawnObjectNode.x, spawnObjectNode.y, i); 10959 + int i1 = currentScene.getArrangement(spawnObjectNode.plane, spawnObjectNode.x, spawnObjectNode.y, i); 10962 10960 j = i >> 14 & 0x7fff; 10963 10961 k = i1 & 0x1f; 10964 10962 l = i1 >> 6; ··· 11592 11590 int k1 = currentScene.getWallObjectHash(k, i, j); 11593 11591 i1 = 62 / i1; 11594 11592 if (k1 != 0) { 11595 - int l1 = currentScene.method271(j, k, i, k1); 11593 + int l1 = currentScene.getArrangement(j, k, i, k1); 11596 11594 int k2 = l1 >> 6 & 3; 11597 11595 int i3 = l1 & 0x1f; 11598 11596 int k3 = j1; ··· 11668 11666 } 11669 11667 k1 = currentScene.getLocationHash(j, k, i); 11670 11668 if (k1 != 0) { 11671 - int i2 = currentScene.method271(j, k, i, k1); 11669 + int i2 = currentScene.getArrangement(j, k, i, k1); 11672 11670 int l2 = i2 >> 6 & 3; 11673 11671 int j3 = i2 & 0x1f; 11674 11672 int l3 = k1 >> 14 & 0x7fff;