Guest User

JadHelper

a guest
Aug 9th, 2013
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.41 KB | None | 0 0
  1. package scripts;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Font;
  5. import java.awt.Graphics;
  6. import org.tribot.api2007.types.RSNPC;
  7. import org.tribot.api2007.NPCs;
  8. import org.tribot.script.Script;
  9. import org.tribot.script.ScriptManifest;
  10. import org.tribot.script.interfaces.Painting;
  11.  
  12. @ScriptManifest(authors={"RuniteRocks"}, category="Tools", name="JadHelper", description="Shows what attack Jad is using and what prayers you need to use.", version=0.1)
  13. public class JadHelper extends Script
  14. implements Painting
  15. {
  16.     private String version = "v0.1";
  17.     private final Color color = new Color(255, 255, 255);
  18.     private final Font font = new Font("Verdana", 0, 12);
  19.     private String attackStyle = "";
  20.  
  21.     public void run()
  22.     {
  23.         println("You're currently running " + this.version + "!");
  24.         while (loop() > 0)
  25.             loop();
  26.     }
  27.  
  28.     public int loop()
  29.     {
  30.         NPCs.getAll();
  31.         RSNPC[] jad = NPCs.findNearest(2745);
  32.         if (jad.length > 0) {
  33.             for (RSNPC npc : jad) {
  34.                 if(npc.getAnimation() == 2652) {
  35.                     this.attackStyle = "Range";
  36.                 } else if(npc.getAnimation() == 2656) {
  37.                     this.attackStyle = "Mage";
  38.                 } else if(npc.getAnimation() == 2655) {
  39.                     this.attackStyle = "Melee";
  40.                 } else {
  41.                     this.attackStyle = "";
  42.                 }
  43.             }
  44.         }
  45.         return 1;
  46.     }
  47.  
  48.     public void onPaint(Graphics g)
  49.     {
  50.         g.setFont(this.font);
  51.         g.setColor(this.color);
  52.         g.drawString("Jad Is Using: "+this.attackStyle, 592, 431);
  53.     }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment