Guest User

Untitled

a guest
Jul 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. import java.awt.Point;
  2. import java.util.Map;
  3.  
  4. import org.rsbot.script.Script;
  5. import org.rsbot.script.ScriptManifest;
  6. import org.rsbot.script.wrappers.RSNPC;
  7. import org.rsbot.script.wrappers.RSTile;
  8.  
  9.  
  10.  
  11. @ScriptManifest(name = "CrispysMordred", authors = { "CrispyToast" }, category = "Combat", description = " Start script upstairs in mordreds castle. <b>Please note: This script does not handle banking and food.</b> I highly suggest using this on combat levels 80 and higher. " )
  12. public class CrispysMordred extends Script{
  13. public int Mordred = 247; //doesnt matter what we name it:poh
  14.  
  15. public boolean onStart(final Map<String, String> args) {
  16. return true;
  17. }
  18. public void onFinish() {
  19.  
  20.  
  21. }
  22.  
  23. public void attack(RSNPC npc){
  24.  
  25. RSTile npcloc = npc.getLocation();
  26. RSTile npccord = (new RSTile(npcloc.getX(), npcloc.getY()));
  27. if(getMyPlayer().getAnimation()==11968){
  28. wait(random(1000,2000));
  29. }
  30. if(distanceTo(npccord)>3){
  31. walkTileMM(npccord);
  32. }
  33. if(distanceTo(npccord)<3){
  34. Point p = npc.getScreenLocation();
  35. moveMouse(p,2,2);
  36. if(getMyPlayer().getAnimation()==-1){
  37. clickMouse(true);
  38. }
  39. }
  40.  
  41.  
  42. }
  43.  
  44. public int loop() {
  45.  
  46. if (getMyPlayer().isInCombat()) {
  47. return 500;
  48. }
  49.  
  50. RSNPC mordred = getNearestNPCByID(Mordred);
  51. attack(mordred);
  52.  
  53. return 10;
  54. }
  55. }
Add Comment
Please, Sign In to add comment