Code:
package com.client.interface.osm;
import com.client.ItemDef;
import com.client.EntityDef;
import com.client.ObjectDef;
/**
* @Author XScapeRSPS
* This is a small class which reloads entity, item, and object definitions granting the player visible ID's by means of hovering.
*
* Note: You must place new ActiveHoverID(); somewhere it will only load once after all entities items and object definitions have loaded.
* Note: You may need to correct imports or fix the @variable's listed below.
*/
public class ActivateHoverID {
public ActivateHoverID() {
onLoad();
}
/**
* @variable EntityDef.streamIndices.length - think of this as npc_count in my client. Yours may be named differently.
* You should be able to find a similar variable at EntityDef.forID(i);
* @see EntityDef
*
* @varaible ItemDef.totalItems - Same as above except applicable to items. You can find this in the same place to except in ItemDef.java
* @see ItemDef
*
* @varaible ObjectDef.streamIndices.length - Same as above except applicable to items. You can find this in the same place to except in ObjectDef.java
* @see ObjectDef
*
* Note: If for whatever reason you just can't get these variables to work change the variables to a number, 30_000 is usually high enough, and enclose
* each for statement in a try-catch block with no print statement. This should be fine since you are only loading it once and you won't even login
* before the processing completes.
*/
private void onLoad() {
final int entityCount = EntityDef.streamIndices.length;
for (int i = 0; i < entityCount; i++) {
final EntityDef entityDef = EntityDef.forID(i);
if(entityDef != null)
entityDef.name += parentheticalWrap(i);
}
for (int i = 0; i < ItemDef.totalItems; i++) {
final ItemDef itemDef = ItemDef.forID(i);
if (itemDef != null)
itemDef.name += parentheticalWrap(i);
}
final int objectCount = ObjectDef.streamIndices.length;
for (int i = 0; i < objectCount; i++) {
final ObjectDef objectDef = ObjectDef.forID(i);
if (objectDef != null)
objectDef.name += parentheticalWrap(i);
}
}
/** Adds coloring and parenthesis. **/
private String parentheticalWrap(int id) {
return " @whi@(@gre@" + id + "@whi@)";
}
}