Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSComponent;
- import org.rsbot.script.wrappers.RSItem;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import java.awt.event.KeyEvent;
- import java.awt.event.KeyListener;
- import org.rsbot.script.wrappers.*;
- import org.rsbot.script.methods.*;
- import org.rsbot.script.methods.Game.CHAT_MODE;
- @ScriptManifest(
- name = "DommsCutter",
- authors = "Domm-rsbot",
- keywords = "",
- version = 0.3,
- description = "Start with chisel in your Inventory and Near a Bank!")
- public class DommsCutter extends Script implements PaintListener, MessageListener{
- public int expGained = 0;
- public int startExp = 0;
- int chisel = 1755;
- public int Sapphire = 1623;
- int Emerald = 1621;
- int Diamond = 1617;
- int Ruby = 1619;
- int URT = 1629;
- int Animation = 2717;
- public boolean guiWait = true;
- public long startTime = System.currentTimeMillis();
- int GemsCut = 0;
- int GemsSmashed = 0;
- public int CutsHour = 0;
- private String status = "Loading..";
- public int GemXP;
- int GemsTNL;
- int Opal = 1625;
- int Dragonstone = 1631;
- int Jade = 1627;
- int Onyx = 6571;
- gui g = new gui();
- public int GemsToCutA;
- @Override
- public boolean onStart(){
- startExp = skills.getCurrentExp(Skills.CRAFTING);
- g.setVisible(true);
- while(guiWait) sleep (1000);
- return true;
- }
- public void onFinish(){
- env.saveScreenshot(true);
- log ("Saving Screenshot, Please upload Your Proggies :]");
- }
- public int loop(){
- if(inventory.containsOneOf(GemsToCutA) && getMyPlayer().getAnimation() != Animation){
- Cut();
- sleep (500, 1000);
- ok();
- }else{
- if(!inventory.containsOneOf(GemsToCutA)){
- Bank();
- }else{
- if(getMyPlayer().getAnimation() == Animation){
- AntiBan();
- }else{
- if(interfaces.canContinue()){
- interfaces.clickContinue();
- }
- }
- }}
- return 110; }
- private void AntiBan() {
- status = "Anitban";
- int RandomA = random(0, 20);
- if (RandomA == 1)
- camera.setAngle(random(1, 359));
- if(RandomA == 2)
- mouse.move(23, 1);
- if(RandomA == 3)
- camera.setNorth();
- if(RandomA == 4)
- camera.setNorth();
- sleep (200, 1800);
- if(RandomA == 5){
- mouse.moveOffScreen();
- camera.setAngle(random(48, 200));
- }if(RandomA == 6)
- mouse.move(300, 200);
- if(RandomA == 18);
- mouse.moveOffScreen();
- sleep (400, 800);
- if(RandomA == 19);
- mouse.moveOffScreen();
- sleep (400, 1200);
- if(RandomA == 20);
- mouse.moveOffScreen();
- sleep (700, 888);
- }
- private void ok(){
- status = "Clicking Cut All";
- RSComponent temp = interfaces.getComponent(905, 14);
- if (temp != null && temp.isValid()){
- temp.doClick();
- sleep(200, 300);
- }else{
- if(interfaces.canContinue()){
- interfaces.clickContinue();
- }
- }
- }
- private void Cut() {
- status = "Cutting";
- RSItem Gem = inventory.getItem(GemsToCutA);
- if (inventory.getSelectedItem() != null && inventory.getSelectedItem().getID() == GemsToCutA){
- inventory.getItem(1755).doAction("Use ");
- sleep(random(100,200));
- }else{
- if(inventory.getSelectedItem() == null){
- inventory.getItem(GemsToCutA).doAction("Use");
- }
- }
- }
- public void Bank(){
- status = "Banking";
- if(bank.isOpen()){
- bank.depositAllExcept(chisel);
- bank.withdraw(GemsToCutA, 27);
- bank.close();
- }else if(!bank.isOpen()){
- status = "Banking";
- bank.open();
- bank.depositAllExcept(chisel);
- bank.withdraw(GemsToCutA, 27);
- bank.close();
- }
- }
- private final Color color1 = new Color(255, 255, 255);
- private final Color color2 = new Color(51, 255, 51);
- private final Color color3 = new Color(51, 51, 51);
- private final Color color4 = new Color(0, 0, 0);
- private final BasicStroke stroke1 = new BasicStroke(5);
- private final Font font1 = new Font("Arial", 1, 12);
- private final Font font2 = new Font("Arial", 1, 10);
- 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;
- CutsHour = (int) ((GemsCut) * 3600000D / (System.currentTimeMillis() - startTime));
- expGained = skills.getCurrentExp(Skills.CRAFTING) - startExp;
- GemsTNL = skills.getExpToNextLevel(Skills.CRAFTING)/ GemXP;
- Graphics2D g = (Graphics2D)g1;
- g.setColor(color1);
- g.setStroke(stroke1);
- g.drawRect(558, 220, 174, 239);
- g.setColor(color2);
- g.fillRect(574, 228, 144, 221);
- g.setColor(color1);
- g.drawRect(574, 228, 144, 221);
- g.setColor(color4);
- g.fillRect(5, 456, 95, 23);
- g.setFont(font1);
- g.setColor(color3);
- g.drawString("Domms Cutter!", 602, 245);
- g.setFont(font2);
- g.drawString("Time Running: " + hours + ": " + minutes + ": " + seconds, 579, 263);
- g.drawString("Gems Cut: " +GemsCut, 576, 292);
- g.drawString(" " +status, 579, 276);
- g.drawString("Exp Gained:" +expGained, 576, 309);
- g.drawString("Exp Hour:" +CutsHour, 576, 324);
- g.drawString("Cuts TNL:" +GemsTNL, 576, 339);
- g.drawString("Gems Smashed:" +GemsSmashed, 576, 354);
- g.drawString("Thanks for using!", 605, 437);
- }
- //END: Code generated using Enfilade's Easel
- public void messageReceived(MessageEvent e) {
- String x = e.getMessage().toLowerCase();
- if (x.contains("ou cut the")){
- GemsCut++;
- if(x.contains("mis")){
- GemsSmashed++;
- }
- }}
- class gui extends JFrame {
- public gui() {
- initComponents();
- }
- private void button1ActionPerformed(ActionEvent e) {
- String chosen = GemsToCutAA.getSelectedItem().toString();
- if(chosen.equals("Sapphire")){
- GemsToCutA = Sapphire;
- GemXP = 50;
- }else{
- if(chosen.equals("Emerald")){
- GemsToCutA = Emerald;
- GemXP = 135 / 2;
- }else{
- if(chosen.equals("Ruby")){
- GemsToCutA = Ruby;
- GemXP = 85;
- }else{
- if(chosen.equals("Diamond")){
- GemsToCutA = Diamond;
- GemXP = 215 / 2;
- }else{
- if(chosen.equals("Opal")){
- GemsToCutA = Opal;
- GemXP = 15;
- }else{
- if(chosen.equals("Dragonstone")){
- GemsToCutA = Dragonstone;
- GemXP = 275 / 2;
- }else{
- if(chosen.equals("Jade")){
- GemsToCutA = Jade;
- GemXP = 20;
- }else{
- if(chosen.equals("Onyx")){
- GemsToCutA = Onyx;
- GemXP = 335 / 2;
- }else{
- if(chosen.equals("Red Topaz")){
- GemsToCutA = URT;
- GemXP = 25;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- 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();
- GemsToCutAA = new JComboBox();
- button1 = new JButton();
- //======== this ========
- Container contentPane = getContentPane();
- //---- label1 ----
- label1.setText("Domms Cutter!!");
- label1.setFont(label1.getFont().deriveFont(label1.getFont().getSize() + 22f));
- //---- label2 ----
- label2.setText("Gems To Cut :");
- label2.setFont(label2.getFont().deriveFont(label2.getFont().getSize() + 3f));
- //---- GemsToCutAA ----
- GemsToCutAA.setMaximumRowCount(50);
- GemsToCutAA.setModel(new DefaultComboBoxModel(new String[] {
- "Sapphire",
- "Emerald",
- "Ruby",
- "Diamond",
- "Opal",
- "Dragonstone",
- "Onyx",
- "Jade",
- "Red Topaz"
- }));
- //---- button1 ----
- button1.setText("Start Cutting!!");
- 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()
- .addContainerGap()
- .addGroup(contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addComponent(label2, GroupLayout.PREFERRED_SIZE, 117, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(GemsToCutAA, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addComponent(label1, GroupLayout.PREFERRED_SIZE, 240, GroupLayout.PREFERRED_SIZE))
- .addComponent(button1, GroupLayout.DEFAULT_SIZE, 257, Short.MAX_VALUE))
- .addContainerGap())
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label1, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE)
- .addGap(18, 18, 18)
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(label2, GroupLayout.PREFERRED_SIZE, 22, GroupLayout.PREFERRED_SIZE)
- .addComponent(GemsToCutAA, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE)
- .addComponent(button1)
- .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 GemsToCutAA;
- private JButton button1;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- }
Add Comment
Please, Sign In to add comment