Advertisement
asciicat

zzdbe 0.76

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