RuneScape Animation Dumper

Incorgnito

Banned
Joined
Oct 8, 2007
Messages
978
Points
16
If you have experience with the RuneScape client, then you know that the walk and stand animations are stored inside of the cache, and can easily be dumped. But... What if you want attack, block, death anims? These must be fetched from RuneScape itself.

What I am presenting to you today is an RSBot script that will log the animations of surrounding NPCs into a text file. It only records animations other than walking and standing.

Example Output:
Code:
Goblin (12359)
 - 6184
 - 6183
 - 6182

Magic instructor (4707)
 - 9976

Chicken (1017)
 - 5388
 - 5389

Goblin (12355)
 - 6182

Giant spider (12352)
 - 5328
 - 5329

Lumbridge guard (12367)
 - 1156
 - 12310
 - 1194

Chicken (41)
 - 5388
 - 5389
 - 5387

Extremely simple script, but it has proven to be extremely useful as well.

Enjoy.

Code:
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;

import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.wrappers.RSNPC;

@ScriptManifest(authors={"Zaga"}, keywords={"RSPS", "NPC", "Animation", "Dumper"}, name="NPC Animation Dumper", description="Dumps animation data from RuneScape NPCs!", version=1.0)
public class AnimDumper extends Script {
	 
	public HashMap<Integer, NPCCacheHolder> NPCCache = new HashMap<Integer, NPCCacheHolder>();
	 
	public boolean onStart() {
		return true;
	}
     
	public void onFinish() {
		int totalNPCs = NPCCache.size();
		int totalAnims = 0;
		try {
			PrintWriter out = new PrintWriter(new FileOutputStream("./output.txt"));
			for (NPCCacheHolder npc : NPCCache.values()) {
				totalAnims += npc.anims.size();
				out.println(npc.NPCName+" ("+npc.NPCID+")");
				for (int i = 0; i < npc.anims.size(); i++) {
					out.println(" - "+npc.anims.get(i));
				}
				out.println("");
			}
			out.close();
		} catch (IOException e) {
			log(e.getMessage());
		}
		log(totalAnims+" animations found over "+totalNPCs+" NPCs");	 
	}

	public int loop() {
		RSNPC[] NPCs = npcs.getAll();
		for (RSNPC npc : NPCs) {
			if (npc.getAnimation() != -1) {
				if (!NPCCache.containsKey(npc.getID())) {
					NPCCache.put(npc.getID(), new NPCCacheHolder(npc.getID(), npc.getName()));
					log(npc.getName()+" ("+npc.getID()+") Added! Total NPCs added: "+NPCCache.size());
				}
				if (!NPCCache.get(npc.getID()).anims.contains(npc.getAnimation()))
					NPCCache.get(npc.getID()).anims.add(npc.getAnimation());
			}
		}
		return 400;
	}
}

class NPCCacheHolder {
	
	public int NPCID;
	public String NPCName;
	public ArrayList<Integer> anims = new ArrayList<Integer>();
	
	public NPCCacheHolder(int ID, String name) {
		this.NPCID = ID;
		this.NPCName = name;
	}
}
 
Warriors' Guild Cyclopes

Code:
Cyclops (6080)
 - 4652
 - 4653
 - 4651

Cyclops (6081)
 - 4652
 - 4651
 - 4653

Cyclops (4292)
 - 4652
 - 4653
 - 4651

Cyclops (6079)
 - 4652
 - 4653
 - 4651

Cyclops (6078)
 - 4652
 - 4653
 - 4651

Cyclops (4291)
 - 4652
 - 4653
 - 4651
 
Holy tits. I'm just learning how to code java. I just learned about ****ing strings and stuff. God dayum
 
The attack, block and defend emote are always withing a few digits of the stand/walk emote. It could be useful in some cases but personally I'd rather just guess a few numbers so I don't have to spend time looking for NPC's on runescape.
 
The attack, block and defend emote are always withing a few digits of the stand/walk emote. It could be useful in some cases but personally I'd rather just guess a few numbers so I don't have to spend time looking for NPC's on runescape.

Not always, there are a lot of cases where walk and stand anims are reused for different NPCs (Such as human based NPCs, giant based NPCs, etc).
 
Not always, there are a lot of cases where walk and stand anims are reused for different NPCs (Such as human based NPCs, giant based NPCs, etc).

That is a valid point, but in most cases where an npc is close enough to use the same stand and walk emote it is also close enough to use the same attack and block emote.

I'm sure there would be some npc's that I could not find the emotes for, then this would come in handy.
 
Back
Top