BreakHandler doesn't work anymore. What to do?

Discussion in 'RuneScape 3 Cheating' started by Peisko, Feb 12, 2009.

BreakHandler doesn't work anymore. What to do?
  1. Unread #1 - Feb 12, 2009 at 9:59 AM
  2. Peisko
    Joined:
    Oct 20, 2008
    Posts:
    18
    Referrals:
    0
    Sythe Gold:
    0

    Peisko Newcomer

    BreakHandler doesn't work anymore. What to do?

    Hello, I have problem with BrakeHandler... When it "takes break" it won't actually logg out and take the brake. It just says that the script is taking a break, but it's not.
    What should I do to make it work correctly again?
    Thanks.

    Picture of it:
    [​IMG]
     
  3. Unread #2 - Feb 12, 2009 at 10:15 AM
  4. Flame Att33
    Joined:
    Dec 16, 2007
    Posts:
    1,052
    Referrals:
    2
    Sythe Gold:
    0

    Flame Att33 Guru
    Banned

    BreakHandler doesn't work anymore. What to do?

    im sure when it takes a break it lets it log out itself


    and the time limit went up to 3/5 mins before logout

    so just wait
    or turn it off :D
     
  5. Unread #3 - Feb 12, 2009 at 12:10 PM
  6. rivgen
    Joined:
    Jul 22, 2008
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0

    rivgen Forum Addict

    BreakHandler doesn't work anymore. What to do?

    Get a new break handler from RSBot.

    Or use this breakhandler I had downloaded from RSBot (it must log out in brakes):
    Code:
    import com.speljohan.rsbot.script.Random;
    import com.speljohan.rsbot.bot.Bot;
    import com.speljohan.rsbot.event.listeners.PaintListener;
    import com.speljohan.rsbot.script.Methods;
    
    import java.awt.Graphics;
    import java.awt.Color;
    
    import java.util.ArrayList;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.Comparator;
    import java.util.Collections;
    import java.util.Enumeration;
    
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.Properties;
    
    public class BreakHandler extends Random implements PaintListener {
    
        private final String confFile = "Settings/breaks.txt";
    
        private long startTime = System.currentTimeMillis();
        private ArrayList<Break> breaks = new ArrayList<Break>();
        private Iterator it;
        private Break curBreak;
        private boolean reset;
        
        private boolean setConfigs = true;
        private long curTime = System.currentTimeMillis();
        private long tookBreakAt = 0;
        long breakLength = 0;
        
        public String getName() {
            return "Break Handler";
        }
    
        public String getAuthor() {                //ported to RSBot by ngovil21
            return "regex, sean, pd";
        }
        
        public double getVersion() {
            return 1;
        }
        
        public void onRepaint(Graphics render) {    
            if (tookBreakAt>0 && System.currentTimeMillis() - tookBreakAt < breakLength) {
                render.setColor(Color.yellow);
                long time = breakLength - (System.currentTimeMillis() - tookBreakAt);
                render.drawString("Break Ends in " + cTime(time),420,15);
                return;
            }
            if(tookBreakAt>0) tookBreakAt = 0;
            if (!reset && !checkForActiveScripts()) {
                reset = true;
                log("No Scripts Running. Reset...");
            }
        }
        
        private boolean checkForActiveScripts() {
            try {
                return !Bot.getScriptHandler().getRunningScripts().isEmpty();
            } catch(Exception e) { }
            return false;
        }
        
    
        public void getConfig() {
            Configuration conf = new Configuration(confFile);
    
            for (Enumeration e = conf.propertyNames(); e.hasMoreElements();) {
                String prop = (String) e.nextElement();
                String val = conf.get(prop);
                String breakVal = val.substring(0, val.indexOf(',')).trim();
                String lengthVal = val.substring(val.indexOf(',') + 1).trim();
                long breakAtMin, breakAtMax, lengthMin, lengthMax;
    
                try {
                    if (breakVal.indexOf('|') != -1) {
                        breakAtMin = Long.parseLong(
                                breakVal.substring(0, breakVal.indexOf('|')).trim());
                        breakAtMax = Long.parseLong(
                                breakVal.substring(breakVal.indexOf('|') + 1).trim());
                    } else {
                        breakAtMax = Long.parseLong(breakVal);
                        breakAtMin = breakAtMax - breakAtMax / 4;
                    }
    
                    if (lengthVal.indexOf('|') != -1) {
                        lengthMin = Long.parseLong(
                                lengthVal.substring(0, lengthVal.indexOf('|')).trim());
                        lengthMax = Long.parseLong(
    
                                lengthVal.substring(lengthVal.indexOf('|') + 1).trim());
                    } else {
                        lengthMax = Long.parseLong(lengthVal);
                        lengthMin = lengthMax / 2;
                    }
                } catch (Exception ex) {
                    log("Exception loading BreakHandler config (" + prop + " = " + val + ")");
                    ex.printStackTrace();
                    continue;
                }
    
                // convert to ms
                breakAtMin *= 60000;
                breakAtMax *= 60000;
                lengthMin *= 60000;
                lengthMax *= 60000;
    
                Break b = new Break(breakAtMin, breakAtMax, lengthMin, lengthMax);
                breaks.add(b);
            }
    
            Collections.sort(breaks,
                new Comparator<Break>() {
                        public int compare(Break b1, Break b2) {
                            return (int) (b1.getBreakAtMin() - b2.getBreakAtMin());
                        }
                });
    
            it = breaks.iterator();
        }
        
        
        public boolean activateCondition() {
            if (setConfigs) {
                getConfig();
                startTime = System.currentTimeMillis();
                setConfigs = false;
            }
            if (breaks.isEmpty())
                return false;
            if (reset) {
                it = breaks.iterator();
                startTime = System.currentTimeMillis();
                reset = false;
            }
            if (curBreak == null)
                curBreak = (Break) it.next();
            curTime = System.currentTimeMillis();
            if (curBreak.shouldBreak(startTime, curTime))
                return true;
    
            return false;
        }
        
        public int loop() {
            if (curBreak == null)
                return -1;
            if (curBreak.getLengthMin() <= 0) {
                log("After " + cTime(curTime - startTime) + ", shutting down.");
                logout();
                reset = true;
                stopAllScripts();
                return -1;
            } else {
                breakLength = curBreak.randLength();
                log("After " + cTime(curTime - startTime)
                        + ", taking break for " + cTime(breakLength));
                if (getMyPlayer().isInCombat()) {
                wait(random(5000,10000));
                }
                if (getMyPlayer().isInCombat()) {
                log("Still In Combat, Waiting To Logout!");
                return random(3000,5000);
                }
                log("Not in Combat, Logging out..");
                logout();
                curBreak = null;
                if (!it.hasNext())
                    reset = true;
                tookBreakAt = System.currentTimeMillis();
                return (int)breakLength;
            }
            //return random(1000,2000);
        }
    
        private String cTime(long eTime) {
            long hrs = eTime / 1000 / 3600;
            eTime -= (hrs * 3600 * 1000);
            long mins = eTime / 1000 / 60;
            eTime -= (mins * 60 * 1000);
            long secs = eTime / 1000;
            return String.format("%1$02d:%2$02d:%3$02d", hrs, mins, secs);
        }
        
        public void waitNoException(long t) {
            try {
                Thread.sleep(t);
            } catch (Exception e) {}
        }
    
        protected class Break {
            private final long breakAtMin;
            private final long breakAtMax;
            private final long lengthMin;
            private final long lengthMax;
            private long randBreak=0;
    
            Break(long breakAtMin, long breakAtMax, long lengthMin, long lengthMax) {
                this.breakAtMin = breakAtMin;
                this.breakAtMax = breakAtMax;
                this.lengthMin = lengthMin;
                this.lengthMax = lengthMax;
                this.randBreak = randBreakAt();
            }
    
            private long randLong(long min, long max) {
                return min + (long) (java.lang.Math.random() * (max - min));
            }
    
            public long getBreakAtMin() {
                return breakAtMin;
            }
    
            public long getBreakAtMax() {
                return breakAtMax;
            }
    
            public long getLengthMin() {
                return lengthMin;
            }
    
            public long getLengthMax() {
                return lengthMax;
            }
    
            public long randBreakAt() {
                return randLong(breakAtMin, breakAtMax);
            }
    
            public long randLength() {
                return randLong(lengthMin, lengthMax);
            }
    
            public boolean shouldBreak(long startTime, long curTime) {
                if ((curTime - startTime) > randBreak) {
                    randBreak = randBreakAt();
                    return true;
                } else
                    return false;
            }
        }
        
        public class Configuration {
            private File loadedFrom;
            private Properties props;
            private boolean xml;
    
            /**
             * Reads and parses the specified file; can parse as both
             * XML and standard Properties syntax. If fileName ends with
             * .xml, XML format is assumed.
             *
             * @param fileName The name of the file to parse
             */
            public Configuration(String fileName) {
                loadedFrom = new File(fileName);
                if (fileName.toLowerCase().endsWith(".xml"))
                    xml = true;
                props = new Properties();
                if (loadedFrom.exists()) {
                    FileInputStream fis = null;
                    try {
                        fis = new FileInputStream(loadedFrom);
                        if (xml)
                            props.loadFromXML(fis);
                        else
                            props.load(new FileInputStream(loadedFrom));
                    } catch (IOException ioe) {
                        ioe.printStackTrace();
                    } finally {
                        try {
                            if (fis != null)
                                fis.close();
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
    
            /**
             * Saves the configuration
             */
            public void save() {
                save(loadedFrom, xml);
            }
    
            /**
             * Saves the configuration to specified filename; if the
             * filename ends with .xml, saves in XML format.
             *
             * @param fileName Filename to save to.
             */
            public void save(String fileName) {
                File f = new File(fileName);
                save(f);
            }
    
            /**
             * Saves the configuration to specified File; if the name of
             * the file ends with .xml, saves in XML format.
             *
             * @param f File object to save to
             */
            public void save(File f) {
                save(f, f.getName().toLowerCase().endsWith(".xml"));
            }
    
            /**
             * Saves the configuration to specified File
             *
             * @param f   File object to save to
             * @param xml Whether to save in XML format
             */
            public void save(File f, boolean xml) {
                FileOutputStream fos = null;
                try {
                    if (f.exists())
                        f.delete();
                    f.createNewFile();
                    fos = new FileOutputStream(f);
                    if (xml)
                        props.storeToXML(fos, null);
                    else
                        props.store(fos, null);
                } catch (IOException ioe) {
                    ioe.printStackTrace();
                } finally {
                    try {
                        if (fos != null)
                            fos.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
    
            /**
             * Gets the value of a key
             *
             * @param key The key to retrieve
             * @return The String value of the given key
             */
            public String get(String key) {
                String rv = props.getProperty(key);
                return rv == null ? "" : rv;
            }
    
            /**
             * Gets the value of a key, with a default value to fall back on
             *
             * @param key          The key to retrieve
             * @param defaultValue The default value to use if no such key was available
             * @return The String value of the given key, or the default value
             */
            public String get(String key, String defaultValue) {
                return props.getProperty(key, defaultValue);
            }
    
            public int getInt(String key) {
                String l = get(key);
                if (!l.equalsIgnoreCase("")) {
                    return Integer.parseInt(l);
                } else {
                    return -1;
                }
            }
    
            /**
             * Gets an Enumeration of available property names
             *
             * @return Enumeration object containing available properties
             */
            public Enumeration propertyNames() {
                return props.propertyNames();
            }
    
            /**
             * Puts a key/value pair into the configuration
             *
             * @param key   The key to assign a value to
             * @param value The value to assign
             * @return The previous value of the key, or null if it did not have one
             */
            public Object put(String key, String value) {
                return props.setProperty(key, value);
            }
    
            /**
             * Returns the number of available properties
             *
             * @return The number of properties
             */
            public int size() {
                return props.size();
            }
    
        }
    }
    
     
  7. Unread #4 - Feb 12, 2009 at 5:07 PM
  8. boboboy7
    Joined:
    Feb 12, 2009
    Posts:
    45
    Referrals:
    0
    Sythe Gold:
    0

    boboboy7 Member

    BreakHandler doesn't work anymore. What to do?

    i downloaded the new Rsbot but its still the same. any other ideas on how to fix this?
     
  9. Unread #5 - Feb 12, 2009 at 5:11 PM
  10. rivgen
    Joined:
    Jul 22, 2008
    Posts:
    536
    Referrals:
    0
    Sythe Gold:
    0

    rivgen Forum Addict

    BreakHandler doesn't work anymore. What to do?

    I said new breakhandler from RSBot, I didn't say new RSBot... Find a better breakhandler. The one I posted must work.
     
  11. Unread #6 - Feb 12, 2009 at 5:13 PM
  12. Abysal Rush
    Joined:
    Jul 26, 2007
    Posts:
    565
    Referrals:
    0
    Sythe Gold:
    0

    Abysal Rush Forum Addict

    BreakHandler doesn't work anymore. What to do?

    How do I name that break handler and where do I put it? My doesn't work at all either.
     
  13. Unread #7 - Feb 12, 2009 at 5:25 PM
  14. boboboy7
    Joined:
    Feb 12, 2009
    Posts:
    45
    Referrals:
    0
    Sythe Gold:
    0

    boboboy7 Member

    BreakHandler doesn't work anymore. What to do?

    ok trying it now ^_^ hope it works
     
  15. Unread #8 - Feb 12, 2009 at 5:41 PM
  16. 1337 LT
    Joined:
    May 24, 2008
    Posts:
    291
    Referrals:
    1
    Sythe Gold:
    0

    1337 LT Forum Addict
    Banned

    BreakHandler doesn't work anymore. What to do?

    Dont use breakhandler if want more xp , and lower chance of ban. Ive been botting on 2 accs at same time , same script , same world , same day of creation... And theres the resuld: 1st account that had break handler got banned after 1 week and had 82wc. 2nd account no breakhandler got 91wc and got ban after 2.5 weeks.
     
  17. Unread #9 - Feb 12, 2009 at 5:55 PM
  18. boboboy7
    Joined:
    Feb 12, 2009
    Posts:
    45
    Referrals:
    0
    Sythe Gold:
    0

    boboboy7 Member

    BreakHandler doesn't work anymore. What to do?

    Was the both characters lvl 3? if it is then i guess the other one got lucky
     
  19. Unread #10 - Feb 12, 2009 at 6:15 PM
  20. Lokheed
    Joined:
    Feb 6, 2009
    Posts:
    140
    Referrals:
    0
    Sythe Gold:
    0

    Lokheed Active Member

    BreakHandler doesn't work anymore. What to do?

    Dude, your breakhandler is working. It's taking a break for a shorter amount of time than is required before RuneScape automatically logs you out.

    So if the log out time is 5 minutes, you can have a breakhandler for 4:99 or less and still be logged in.

    However, being logged in or out doesn't matter. It's activity that matters.
     
< Funny Runescape Glitch/Bug At GrandExchange | Whats an Anti-Ban script? >

Users viewing this thread
1 guest


 
 
Adblock breaks this site