Results 1 to 10 of 10

Thread: Taking Break Help

  1. #1
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default Taking Break Help

    I'm trying to add break-taking into my script, but the problem that I'm having is that whenever it's time for a break it doesn't break.

    My break procedure:
    Simba Code:
    procedure Breaker;
    var
      BreakingTime:Integer;
    begin
      if (Loads > (LoadsBeforeBreak + (RandomRange(-(LoadsBeforeBreak / 10), LoadsBeforeBreak / 10)))) or (TimeSinceBreak > (HoursBeforeBreak + (RandomRange(-(HoursBeforeBreak / 10), HoursBeforeBreak / 10))) * (3600000)) then
      begin
        MarkTime(BreakingTime);
        Status := 'Breaking';
        Proggy;
        ExitToLobby;
        repeat
          wait(RandomRange(1000, 10000))
        until((TimeFromMark(BreakingTime) > ( BreakTime + (RandomRange(-(BreakTime / 10), BreakTime / 10)))));
        LoginPlayer;
      end;
    end;

    My constants:
    Simba Code:
    LoadsBeforeBreak = 1; //About how any loads to do before taking a break?

      HoursBeforeBreak = 4; //About how many hours to run before taking a break?

      BreakTime = 1; //About how many minutes to break for?

    The part of my mainloop with breaking:
    Simba Code:
    MineOre;
          DropOre;
          Breaker;
          Proggy;
          DropGems;

    Sorry if it's a bit hard to tell what's going on, but I'll try to explain more if needed.

    It ran for a few hours and 24 loads without taking a break, so I don't know what's up.

  2. #2
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Have you considered the breaking mehtod Echo_ (I think) made a while back? I'm pretty sure it's a good breaker, nonetheless it can show you what needs to be done to break during a script (iirc Flight uses this and Asha uses this, or at least somethign like it)

    As for the code you posted, I would have it be based off of a time const/counter, as I think it may be more definite than after x-loads.

    -Lj

  3. #3
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    Have you considered the breaking mehtod Echo_ (I think) made a while back? I'm pretty sure it's a good breaker, nonetheless it can show you what needs to be done to break during a script (iirc Flight uses this and Asha uses this, or at least somethign like it)

    As for the code you posted, I would have it be based off of a time const/counter, as I think it may be more definite than after x-loads.

    -Lj
    Thanks, I did look at Echo's method but I didn't want to use it because I thought it was too complicated.

    As for mine, I had made it to go until it reached a certain amount of loads or a certain amount of time, whichever happened first.

  4. #4
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Echo's might be complicated, but it is pretty easy to implement! You could even edit it a bit to put in loads as well

  5. #5
    Join Date
    Jan 2011
    Location
    Denver, CO
    Posts
    1,351
    Mentioned
    2 Post(s)
    Quoted
    72 Post(s)

    Default

    Jesus, people still use my breaker? I completely forgot I wrote that thing.

  6. #6
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Try posting the whole script? If the status didn't turn Breaking it probably has to do with the 2 conditions not being met.

    What's Echo's breaker? I can't imagine how complicated a break system can be

  7. #7
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Echo_ View Post
    Jesus, people still use my breaker? I completely forgot I wrote that thing.
    Yeah, it's working like a charm
    Quote Originally Posted by riwu View Post
    Try posting the whole script? If the status didn't turn Breaking it probably has to do with the 2 conditions not being met.

    What's Echo's breaker? I can't imagine how complicated a break system can be
    I know I probably should've posted the whole thing, I just thought there was a problem in my logic which had made it nt work. And I thought the conditions were met, but maybe not. And Echo's breaker :http://villavu.com/forum/showthread.php?t=62216

  8. #8
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by Echo_ View Post
    Jesus, people still use my breaker? I completely forgot I wrote that thing.
    Loads do also im pretty sure Flight and Ashaman use them in near enough every script

  9. #9
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Quote Originally Posted by Ollybest View Post
    Loads do also im pretty sure Flight and Ashaman use them in near enough every script
    yep if it ain't broked, don't fix it!

  10. #10
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Quote Originally Posted by Echo_ View Post
    Jesus, people still use my breaker? I completely forgot I wrote that thing.
    Haha yup, I use it in every script I wrote.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •