Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
- import java.awt.Insets;
- import java.awt.Point;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.util.Properties;
- import javax.swing.JButton;
- import javax.swing.JCheckBox;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JSeparator;
- import javax.swing.JTextField;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.util.Filter;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSItem;
- import org.rsbot.script.wrappers.RSComponent;
- import org.rsbot.util.GlobalConfiguration;
- @ScriptManifest(name = "konzy's Master Stealer", authors = "konzy", keywords = "Thieving",
- version = 0.7, description = "Master Farmer Thieving by konzy")
- public class konzyMasterStealer extends Script implements PaintListener, ServerMessageListener , MouseListener
- {
- final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
- static final RSArea MARKET_AREA = new RSArea(new RSTile(3069, 3245), new RSTile(3086, 3258));
- static final RSArea BANK_AREA = new RSArea(new RSTile(3092,3240),new RSTile(3097,3246));
- static final RSArea WALK_AREA = new RSArea(new RSTile(3088,3247),new RSTile(3097,3250));
- static final RSTile MARKET_TO_BANK[] = {new RSTile(3084,3249), new RSTile(3089,3249), new RSTile(3092,3248), new RSTile(3093,3245)};
- static final RSTile MARKET_TILE = new RSTile(3080,3250);
- static final RSTile BANK_TILE = new RSTile(3093,3244);
- static final RSTile EXIT_TILE = new RSTile(3092,3249);
- static final RSTile CENTRAL_TILE = new RSTile(3085,3249);
- static final RSTile PATH_TO_BANK[] = {CENTRAL_TILE , BANK_TILE};
- static final RSTile PATH_FROM_BANK[] = {EXIT_TILE , CENTRAL_TILE};
- static final int KEEP_ID_COUNT = 12;
- static final int DROP_ID_COUNT = 32;
- static final int DONT_DROP_ID_COUNT = 6;
- static final int FARMER_ID = 2234;
- static final int BOOTH_ID = 2213;
- static final int STUNNED_ID = 424;
- static final int GLOVES_OF_SILENCE = 10075;
- static final int GLOVES_REQ_LVL = 54;
- static final int[] KEEP_ID = {
- 5100, 5295, 5296, 5298, 5299, 5300, 5301, 5302, 5303, 5304,
- 5321, 5323};
- static final String KEEP_NAME[] = {
- "impwurt", "anarr", "oadflax", "vantoe", "wuarm",
- "napdragon", "adantine", "antadyme", "warf", "orstol",
- "atermelon", "trawberry"};
- static final int[] DONT_DROP_ID = {
- 617, 1733, 1734, 10115, 10076, GLOVES_OF_SILENCE
- };
- static final int[] DROP_ID = {
- 5319, 5307, 5305, 5322, 5099, 5310, 5308, 5102, 5294, 5309,
- 5101, 5096, 5324, 5306, 5291, 5103, 5292, 5097, 5281, 5098,
- 5105, 5106, 5280, 5297, 5311, 5104, 5293, 5318, 5282, 1993,
- 5320, 1937};
- //private boolean guiWait = true, guiExit;
- private boolean dropSeeds = false;
- private boolean failedPick = false;
- private int profit = 0;
- private int withdrawFood = 5;
- private int foodPrice = 0;
- private int HP;
- private int startLvl;
- private int gainedLvls;
- private int startXP = 0;
- private int succeedPickpockets = 0;
- private int failPickpockets = 0;
- private int foodEaten = 0;
- private long startTime;
- private String status = "Starting Up";
- private boolean showPaint, startScript;
- private int completeIDs[][] = new int[3][KEEP_ID_COUNT];
- private int totalComplete = 0;
- private RSItem carriedFood;
- private RSNPC masterFarmer;
- private boolean justAttacked = false;
- private int foodID = 0;
- private int glovesInBankCount = 0;
- private boolean canWearGloves = false;
- private int handID = GLOVES_OF_SILENCE;
- private String lastMsg = "";
- @SuppressWarnings("static-access")
- public boolean onStart() {
- if(!game.isLoggedIn()) {
- log("Start logged in.");
- return false;
- }
- startScript = false;
- konzyMasterStealerGUI gui = new konzyMasterStealerGUI();
- while(!startScript) {
- if(!gui.isVisible())
- return false;
- sleep(100);
- }
- if(bank.isOpen())
- bank.close();
- if (skills.getRealLevel(Skills.HUNTER) >= GLOVES_REQ_LVL){
- canWearGloves = true;
- log("You can wear Gloves of Silence, checking if they are equipped");
- handID = equipment.getItem(equipment.HANDS).getID();
- }
- if (withdrawFood > 25 || withdrawFood < 1){
- log("You can only withdraw food between 1 and 25");
- return false;
- }
- if(foodID == 0 && carriedFood == null){
- log("Either start with food in your inventory or enter Food Override");
- return false;
- }
- startTime = (int)System.currentTimeMillis();
- startXP = skills.getCurrentExp(Skills.THIEVING);
- startLvl = skills.getCurrentLevel(Skills.THIEVING);
- showPaint = true;
- return true;
- }
- private RSItem getFood(){
- for(RSItem i : inventory.getItems()) {
- if(i == null || i.getID() == -1)
- continue;
- if (i.getComponent().getActions() == null || i.getComponent().getActions()[0] == null)
- continue;
- if (i.getComponent().getActions()[0].contains("Eat")){
- return i;
- }
- }
- return null;
- }
- private void hoverFarmer(){
- if(npcs.getNearest("Master Farmer").isValid()){
- if(npcs.getNearest("Master Farmer").isOnScreen()){
- Point farmerScreenLoc = npcs.getNearest("Master Farmer").getScreenLocation();
- int x = mouse.getLocation().x;
- int y = mouse.getLocation().y;
- int x2 = farmerScreenLoc.x;
- int y2 = farmerScreenLoc.y;
- int xdiff;
- int ydiff;
- if(x > x2)
- xdiff = x - x2;
- else
- xdiff = x2 - x;
- if(y > y2)
- ydiff = y - y2;
- else
- ydiff = y2 - y;
- if(ydiff > 75 || xdiff > 75)
- try{
- mouse.move(farmerScreenLoc);
- }catch (Exception e){}
- }
- }
- }
- private int getCurrentLifepoint() {
- if (interfaces.get(748).getComponent(8).getText() != null && interfaces.get(748).getComponent(8).isValid()) {
- HP = Integer.parseInt(interfaces.get(748).getComponent(8).getText());
- }
- return HP;
- }
- public boolean isHealthLow() {
- int CurrHP = getCurrentLifepoint() / 10;
- int RealHP = skills.getRealLevel(Skills.CONSTITUTION);
- if (CurrHP <= random(RealHP / 2, RealHP / 1.5)) {
- status = "Eating Food";
- return true;
- }
- if (getMyPlayer().getHPPercent() <= 10) {
- log.warning("HP less than 10% Logging out.");
- game.logout(true);
- stopScript(true);
- }
- return false;
- }
- private final Filter<RSNPC> npcFilter = new Filter<RSNPC>() {
- public boolean accept(RSNPC t) {
- if(t.getName().equals("Master Farmer"))
- return false;
- return (t.isValid() && t.isInCombat() && t.isInteractingWithLocalPlayer() && t.getHPPercent() != 0);
- }
- };
- public boolean gettingAttacked(){
- RSNPC mGuard[] = npcs.getAll(npcFilter);
- if (mGuard != null && getMyPlayer().isInCombat())
- return true;
- return false;
- }
- private boolean eatFood() {
- for(int i = 0; i < 3; i++) {
- if(!inventory.contains(foodID)){
- log("cant find food");
- break;
- }
- if(carriedFood.doAction("Eat")) {
- if (foodPrice == 0)
- foodPrice = grandExchange.getMarketPrice(foodID);
- profit -= foodPrice;
- return true;
- }
- }
- return false;
- }
- public boolean openBank() {
- status = "Opening Bank";
- if(!bank.isOpen()){
- if (objects.getNearest(BOOTH_ID).isOnScreen()) {
- final RSObject bankBooth = objects.getNearest(BOOTH_ID);
- if (bankBooth != null) {
- bankBooth.doAction("Use-Quickly");
- }
- }
- return false;
- }
- return true;
- }
- public void dropJunkSeeds(){
- if (inventory.containsOneOf(DROP_ID) && dropSeeds) {
- status = "Dropping Seeds";
- int dontDrop[] = new int[KEEP_ID_COUNT + DONT_DROP_ID_COUNT + 2];
- int i;
- for (i = 0; i < KEEP_ID_COUNT ; i++)
- dontDrop[i] = KEEP_ID[i];
- while ((i - KEEP_ID_COUNT) < DONT_DROP_ID_COUNT){
- dontDrop[i] = DONT_DROP_ID[i - KEEP_ID_COUNT];
- i++;
- }
- dontDrop[i + 1] = foodID;
- try {
- inventory.dropAllExcept(dontDrop);
- } catch (Exception e) {}
- }
- }
- @SuppressWarnings("static-access")
- public int loop(){
- antiBan(false);
- if(isHealthLow()){
- carriedFood = getFood();
- eatFood();
- return random(25, 50);
- }
- if (justAttacked && !BANK_AREA.contains(getMyPlayer().getLocation())){
- status = "RUN AWAY!!!";
- walking.setRun(true);
- if(walking.walkPathMM(PATH_TO_BANK , 1 , 1)){
- antiBan(true);
- return random(3000, 5000);
- }
- }else
- justAttacked = false;
- if(carriedFood == null || !inventory.contains(foodID) || inventory.isFull()){
- if(!BANK_AREA.contains(getMyPlayer().getLocation())){
- status = "Walking To Bank";
- if(walking.walkPathMM(PATH_TO_BANK , 1 , 1)){}
- }
- else if(!bank.isOpen())
- openBank();
- else if(inventory.getCount() >= 1){
- status = "Depositing";
- bank.depositAll();
- } else if (foodID == 0 && game.isLoggedIn()) {
- log("Out of food! logging out...");
- sleep(random(4000, 5000));
- bank.close();
- game.logout(true);
- stopScript(true);
- }else if (withdrawFood > inventory.getCount(foodID) ){
- status = "Withdrawing Food";
- int startingFood = inventory.getCount(foodID);
- try{
- if (withdrawFood - inventory.getCount(foodID) >= 10){
- if(bank.getItem(foodID).doAction("Withdraw-10")){}
- }else if (withdrawFood - inventory.getCount(foodID) >= 5 ){
- if(bank.getItem(foodID).doAction("Withdraw-5")){}
- }else if (withdrawFood == 1){
- if(bank.getItem(foodID).doAction("Withdraw-1")){}
- }
- sleep(random(1000 , 2000));
- int i = 0;
- while (startingFood == inventory.getCount(foodID) && i < 30){
- sleep(100);
- i++;
- }
- }catch (Exception e){}
- if(canWearGloves)
- glovesInBankCount = bank.getCount(GLOVES_OF_SILENCE);
- if(carriedFood == null){
- if(bank.close()){
- carriedFood = getFood();
- foodID = carriedFood.getID();
- }
- }
- }
- return random(1500, 2000);
- }//food getting end
- if (canWearGloves){//glove handling
- if(handID != GLOVES_OF_SILENCE){//if we dont have them on our hands
- if(inventory.getCount(GLOVES_OF_SILENCE) == 0){//get some from bank if none are in inventory
- if(!BANK_AREA.contains(getMyPlayer().getLocation())){
- status = "Walking To Bank for gloves";
- if(walking.walkPathMM(PATH_TO_BANK , 1 , 1)){}
- return random(1000,1250);
- }else if(!bank.isOpen()){
- openBank();
- glovesInBankCount = bank.getCount(GLOVES_OF_SILENCE);
- return random(1000 , 1250);
- }else if (glovesInBankCount > 0){
- status = "Withdrawing Gloves of Silence";
- log("Found Gloves of Silence in Bank");
- try{
- if(bank.getItem(GLOVES_OF_SILENCE).doAction("Withdraw-1"))
- sleep(random(1000 , 2000));
- int i = 0;
- while (inventory.getCount(GLOVES_OF_SILENCE) == 0 && i < 30){
- sleep(250);
- i++;
- }
- }catch (Exception e){}
- glovesInBankCount = bank.getCount(GLOVES_OF_SILENCE);
- if(bank.close())
- antiBan(true);
- return random(1000, 2500);
- }
- }else{
- try {
- if(inventory.getItem(GLOVES_OF_SILENCE).doClick(true))
- handID = equipment.getItem(equipment.HANDS).getID();
- log("equipping gloves of silence ");
- } catch (Exception e) {log("Remove your gloves, how do you expect to wear your gloves of silence?");}
- return random(1000 , 1500);
- }
- }
- }
- if (BANK_AREA.contains(getMyPlayer().getLocation())){
- status = "Walking Back To Market";
- walking.walkPathMM(PATH_FROM_BANK);
- return random(1000 , 1500);
- }
- if (!MARKET_AREA.contains(getMyPlayer().getLocation())){
- walking.walkTileMM(MARKET_AREA.getNearestTile(getMyPlayer().getLocation()),1,1);
- return random(1000 , 1500);
- }else if (failedPick){
- status = "failed";
- if(isHealthLow()){
- carriedFood = getFood();
- eatFood();
- antiBan(true);
- }
- dropJunkSeeds();
- antiBan(true);
- hoverFarmer();
- failedPick = false;
- }else
- try {
- masterFarmer = npcs.getNearest("Master Farmer");
- if(masterFarmer.isOnScreen()){
- status = "Pickpocketing!";
- masterFarmer.doAction("Pickpocket");
- antiBan(false);
- return random(250 , 400);
- } else {
- status = "Walking to Farmer";
- walking.walkTo((walking.randomizeTile(masterFarmer.getLocation(),1, 1)));
- }
- antiBan(true);
- return random(200, 500);
- } catch (Exception e) {return random(250 , 500);}
- return 0;
- }
- @SuppressWarnings("static-access")
- private void antiBan(boolean overRide){
- int randomNo = random(1, 20);
- int r = random(1, 12);
- if (randomNo == 3 || overRide) {
- switch(r){
- case 1:{
- if(canWearGloves){
- status = "AB Checking Our Hand Slot";
- handID = equipment.getItem(equipment.HANDS).getID();
- }
- }break;
- case 2:{
- status = "AB Open Random Tab 1s - 2s";
- game.openTab(random(1, 14));
- sleep(random(1000 , 2000));
- }break;
- case 3: {
- status = "AB Move Mouse Slightly .5s - 1s";
- mouse.moveSlightly();
- sleep(random(500 , 1000));
- }break;
- case 4: {
- status = "AB Move Mouse .5s - 1s";
- mouse.moveRandomly(70, 380);
- sleep(random(500 , 1000));
- }break;
- case 5: {
- status = "AB Move Off Screen 1.5s - 2s";
- mouse.moveOffScreen();
- sleep(1500 , 2000);
- }break;
- case 6: {
- status = "AB Rotate to Master Farmer .5s - 1s";
- if(npcs.getNearest("Master Farmer") != null)
- camera.turnToCharacter(npcs.getNearest("Master Farmer"));
- }break;
- case 7: {
- status = "AB Rotate Camera .5s - 1s";
- camera.setAngle(random(1, 360));
- sleep(random(250 , 500));
- }break;
- case 8: {
- status = "AB Rotate Camera .5s - 1s";
- camera.setAngle(random(80, 230));
- sleep(random(500 , 1000));
- }break;
- case 9: {
- status = "AB Rotate Camera .5s - 1s";
- camera.setAngle(random(150, 180));
- sleep(random(250 , 500));
- }break;
- case 10: {
- status = "AB Rotate Camera .5s - 1s";
- camera.setAngle(random(250, 360));
- sleep(random(250 , 500));
- }break;
- case 11: {
- status = "AB Open Skill Tab .5s";
- if (game.getCurrentTab() != 4) {
- game.openTab(4);
- sleep(500,750);
- } else return;
- }break;
- case 12: {
- status = "AB Look AT Thieving Skill 2s - 4s";
- if (game.getCurrentTab() != 1) {
- game.openTab(1);
- sleep(random(500, 700));
- mouse.move(random(620 , 665), random(295, 315));
- sleep(random(1500, 3000));
- }
- }break;
- }
- }
- }
- int getItemID (String item){
- int i;
- for(i = 0 ; i < KEEP_ID_COUNT ; i++){
- if(item.contains(KEEP_NAME[i])){
- return KEEP_ID[i];
- }
- }
- return 0;
- }
- int itemPrice (int id){
- int p;
- for (int i = 0; i < totalComplete ; i ++ ){
- if (completeIDs[0][i] == id)
- return completeIDs[1][i];
- }
- try {
- status = "Getting Prices";
- p = grandExchange.getMarketPrice(id);
- } catch (Exception e) {return 0;}
- completeIDs[0][totalComplete] = id;
- completeIDs[1][totalComplete] = p;
- totalComplete++;
- return p;
- }
- public void serverMessageRecieved(ServerMessageEvent e) {
- String svrmsg = e.getMessage();
- if (svrmsg.contains("combat")) {
- justAttacked = true;
- }
- if (svrmsg.contains("stunned") && !lastMsg.contains("stunned")){
- failedPick = true;
- failPickpockets++;
- }
- if (svrmsg.contains("restores") && !lastMsg.contains("restores"))
- foodEaten++;
- if (svrmsg.contains("advanced")) {
- sleep(random(1500, 2500));
- if (interfaces.canContinue()) {
- interfaces.clickContinue();
- }
- gainedLvls++;
- sleep(random(50,100));
- }
- if (svrmsg.contains("You steal")){
- succeedPickpockets++;
- if (svrmsg.contains("seed")) {
- int seedCount = 1;
- String splitString[] = svrmsg.split(" " , 10);
- String seedName = "";
- if (!splitString[2].contains("a") && !splitString[2].contains("an"))
- seedCount = Integer.parseInt(splitString[2].trim());
- seedName = splitString[3];
- int seedID = getItemID(seedName);
- if (seedID != 0){
- if (foodPrice == 0){
- try {
- status = "Getting Prices";
- foodPrice = grandExchange.getMarketPrice(foodID);
- } catch (Exception e1) {}
- }
- profit += (itemPrice(seedID) * seedCount);
- }
- }
- }
- lastMsg = svrmsg;
- }
- @SuppressWarnings("serial")
- public class konzyMasterStealerGUI extends javax.swing.JFrame {
- private final File file = new File(GlobalConfiguration.Paths.getSettingsDirectory() + System.getProperty("file.separator") + "konzyMasterStealerProps.txt");
- private JCheckBox dropJunkSeeds;
- private JTextField foodOverride, foodCount;
- private JLabel jLabel1, jLabel2, jLabel3, jLabel4, jLabel5, jLabel6;
- private JButton jButton1;
- private JSeparator jSeparator1;
- //JButton start
- /** Creates new form NewJFrame */
- public konzyMasterStealerGUI() {
- initComponents();
- pack();
- setVisible(true);
- }
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- private void initComponents() {
- GridBagConstraints gridBagConstraints;
- Properties props = loadProperties();
- jButton1 = new JButton();
- jSeparator1 = new JSeparator();
- dropJunkSeeds = new JCheckBox();
- foodCount = new JTextField();
- foodOverride = new JTextField();
- jLabel1 = new JLabel();
- jLabel3 = new JLabel();
- jLabel4 = new JLabel();
- jLabel5 = new JLabel();
- jLabel2 = new JLabel();
- jLabel6 = new JLabel();
- dropJunkSeeds.setSelected(false);
- foodCount.setText("10");
- if(props.getProperty("dropJunkSeeds") != null) {
- if(props.getProperty("dropJunkSeeds").equals("true"))
- dropJunkSeeds.setSelected(true);
- }
- if(props.getProperty("foodOverride") != null) {
- foodOverride.setText(props.getProperty("foodOverride"));
- }
- if(props.getProperty("foodCount") != null) {
- foodCount.setText(props.getProperty("foodCount"));
- }
- getContentPane().setLayout(new GridBagLayout());
- jLabel1.setFont(new Font("Arial", 0, 18)); // NOI18N
- jLabel1.setForeground(new Color(51, 204, 0));
- jLabel1.setText("konzy's Master Stealer");
- gridBagConstraints = new GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 0;
- gridBagConstraints.gridwidth = 2;
- gridBagConstraints.ipadx = 10;
- gridBagConstraints.insets = new Insets(0, 104, 0, 0);
- getContentPane().add(jLabel1, gridBagConstraints);
- jButton1.setText("OK");
- jButton1.addActionListener(onStart);
- gridBagConstraints = new GridBagConstraints();
- gridBagConstraints.gridx = 4;
- gridBagConstraints.gridy = 10;
- gridBagConstraints.gridwidth = 10;
- gridBagConstraints.insets = new Insets(6, 6, 11, 0);
- getContentPane().add(jButton1, gridBagConstraints);
- gridBagConstraints = new GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.gridwidth = 15;
- gridBagConstraints.ipadx = 461;
- gridBagConstraints.ipady = 9;
- gridBagConstraints.insets = new Insets(6, 0, 0, 0);
- getContentPane().add(jSeparator1, gridBagConstraints);
- dropJunkSeeds.setText("Drop Junk Seeds");
- gridBagConstraints = new GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 6;
- gridBagConstraints.gridwidth = 13;
- gridBagConstraints.gridheight = 2;
- gridBagConstraints.ipadx = 15;
- gridBagConstraints.insets = new Insets(6, 18, 0, 0);
- getContentPane().add(dropJunkSeeds, gridBagConstraints);
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 8;
- gridBagConstraints.gridwidth = 13;
- gridBagConstraints.gridheight = 2;
- gridBagConstraints.ipadx = 114;
- gridBagConstraints.insets = new Insets(6, 18, 0, 0);
- getContentPane().add(foodOverride, gridBagConstraints);
- gridBagConstraints = new GridBagConstraints();
- gridBagConstraints.gridx = 1;
- gridBagConstraints.gridy = 4;
- gridBagConstraints.gridwidth = 13;
- gridBagConstraints.gridheight = 2;
- gridBagConstraints.ipadx = 114;
- gridBagConstraints.insets = new Insets(9, 18, 0, 0);
- getContentPane().add(foodCount, gridBagConstraints);
- jLabel3.setFont(new Font("Arial", 0, 10));
- jLabel3.setText("Food Override, enter the itemID of the food here");
- gridBagConstraints = new GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 8;
- gridBagConstraints.insets = new Insets(9, 67, 0, 0);
- getContentPane().add(jLabel3, gridBagConstraints);
- jLabel4.setFont(new Font("Arial", 0, 10));
- jLabel4.setText("For speed leave disabled, only drops when stunned");
- gridBagConstraints = new GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 6;
- gridBagConstraints.insets = new Insets(10, 57, 0, 0);
- getContentPane().add(jLabel4, gridBagConstraints);
- jLabel5.setFont(new Font("Arial", 0, 10));
- jLabel5.setText("How much food should be withdrawn from the bank each visit");
- gridBagConstraints = new GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 4;
- gridBagConstraints.insets = new Insets(9, 10, 0, 0);
- getContentPane().add(jLabel5, gridBagConstraints);
- jLabel2.setFont(new Font("Arial", 0, 10)); // NOI18N
- jLabel2.setText("This is my first released script, please give feedback!");
- gridBagConstraints = new GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 2;
- gridBagConstraints.gridwidth = 5;
- gridBagConstraints.insets = new Insets(6, 38, 0, 0);
- getContentPane().add(jLabel2, gridBagConstraints);
- jLabel6.setFont(new Font("Arial", 0, 10));
- jLabel6.setText("Either use the food override, or just put food in your inventory before starting the bot");
- gridBagConstraints = new GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 3;
- gridBagConstraints.gridwidth = 9;
- gridBagConstraints.insets = new Insets(6, 25, 0, 0);
- getContentPane().add(jLabel6, gridBagConstraints);
- setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- setTitle("konzy's Master Stealer");
- }
- private Properties loadProperties() {
- try {
- if(!file.exists())
- file.createNewFile();
- Properties p = new Properties();
- p.load(new FileInputStream(file));
- return p;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
- private void saveProperties() {
- Properties p = new Properties();
- p.put("dropJunkSeeds", Boolean.toString(dropJunkSeeds.isSelected()));
- p.put("foodCount", foodCount.getText());
- carriedFood = getFood();
- if (carriedFood != null){
- try {
- foodID = carriedFood.getID();
- log("The Item ID of your food is " + foodID + " saving this to file");
- } catch (Exception e) {}
- p.put("foodOverride", "" + foodID);
- }else
- p.put("foodOverride", foodOverride.getText());
- try {
- p.store(new FileOutputStream(file), "");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- private ActionListener onStart = new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- saveProperties();
- startScript = true;
- dropSeeds = dropJunkSeeds.isSelected();
- try {
- if (Integer.parseInt(foodOverride.getText()) != 0)
- foodID = Integer.parseInt(foodOverride.getText());
- if (Integer.parseInt(foodCount.getText()) != 0)
- withdrawFood = Integer.parseInt(foodCount.getText());
- } catch (NumberFormatException e1) {}
- dispose();
- }
- };
- }
- //START: Paint generated using Enfilade's Easel
- private final Color color1 = new Color(0, 0, 0);
- private final Color color2 = new Color(0, 204, 0);
- private final Color color3 = new Color(255, 255, 255);
- private final Font font1 = new Font("Arial", 0, 13);
- public void onRepaint(Graphics g1) {
- if(!showPaint){
- Graphics2D g = (Graphics2D)g1;
- g.setFont(font1);
- g.setColor(color3);
- g.drawString("Click Chat To See Paint", 160, 335);
- return;
- }
- int runTime = (int) (System.currentTimeMillis() - startTime);
- int hours = (int) runTime / (60 * 1000 * 60);
- int minutes = (int) (runTime - (hours * 60 * 1000 * 60)) / (60 * 1000);
- int seconds = (int) (runTime - (hours * 60 * 1000 * 60) - (minutes * 60 * 1000)) / 1000;
- int currentXP = skills.getCurrentExp(Skills.THIEVING);
- int currentLVL = skills.getCurrentLevel(Skills.THIEVING);
- int gainedXP = currentXP - startXP;
- int gainedLVL = currentLVL - startLvl;
- int xpPerHour = (int) ((3600000.0 / (double) runTime) * gainedXP);
- int succeedPickpocketsHour = (int) ((3600000.0 / (double) runTime) * succeedPickpockets);
- int profitPerHour = (int) ((3600000.0 / (double) runTime) * profit);
- String dispProfit = "" + profit;
- String dispProfitPerHour = "" + profitPerHour;
- if(profit < 0){
- dispProfit = "(" + (-profit) + ")";
- dispProfitPerHour = "(" + (-profitPerHour) + ")";
- }
- String normMinutes;
- String normSeconds;
- if (minutes < 10)
- normMinutes = "0" + minutes;
- else normMinutes = "" + minutes;
- if (seconds < 10)
- normSeconds = "0" + seconds;
- else normSeconds = "" + seconds;
- Graphics2D g = (Graphics2D)g1;
- g.setColor(color1);
- g.fillRect(8, 344, 502, 128);
- g.setFont(font1);
- g.setColor(color2);
- g.drawString("konzy's Master Stealer V " + properties.version(), 10, 355);
- g.drawString("XP Gained: " + gainedXP, 10, 370);
- g.drawString("XP/hr: " + xpPerHour, 10, 385);
- g.drawString("Current Level: " + currentLVL, 10, 400);
- g.drawString("% Needed To Level Up: " + (100 - skills.getPercentToNextLevel(Skills.THIEVING)) + "%", 10, 415);
- g.drawString("Levels Gained: " + gainedLVL, 10, 430);
- g.drawString("Run Time: " + hours + ":" + normMinutes + ":" + normSeconds, 10, 445);
- g.drawString("Number of Picks: " + succeedPickpockets, 250, 355);
- g.drawString("Picks per Hour: " + succeedPickpocketsHour, 250, 370);
- g.drawString("Picks Failed: " + failPickpockets, 250, 385);
- g.drawString("Profit: " + dispProfit, 250, 400);
- g.drawString("Profit Per Hour: " + dispProfitPerHour, 250, 415);
- g.drawString("Status: " + status, 250, 430);
- g.drawString("By konzy", 250, 445);
- g.setColor(color3);
- g.drawString("Click Paint To See Chat", 160, 335);
- }
- //END: Paint generated using Enfilade's Easel
- @Override
- public void mouseClicked(MouseEvent e) {
- RSComponent inter = interfaces.get(137).getComponent(0);
- if(inter.getArea().contains(e.getPoint())) {
- showPaint = !showPaint;
- }
- }
- @Override
- public void mousePressed(MouseEvent e) { }
- @Override
- public void mouseReleased(MouseEvent e) { }
- @Override
- public void mouseEntered(MouseEvent e) { }
- @Override
- public void mouseExited(MouseEvent e) { }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement