Advertisement
asciicat

zzdbe 0.65

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