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:
Extremely simple script, but it has proven to be extremely useful as well.
Enjoy.
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;
}
}