Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.wrappers.RSItem;
- import java.awt.*;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- @ScriptManifest(
- name = "DommsBoneBury",
- authors = "Domm-rsbot",
- keywords = "",
- version = 1.3,
- description = "Burys bones and banks")
- public class DommsBoneBury extends Script implements PaintListener, MessageListener {
- public int startLevel;
- public int currLevel;
- public int lvlsGained;
- private int percentTNL;
- public int MonkeyBones = 528;
- public int BigBones = 532;
- public int NormalBone = 526;
- public int BonesBuried = 0;
- public int BabyDragonBones = 534;
- public int DragonBones = 536;
- public int DagannothBones = 6729;
- public int FrostDragonBones = 18832;
- private final Color color1 = new Color(0, 255, 51, 158);
- private final Color color5 = new Color(255, 0, 51);
- private final Color color6 = new Color(0, 0, 0);
- private final Color color7 = new Color(0, 255, 0);
- private final Color color8 = new Color(0, 255, 51);
- private final BasicStroke stroke2 = new BasicStroke(2);
- public int BonesToBury;
- ///////////////////////// BONES TO NEXT LEVEL WTF FIX!
- public int NormalBoneEXP = (int) 4.5;
- public int bonesTill;
- int boneXP;
- ///////////////////////BONES TO NEXT LEVEL WTF FIX!
- public long startTime = System.currentTimeMillis();
- private final Color color2 = new Color(0, 0, 0);
- private final Font font1 = new Font("Consolas", 1, 15);
- private final Font font2 = new Font("Arial", 1, 11);
- public int expGained = 0;
- private String status = "Loading..";
- public int startExp = 0;
- public int BurysHour = 0;
- private boolean guiWait = true;
- Gui g = new Gui();
- public boolean onStart(){
- startLevel = skills.getCurrentLevel(Skills.PRAYER);
- startExp = skills.getCurrentExp(Skills.PRAYER);
- g.setVisible(true);
- while(guiWait) sleep (500);
- return true;
- }
- @Override
- public int loop(){
- if(inventory.containsOneOf(BonesToBury)){
- Bury();
- }else if(!inventory.containsOneOf(BonesToBury)){
- Bank();
- }
- return 200;
- }
- public void Bank(){
- status = "Banking..";
- if(bank.isOpen()){
- bank.depositAllExcept(BonesToBury);
- bank.withdraw(BonesToBury, 28);
- bank.close();
- }else if(!bank.isOpen()){
- status = "Banking..";
- bank.open();
- bank.depositAllExcept(BonesToBury);
- bank.withdraw(BonesToBury, 28);
- bank.close();
- }
- }
- private void antiban(){
- }
- private void Bury(){
- while (inventory.containsOneOf(BonesToBury)) {
- sleep(random(30, 60));
- mouse.setSpeed(random(10, 15));
- status = "Burying bones";
- inventory.getItem(BonesToBury).doAction("Bury");
- BonesBuried++;
- sleep(random(900, 1250));
- }
- }
- @Override
- public void onRepaint(Graphics g1) {
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- BurysHour = (int) ((BonesBuried) * 3600000D / (System.currentTimeMillis() - startTime));
- bonesTill = (int) (skills.getExpToNextLevel(Skills.PRAYER) / boneXP);
- currLevel = skills.getCurrentLevel(skills.PRAYER);
- lvlsGained = currLevel - startLevel;
- percentTNL = skills.getPercentToNextLevel(skills.PRAYER);
- final int percentBar = (int) (skills.getPercentToNextLevel(skills.PRAYER)*1.75);
- Graphics2D g = (Graphics2D)g1;
- expGained = skills.getCurrentExp(Skills.PRAYER) - startExp;
- g.setColor(color1);
- g.fillRoundRect(4, 6, 243, 173, 16, 16);
- g.setFont(font1);
- g.setColor(color2);
- g.drawString("Domm's Bone Burier!", 15, 32);
- g.setFont(font2);
- g.drawString("Time Running: " + hours + ": " + minutes + ": " + seconds, 14, 55);
- g.drawString("Status:" + status, 13, 74);
- g.drawString("Exp Gained:" + expGained, 10, 91);
- g.drawString("Levels Gained:" + lvlsGained, 125, 91);
- g.drawString("Bones Buried:" + BonesBuried, 10, 108);
- g.drawString("Bury's Per Hour:" + BurysHour, 8, 124);
- g.drawString("Aprox Bury's TNL:" +bonesTill, 8, 143);
- g.setColor(color5);
- g.fillRoundRect(10, 195, 175, 25, 16, 16);
- g.setColor(color6);
- g.setStroke(stroke2);
- g.drawRoundRect(10, 195, 175, 25, 16, 16);
- g.setColor(color7);
- g.fillRoundRect(10, 195, percentBar, 23, 16, 16);
- g.setColor(color8);
- g.drawRoundRect(10, 195, percentBar, 23, 16, 16);
- }
- @Override
- public void messageReceived(MessageEvent e) {
- String x = e.getMessage().toLowerCase();
- if (x.contains("dig a hole in")){
- BonesBuried++;
- }
- } class Gui extends JFrame {
- public Gui() {
- initComponents();
- }
- private void button1ActionPerformed(ActionEvent e) {
- String chosen = BoneSelected.getSelectedItem().toString();
- if(chosen.equals("Big Bones")){
- BonesToBury = BigBones;
- boneXP = 25;
- log ("Command Detected - Burying Big Bones");
- }else if(chosen.equals("Normal Bones")){
- BonesToBury = NormalBone;
- boneXP = 9/2;
- log ("Command Detected - Burying Normal Bones");
- }else if(chosen.equals("Monkey Bones")){
- BonesToBury = MonkeyBones;
- boneXP = 5;
- log ("Command Detected - Burying Monkey Bones");
- }else if(chosen.equals("Dragon Bones")){
- BonesToBury = DragonBones;
- boneXP = 72;
- log ("Command Detected - Burying Dragon Bones");
- }else if(chosen.equals("Baby Dragon Bones")){
- BonesToBury = BabyDragonBones;
- boneXP = 35;
- log ("Command Detected - Baby Dragon Bones");
- }else if(chosen.equals("Dagannoth Bones")){
- BonesToBury = DagannothBones;
- boneXP = 125;
- log ("Command Detected - Burying Dagannoth Bones");
- }else if(chosen.equals("Frost Dragon Bones")){
- BonesToBury = FrostDragonBones;
- boneXP = 180;
- log ("Command Detected - Burying Frost Dragon Bones");
- }
- guiWait = false;
- g.dispose();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- // Generated using JFormDesigner Evaluation license - Dom Das
- label1 = new JLabel();
- label2 = new JLabel();
- BoneSelected = new JComboBox();
- button1 = new JButton();
- //======== this ========
- Container contentPane = getContentPane();
- //---- label1 ----
- label1.setText("Domm's Bone Burier");
- label1.setFont(label1.getFont().deriveFont(label1.getFont().getSize() + 8f));
- //---- label2 ----
- label2.setText("Bones to Bury:");
- label2.setFont(label2.getFont().deriveFont(label2.getFont().getSize() + 4f));
- //---- BoneSelected ----
- BoneSelected.setModel(new DefaultComboBoxModel(new String[] {
- "Big Bones",
- "Monkey Bones",
- "Normal Bones",
- "Baby Dragon Bones",
- "Dragon Bones",
- "Dagannoth Bones",
- "Frost Dragon Bones"
- }));
- //---- button1 ----
- button1.setText("START");
- button1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button1ActionPerformed(e);
- }
- });
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGroup(contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(45, 45, 45)
- .addComponent(label1, GroupLayout.PREFERRED_SIZE, 179, GroupLayout.PREFERRED_SIZE))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label2, GroupLayout.PREFERRED_SIZE, 108, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(BoneSelected, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE)))
- .addContainerGap(30, Short.MAX_VALUE))
- .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
- .addContainerGap(65, Short.MAX_VALUE)
- .addComponent(button1, GroupLayout.PREFERRED_SIZE, 151, GroupLayout.PREFERRED_SIZE)
- .addGap(56, 56, 56))
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addComponent(label1)
- .addGap(18, 18, 18)
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(label2)
- .addComponent(BoneSelected, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 60, Short.MAX_VALUE)
- .addComponent(button1, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- );
- pack();
- setLocationRelativeTo(getOwner());
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- // Generated using JFormDesigner Evaluation license - Dom Das
- private JLabel label1;
- private JLabel label2;
- private JComboBox BoneSelected;
- private JButton button1;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement