Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts;
- import org.tribot.api.General;
- import org.tribot.api2007.NPCs;
- import org.tribot.api2007.types.RSModel;
- import org.tribot.api2007.types.RSNPC;
- import org.tribot.script.Script;
- import org.tribot.script.ScriptManifest;
- @ScriptManifest(authors = "IceKontroI", category = "@ Util", name = "Goblin Model Loader", version = 0.01, description = "Loads all goblins in the surrounding area, then processes the RSModel for each, printing relevant data to the client debug.")
- public class Tester extends Script {
- @Override
- public void run() {
- setLoginBotState(false);
- long init = System.currentTimeMillis();
- RSNPC[] goblins = NPCs.find("Goblin");
- General.println("Took " + (System.currentTimeMillis() - init) + " MS to find " + goblins.length + " goblins");
- RSModel[] models = new RSModel[goblins.length];
- long[] times = new long[goblins.length];
- long sum = 0;
- init = System.currentTimeMillis();
- for (int i = 0; i < goblins.length; i++) {
- long start = System.currentTimeMillis();
- models[i] = goblins[i].getModel();
- times[i] = System.currentTimeMillis() - start;
- sum += times[i];
- }
- General.println("Average time: " + Math.round((double) sum / times.length) + " MS x " + times.length + " goblins");
- double time = Math.round(System.currentTimeMillis() - init);
- General.println("Total model processing time: " + time + " MS (" + time / 1000 + " seconds)");
- }
- }
Add Comment
Please, Sign In to add comment