Skip to content

Instantly share code, notes, and snippets.

@Monomode
Monomode / deobfuscator.gradle.kts
Created November 2, 2025 13:47
include the vanilla.jar in the client so that it no longer needs to fetch from the down url
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id("com.github.hauner.jarTest") version "1.0.1"
}
val deobjars = configurations.create("deobjars")
dependencies {
deobjars(group = "net.runelite.rs", name = "vanilla", version = ProjectVersions.rsversion.toString())
public class TabInventory {
static {
InterfaceHandler.register(Interface.INVENTORY, h -> {
h.actions[0] = new InterfaceAction() {
@Override
public void handleClick(Player player, int option, int slot, int itemId) {
click(player, option, slot, itemId);
}
@Override
void script_3178(int arg0, int arg1, Widget widget2, Widget widget3, Widget widget4, Widget widget5, Widget widget6, Widget widget7, int arg8, Widget widget9, Widget widget10, Widget widget11, int arg12, Widget widget13, Widget widget14, Widget widget15, int arg16, Widget widget17, Widget widget18, Widget widget19, int arg20, Widget widget21, Widget widget22, Widget widget23, int arg24, Widget widget25, Widget widget26, Widget widget27, int arg28, Widget widget29, Widget widget30, Widget widget31, int arg32) {
int int33;
int33 = 34;
if (script_3160() == 1 && VARPBIT[10037] >= 3) {
widget6.setNoOptions();
widget6.setIsHidden(true);
if (VARPBIT[8168] == 4) {
VARPBIT[8168] = 1;
}
script_2800(arg8, widget9, widget10, widget11, arg12, widget13, widget14, widget15, arg16, widget17, widget18, widget19, arg20, widget21, widget22, widget23, arg24, widget25, widget26, widget27, arg28, widget29, widget30, widget31);
/**
* Leaderboard Hiscores
*/
public static List<Player> loadOfflinePlayers() {
List<Player> offlinePlayers = new ArrayList<>();
File folder = new File(OfflineMode.path + "/players");
if (!folder.exists() || !folder.isDirectory()) {
System.err.println("No offline players found.");
return offlinePlayers;
@Monomode
Monomode / Tournament.kt
Created May 4, 2024 12:33
Example of exit method for Tournament written in Kotlin
private fun Player.normalize() {
tournamentFight = null
tournament = null
logoutListener = null
teleportListener = null
attackPlayerListener = null
deathEndListener = null
activatePrayerListener = null
combat.resetKillers()
clearHintArrow()
@Monomode
Monomode / DeadmanRaidManager.java
Created December 16, 2023 04:53
The class manages the Deadman Bank Key Interface for players, handling actions such as opening chests, withdrawing items, and updating the player.
package io.ruin.model.activities.deadman;
import io.ruin.api.utils.NumberUtils;
import io.ruin.model.combat.KillingSpree;
import io.ruin.model.entity.player.GameMode;
import io.ruin.model.entity.player.Player;
import io.ruin.model.inter.Interface;
import io.ruin.model.inter.InterfaceHandler;
import io.ruin.model.inter.InterfaceType;
import io.ruin.model.inter.actions.SimpleAction;
@Monomode
Monomode / LootTable.java
Last active November 23, 2023 02:14
(Kronos) modification to rollItems in LootTable.java; attempting to replicate 2006Scape drop system where we can directly represent the item's drop rate in the .json, for example "weight": 32, would mean 1 in 32.
public List<Item> rollItems(boolean allowGuaranteed) {
List<Item> items;
if (allowGuaranteed && guaranteed != null) {
items = new ArrayList<>(guaranteed.length + 1);
for (LootItem item : guaranteed)
items.add(item.toItem());
} else {
items = new ArrayList<>(1);
}
if (tables != null) {
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@Monomode
Monomode / NPC.java
Created June 9, 2023 13:20
Gargoyle(412) respawning as T-pose id#413 and not requiring rock hammer
private boolean setCombat() {
NPCDef def = getDef();
if(def.combatInfo == null) {
/* not a combat npc */
System.out.println("Uninitialized combat because: if(def.combatInfo == null)");
return false;
}
if(def.combatHandlerClass != null) {
try {
combat = def.combatHandlerClass.newInstance().init(this, def.combatInfo);
static {
/**
* Lumbridge Gate / Al-Kharid Toll
*/
final int[] BARRIER = {2882, 2883};
for (int barriers : BARRIER) {
ObjectAction.register(barriers, "open", (player, obj) -> {
boolean atObjX = obj.x == player.getAbsX();
boolean atObjY = obj.y == player.getAbsY();