Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * JizzedCrafter AIO
- *
- * by iJizzed
- *
- * Current version 0.01
- */
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Skills;
- @ScriptManifest(authors = {"iJizzed"}, keywords = "", name = "JizzedCrafter AIO", description = "Crafts all hides.", version = 0.01)
- public class JizzedCrafter extends Script implements PaintListener, MouseListener {
- final ScriptManifest properties = getClass().getAnnotation(
- ScriptManifest.class);
- private int dHide = 0;
- private int armourID = 0;
- private int interfaceID = 0;
- private int componentID = 0;
- private int armourMade = 0;
- private final static int leatherID = 1741;
- //private final static int snakeID = 6289;
- private final static int greenhideID = 1745;
- private final static int bluehideID = 2505;
- private final static int redhideID = 2507;
- private final static int blackhideID = 2509;
- private final static int leatherBodyID = 1129, leatherChapsID = 1095, leatherVambsID = 1063, blackBodyID = 2503, blackChapsID = 2497, blackVambsID = 2491, greenBodyID = 1135, greenVambsID = 1065, greenChapsID = 1099, blueBodyID = 2499, blueVambsID = 2487, blueChapsID = 2493, redBodyID = 2501, redVambsID = 2489, redChapsID = 2495;
- private final static int CChaps = 16, CVambs = 15, CBody = 14, CLeatherBody = 18, CLeatherChaps = 19, CLeatherVambs = 17;
- private int needleID = 1733;
- private int threadID = 1734;
- //private int animationID = 1249;
- private int Gainedlvls;
- private int xpGained;
- public long startTime = 0;
- private double startTimeDbl;
- public int startXP = 0;
- public int startLevel = 0;
- int wcIndex = Skills.getIndex("Crafting");
- Rectangle closeButton = new Rectangle(493, 226, 15, 18);
- Point p;
- boolean showPaint = true;
- private boolean guiWait = true;
- JizzedCrafterGUI g = new JizzedCrafterGUI();
- //private final static int[] bankIDs = {11402, 27663, 35647, 4483, 42192, 26972};//Varbank,DuelArena,alkharidBank,Cw,Sw,EdgeBank
- @Override
- public boolean onStart() {
- log("Welcome to JizzedCrafter.");
- if (game.isLoggedIn()) {
- if (startTime == 0 || startXP == 0) {
- startTime = System.currentTimeMillis();
- startTimeDbl = System.currentTimeMillis();
- startXP = skills.getCurrentExp(wcIndex);
- startLevel = skills.getCurrentLevel(Skills.getIndex("Crafting"));
- }
- }
- g.setVisible(true);
- while (guiWait) sleep(500);
- return true;
- }
- private void knifeOnHide (){
- if (inventory.containsOneOf(needleID) && inventory.contains(threadID) && inventory.getCount(dHide) == armourMade) {
- inventory.useItem(needleID, dHide);
- }
- }
- //private void makeAllHide (){
- //if (interfaces.getComponent(interfaceID, componentID).isValid()) {
- //interfaces.getComponent(interfaceID, componentID).doClick();
- //sleep(500,600);
- // }
- // }
- private void banking(){
- if(!bank.isOpen()){
- bank.open();
- sleep(500, 650);
- }
- bank.depositAllExcept(needleID,threadID);
- sleep(500, 650);
- bank.withdraw(dHide, armourMade);
- sleep(500, 650);
- if(bank.isOpen()){
- bank.close();
- }
- }
- @Override
- public void onFinish() {
- }
- public int loop() {
- try {
- mouse.setSpeed(random(5, 8));
- switch (getState()) {
- case 1:
- if (getMyPlayer().getAnimation() == -1){
- knifeOnHide();
- sleep(2150);
- }
- if (interfaces.getComponent(interfaceID, componentID).isValid()) {
- interfaces.getComponent(interfaceID, componentID).doClick();
- sleep(3150);
- }
- return random(50, 100);
- case 2:
- banking();
- return random(50, 100);
- case 3:
- antiban();
- return random(50, 100);
- case 4:
- if(!bank.isOpen()){
- bank.open();
- sleep(500, 650);
- }
- bank.depositAll();
- sleep(500, 650);
- if (bank.getCount(needleID) > 0) {
- bank.withdraw(needleID, 1);
- } else {
- stopScript(false);
- log("No needle script stopped.");
- }
- sleep(500, 650);
- if (bank.getCount(threadID) > 0) {
- bank.withdraw(threadID, 0);
- } else {
- log("No thread script stopped.");
- stopScript(false);
- }
- if(bank.isOpen()){
- bank.close();
- }
- return random(50, 100);
- }
- } catch (NullPointerException e) {
- }
- return 5;
- }
- public int getState() {
- if (inventory.contains(needleID) && inventory.contains(threadID) && inventory.containsOneOf(dHide)){
- sleep(random(300, 350));
- return 1;
- }
- if (getMyPlayer().getAnimation() != -1) {
- sleep(random(300, 350));
- return 3;
- }
- if (inventory.contains(needleID) && inventory.contains(threadID) && !inventory.containsOneOf(dHide)){
- sleep(random(300, 350));
- return 2;
- }
- if (!inventory.contains(needleID) || !inventory.contains(threadID)){
- sleep(random(300, 350));
- return 4;
- }
- return -1;
- }
- //----------------------------------------antiban------------------------------------
- public void antiban() {
- int b = random(0, 10);
- switch (b) {
- case 1:
- if (random(0, 10) == 5) {
- mouse.moveSlightly();
- sleep(200, 600);
- mouse.moveRandomly(150, 350);
- }
- break;
- case 2:
- if (random(0, 13) == 2) {
- camera.setAngle(random(30, 70));
- sleep(400, 1200);
- }
- break;
- case 3:
- if (random(0, 24) == 6) {
- mouse.moveOffScreen();
- sleep(random(600, random(1200, 2000)));
- }
- break;
- case 4:
- if (random(0, 18) == 3) {
- game.openTab(1);
- skills.doHover(Skills.INTERFACE_WOODCUTTING);
- sleep(random(2100, 3400));
- }
- break;
- default:
- break;
- }
- }
- private final Color color1 = new Color(0, 0, 0, 103);
- private final Color color2 = new Color(255, 0, 0, 188);
- private final Color color3 = new Color(0, 0, 0);
- private final Color color4 = new Color(255, 0, 0);
- private final Color color5 = new Color(0, 255, 51, 188);
- private final BasicStroke stroke1 = new BasicStroke(2);
- private final Font font1 = new Font("Mongolian Baiti", 0, 19);
- private final Font font2 = new Font("Comic Sans MS", 0, 11);
- private final Font font3 = new Font("Comic Sans MS", 0, 10);
- public void onRepaint(Graphics g1) {
- final int percent = skills.getPercentToNextLevel(Skills.CRAFTING);
- long millis = System.currentTimeMillis() - startTime;
- double ms2 = System.currentTimeMillis() - startTimeDbl;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- xpGained = skills.getCurrentExp(wcIndex) - startXP;
- Gainedlvls = skills.getCurrentLevel(Skills.getIndex("Crafting")) - startLevel;
- Graphics2D g = (Graphics2D)g1;
- int topRightX = closeButton.x + 25;
- int topRightY = closeButton.y + 25;
- int bottomRightX = closeButton.x + 25;
- int topLeftY = closeButton.y + 25;
- int bottomLeftX5 = closeButton.x + 5;
- int bottomLeftY5 = closeButton.y + 5;
- g.setColor(color3);
- g.fillRect(closeButton.x, closeButton.y, closeButton.width, closeButton.height);//<<Fills a rectangle
- g.setColor(color3);
- g.drawRect(closeButton.x, closeButton.y, closeButton.width, closeButton.height);//<<<Draws a black outline around the close button
- if(showPaint){
- g.setColor(color2);
- g.fillRect(346, 311, 100, 14);
- g.setColor(color5);
- g.fillRect(346, 311, percent, 14);
- g.drawRect(346, 311, 100, 14);
- g.drawRect(346, 311, percent, 14);
- g.setFont(font3);
- g.setColor(Color.black);
- g.drawString("" + percent, 395, 322);
- g.setColor(color1);
- g.fillRect(334, 221, 178, 115);
- //g.setColor(color2);
- //g.fillRect(346, 311, 150, 14);// voor progressbar
- g.setColor(color3);
- g.fillRect(493, 226, 15, 18);//hide button
- g.setColor(color4);
- g.setStroke(stroke1);
- g.drawLine(495, 229, 505, 240);
- g.drawLine(495, 241, 507, 228);
- g.setFont(font1);
- g.setColor(color3);
- g.drawString("JizzedCrafter AIO", 344, 242);
- g.setColor(color4);
- g.drawLine(341, 246, 482, 246);
- g.setFont(font2);
- g.setColor(color3);
- g.drawString("Time running:" + hours + ":" + minutes + ":" + seconds, 346, 268);
- g.drawString("Xp gained:" + xpGained + "|" + " " +(int)(xpGained/(ms2/3600000)) + "P/H", 346, 283);
- g.drawString("Crafting level:" + skills.getCurrentLevel(Skills.getIndex("Crafting"))+ "|" + " " + Gainedlvls + "lvl(s) Gained", 346, 298);
- g.setFont(font3);
- g.drawString("version:" + properties.version(), 437, 257);
- } else {
- g.drawRect(bottomLeftX5, bottomLeftY5, 15, 15);
- }
- }
- public void mouseClicked(MouseEvent e){
- p = e.getPoint();
- if(closeButton.contains(p)){
- showPaint = !showPaint;
- }
- }
- public void mouseEntered(MouseEvent e){
- }
- public void mouseExited(MouseEvent e){
- }
- public void mousePressed(MouseEvent e){
- }
- public void mouseReleased(MouseEvent e){
- }
- /**
- *
- * @author Lorenzo
- */
- class JizzedCrafterGUI extends javax.swing.JFrame {
- public JizzedCrafterGUI() {
- initComponents();
- }
- @SuppressWarnings("unchecked")
- private void initComponents() {
- buttonGroup1 = new javax.swing.ButtonGroup();
- buttonGroup2 = new javax.swing.ButtonGroup();
- jScrollPane1 = new javax.swing.JScrollPane();
- jTextArea1 = new javax.swing.JTextArea();
- startButton = new javax.swing.JButton();
- leatherComboBox = new javax.swing.JComboBox();
- jLabel1 = new javax.swing.JLabel();
- TitleBox = new javax.swing.JLabel();
- jLabel3 = new javax.swing.JLabel();
- jComboBox1 = new javax.swing.JComboBox();
- jLabel2 = new javax.swing.JLabel();
- jTextArea1.setColumns(20);
- jTextArea1.setRows(5);
- jScrollPane1.setViewportView(jTextArea1);
- setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- setTitle("JizzedCrafter");
- setResizable(false);
- startButton.setFont(new java.awt.Font("Comic Sans MS", 1, 12));
- startButton.setText("Start the script!");
- startButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- startButtonActionPerformed(evt);
- }
- });
- leatherComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Leather", "Green D'hide", "Blue D'hide", "Red D'hide", "Black D'hide" }));
- leatherComboBox.setEditor(null);
- jLabel1.setFont(new java.awt.Font("Comic Sans MS", 0, 12));
- jLabel1.setText("Wich leather will you use:");
- TitleBox.setFont(new java.awt.Font("Comic Sans MS", 1, 18)); // NOI18N
- TitleBox.setText("Jizzed Crafter AIO");
- jLabel3.setFont(new java.awt.Font("Comic Sans MS", 0, 12));
- jLabel3.setText("What will you make:");
- jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Vambraces", "Chaps", "Body" }));
- jLabel2.setText("Made by iJizzed");
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jLabel1)
- .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(18, 18, 18)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jComboBox1, 0, 105, Short.MAX_VALUE)
- .addComponent(leatherComboBox, 0, 105, Short.MAX_VALUE)))
- .addGroup(layout.createSequentialGroup()
- .addGap(4, 4, 4)
- .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(startButton, javax.swing.GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE)))
- .addContainerGap())
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
- .addContainerGap(58, Short.MAX_VALUE)
- .addComponent(TitleBox)
- .addGap(52, 52, 52))
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addComponent(jLabel2)
- .addGap(2, 2, 2)
- .addComponent(TitleBox, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(18, 18, 18)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel1)
- .addComponent(leatherComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel3)
- .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(18, 18, 18)
- .addComponent(startButton)
- .addContainerGap())
- );
- startButton.getAccessibleContext().setAccessibleName("S");
- pack();
- }
- private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {
- String chosen = leatherComboBox.getSelectedItem().toString();
- String chosenArm = jComboBox1.getSelectedItem().toString();
- if (chosen.equals("Leather") && chosenArm.equals("Vambraces")) {
- dHide = leatherID;
- interfaceID = 905;
- componentID = CLeatherVambs;
- armourMade = 26;
- armourID = leatherVambsID;
- } else if (chosen.equals("Leather") && chosenArm.equals("Chaps")) {
- dHide = leatherID;
- interfaceID = 905;
- componentID = CLeatherChaps;
- armourMade = 26;
- armourID = leatherChapsID;
- } else if (chosen.equals("Leather") && chosenArm.equals("Body")) {
- dHide = leatherID;
- interfaceID = 905;
- componentID = CLeatherBody;
- armourMade = 26;
- armourID = leatherBodyID;
- } else if (chosen.equals("Green D'hide") && chosenArm.equals("Vambraces")) {
- dHide = greenhideID;
- interfaceID = 905;
- componentID = CVambs;
- armourMade = 26;
- armourID = greenVambsID;
- } else if (chosen.equals("Green D'hide") && chosenArm.equals("Body")) {
- dHide = greenhideID;
- interfaceID = 905;
- componentID = CBody;
- armourMade = 24;
- armourID = greenBodyID;
- } else if (chosen.equals("Green D'hide") && chosenArm.equals("Chaps")) {
- dHide = greenhideID;
- interfaceID = 905;
- componentID = CChaps;
- armourMade = 26;
- armourID = greenChapsID;
- } else if (chosen.equals("Blue D'hide") && chosenArm.equals("Chaps")) {
- dHide = bluehideID;
- interfaceID = 905;
- componentID = CChaps;
- armourMade = 26;
- armourID = blueChapsID;
- } else if (chosen.equals("Blue D'hide") && chosenArm.equals("Vambraces")) {
- dHide = bluehideID;
- interfaceID = 905;
- componentID = CVambs;
- armourMade = 26;
- armourID = blueVambsID;
- } else if (chosen.equals("Blue D'hide") && chosenArm.equals("Body")) {
- dHide = bluehideID;
- interfaceID = 905;
- componentID = CBody;
- armourMade = 24;
- armourID = blueBodyID;
- } else if (chosen.equals("Red D'hide") && chosenArm.equals("Chaps")) {
- dHide = redhideID;
- interfaceID = 905;
- componentID = CChaps;
- armourMade = 26;
- armourID = redChapsID;
- } else if (chosen.equals("Red D'hide") && chosenArm.equals("Vambraces")) {
- dHide = redhideID;
- interfaceID = 905;
- componentID = CVambs;
- armourMade = 26;
- armourID = redVambsID;
- } else if (chosen.equals("Red D'hide") && chosenArm.equals("Body")) {
- dHide = redhideID;
- interfaceID = 905;
- componentID = CBody;
- armourMade = 24;
- armourID = redBodyID;
- } else if (chosen.equals("Black D'hide") && chosenArm.equals("Chaps")) {
- dHide = blackhideID;
- interfaceID = 905;
- componentID = CChaps;
- armourMade = 26;
- armourID = blackChapsID;
- } else if (chosen.equals("Black D'hide") && chosenArm.equals("Body")) {
- dHide = blackhideID;
- interfaceID = 905;
- componentID = CBody;
- armourMade = 24;
- armourID = blackBodyID;
- } else if (chosen.equals("Black D'hide") && chosenArm.equals("Vambraces")) {
- dHide = blackhideID;
- interfaceID = 905;
- componentID = CVambs;
- armourMade = 26;
- armourID = blackVambsID;
- }
- guiWait = false;
- g.dispose();
- }
- private javax.swing.JLabel TitleBox;
- private javax.swing.ButtonGroup buttonGroup1;
- private javax.swing.ButtonGroup buttonGroup2;
- private javax.swing.JComboBox jComboBox1;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel jLabel2;
- private javax.swing.JLabel jLabel3;
- private javax.swing.JScrollPane jScrollPane1;
- private javax.swing.JTextArea jTextArea1;
- private javax.swing.JComboBox leatherComboBox;
- private javax.swing.JButton startButton;
- }
- }
Add Comment
Please, Sign In to add comment