Advertisement
asciicat

zzdbe 0.60

May 26th, 2011
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.37 KB | None | 0 0
  1. import java.awt.*;
  2. import org.rsbot.script.Script;
  3. import org.rsbot.script.ScriptManifest;
  4. import org.rsbot.script.methods.Game;
  5. import org.rsbot.script.methods.Magic;
  6.  
  7. @ScriptManifest
  8. (authors = { "asciicat" },
  9.         name = "zzDiamondBoltEnchanter",
  10.         version = 0.60, keywords = { "zzDiamondBoltEnchanter" },
  11.         description = "Enchants Diamond Bolts, improved antiban, paint coming soon")
  12.  
  13. public class zzDiamondBoltEnchanter extends Script
  14. {  
  15.     int dbolts=9340;
  16.     int cosmicrune=564;
  17.     int lawrune=563;
  18.  
  19.     public int expGained = 0;
  20.     int maagic = 6;
  21.     public int startExp = skills.getCurrentExp(maagic);
  22.    
  23.     int spell=Magic.SPELL_ENCHANT_CROSSBOW_BOLT;
  24.    
  25.     private final Font font1 = new Font("Arial", 0, 9);
  26.     private final Font font2 = new Font("Arial", 0, 16);
  27.     private final Font font3 = new Font("Arial", 0, 9);
  28.  
  29.     private final Color color1 = new Color(255, 255, 0, 141);
  30.     private final Color color2 = new Color(51, 0, 51);
  31.     private final Color color3 = new Color(0, 0, 0);
  32.    
  33.     private final BasicStroke stroke1 = new BasicStroke(1);
  34.  
  35.     public long startTime = 0;
  36.     public long millis = 0;
  37.     public long hours = 0;
  38.     public long minutes = 0;
  39.     public long seconds = 0;
  40.     public long last = 0;
  41.    
  42.     public void onRepaint(Graphics g1)
  43.     {
  44.         Graphics2D g = (Graphics2D)g1;
  45.         expGained = skills.getCurrentExp(maagic) - startExp;
  46.         millis = System.currentTimeMillis() - startTime;
  47.         hours = millis / (1000 * 60 * 60);
  48.         millis -= hours * (1000 * 60 * 60);
  49.         minutes = millis / (1000 * 60);
  50.         millis -= minutes * (1000 * 60);
  51.         seconds = millis / 1000;
  52.         g.setColor(color1);
  53.         g.fillRect(291, 287, 225, 50);
  54.         g.setColor(color2);
  55.         g.setStroke(stroke1);
  56.         g.drawRect(291, 287, 225, 50);
  57.         g.setFont(font1);
  58.         g.setFont(font3);
  59.         g.setColor(color3);
  60.         g.drawString("Time Running: " + hours +":"+ minutes + ":" + seconds, 294, 314);
  61.         g.drawString("Experience Gained: " + expGained, 294, 324);
  62.         g.setFont(font2);
  63.        
  64.         g.drawString("zzDiamondBoltEnchanter 0.57", 294, 302);
  65.     }
  66.  
  67.     public boolean onStart()
  68.     {
  69.         startExp = skills.getCurrentExp(maagic);
  70.         log("started, initialized GUI");
  71.         startTime = System.currentTimeMillis();
  72.         return true;
  73.     }
  74.  
  75.     public void onFinish()
  76.     {
  77.         log("finshed?");
  78.         stopScript();
  79.     }
  80.  
  81.     @Override
  82.     public int loop()
  83.     {
  84.         if(getMyPlayer().getAnimation()==-1)
  85.         {
  86.             if(!inventory.contains(dbolts) || !inventory.contains(lawrune) || !inventory.contains(cosmicrune))
  87.             {
  88.                 log("ran out of bolts/runes");
  89.                 stopScript();
  90.             }
  91.             mouse.setSpeed(random(6,7));
  92.             magic.castSpell(spell);
  93.             sleep(123,345);
  94.             mouse.move(random(200,300),random(200,300));
  95.             sleep(1224,1380);
  96.             int enchrng = random(1,28);
  97.             int rngprq = random(1,3);
  98.             if(enchrng==5)
  99.             {
  100.                 mouse.click(220,220,8,8,false);
  101.                 sleep(222,333);
  102.                 if(rngprq==1)
  103.                 {
  104.                     mouse.move(200,180,10,40);
  105.                 }
  106.                 else
  107.                 {
  108.                     mouse.move(280,280,10,10);
  109.                 }
  110.             }
  111.             else if(enchrng==25)
  112.             {
  113.                 mouse.click(280,280,10,10,false);
  114.                 sleep(280,380);
  115.                 if(rngprq==1)
  116.                 {
  117.                     mouse.move(200,180,10,40);
  118.                 }
  119.                 else
  120.                 {
  121.                     mouse.move(280,280,10,10);
  122.                 }
  123.             }
  124.             else
  125.             {
  126.                 mouse.click(250,250,15,15,false);
  127.             }
  128.             menu.doAction("Enchant 10");
  129.             if(menu.isOpen()==true) //failsafe, if misclicked
  130.             {
  131.                 menu.doAction("Enchant 10");
  132.             }
  133.             antiban();
  134.             game.openTab(Game.TAB_MAGIC);
  135.             mouse.move(600,250,100,50);
  136.             }
  137.             else
  138.             {
  139.                 sleep(200);
  140.             }
  141.         return 0;
  142.         }
  143.  
  144.    
  145.     public void antiban()
  146.     {
  147.         log("initiated antiban");
  148.         int r=random(1,44);
  149.         if(r==1)
  150.         {
  151.             sleep(1000,2000);
  152.             mouse.moveOffScreen();
  153.             sleep(280,1337);
  154.             mouse.move(380,260,300,200);
  155.             sleep(333,942);
  156.             mouse.moveSlightly();
  157.             sleep(77,177);
  158.             camera.setNorth();
  159.         }
  160.         else if(r==2)
  161.         {
  162.             mouse.moveSlightly();
  163.             sleep(480,555);
  164.             mouse.moveSlightly();
  165.             sleep(1111,1333);
  166.             camera.setNorth();
  167.         }
  168.         else if(r==3)
  169.         {
  170.             sleep(333,2667);
  171.             camera.setNorth();
  172.         }
  173.         else if(r==4)
  174.         {
  175.             mouse.move(730,190,30,56);
  176.             sleep(444,666);
  177.             mouse.moveSlightly();
  178.         }
  179.         else if(r==5)
  180.         {
  181.             camera.setNorth();
  182.             sleep(11,77);
  183.             mouse.move(380,260,300,200);
  184.             mouse.moveOffScreen();
  185.             sleep(1111,2323);
  186.         }
  187.         else if(r==6)
  188.         {
  189.             mouse.moveSlightly();
  190.             sleep(77,177);
  191.             camera.setAngle(random(10,25));
  192.             sleep(1111,2222);
  193.             camera.setNorth();
  194.         }
  195.         else if(r==7)
  196.         {
  197.             sleep(666,1667);
  198.             camera.setNorth();
  199.             sleep(1080,1234);
  200.             mouse.moveOffScreen();
  201.         }
  202.         else if(r==8)
  203.         {
  204.             sleep(666,1667);
  205.             mouse.setSpeed(random(2,6));
  206.             mouse.move(380,260,300,200);
  207.             sleep(111,177);
  208.             camera.setAngle(random(0,360));
  209.             sleep(166,199);
  210.             camera.setAngle(random(0,4));
  211.             camera.setNorth();
  212.             mouse.move(380,260,300,200);
  213.         }
  214.         else if(r==9)
  215.         {
  216.             sleep(666,1667);
  217.             mouse.move(380,260,300,200);
  218.             sleep(111,177);
  219.             mouse.move(380,260,300,200);
  220.             camera.setNorth();
  221.         }
  222.         else if(r>=11)
  223.         {
  224.             sleep(666,1667);
  225.             mouse.setSpeed(random(7,8));
  226.             mouse.move(380,260,300,200);
  227.             mouse.moveSlightly();
  228.             sleep(88,124);
  229.             mouse.moveSlightly();
  230.         }
  231.         else
  232.         {
  233.             sleep(4444,5555);
  234.             mouse.moveSlightly();
  235.             sleep(6666,7777);
  236.         }
  237.         log("done with semi-good antiban");
  238.     }
  239. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement