Page 1 of 2 12 LastLast
Results 1 to 25 of 27

Thread: How random are your failsafes? [for scripters]

  1. #1
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Lightbulb How random are your failsafes? [for scripters]

    With recent runescape bans human-like scripts are more important than ever.

    This advice is very simple, I hope most people already practice proper randomness in failsafes

    I cannot count how many times I've seen the following code:

    Simba Code:
    function openBank: boolean;
    var
      timerX: integer;
    begin
      timerX := getSystemTime+10000;
      while timerX > getSystemTime and (not result) do
      begin
        Mouse(bankPoint, Mouse_Right, Mouse_Human);
        result := chooseOption.select(['Use Bank'], 3000);
        wait(randomRange(100, 400));
      end;
    end;
    That looks pretty good right? We're trying to open the bank. We're waiting a random amount of time each loop to add randomness. If we can't open it within 10 seconds we give up. We also wait to "Use Bank" for 3 seconds without giving up.
    This does function. However, imagine worst case scenario, imagine we fail. Then we'll be waiting almost exactly 3 seconds for chooseOption each time and we'll quit trying after almost exactly 10 seconds.

    For obvious reasons this isn't optimal. The below is far more human IMHO:
    Simba Code:
    function openBank: boolean;
    var
      timerX: integer;
    begin
      timerX := getSystemTime+randomRange(9000,15000);
      while timerX > getSystemTime and (not result) do
      begin
        Mouse(bankPoint, Mouse_Right, Mouse_Human);
        result := chooseOption.select(['Use Bank'], randomRange(2500,4000));
        wait(randomRange(100, 400));
      end;
    end;

  2. #2
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default


  3. #3
    Join Date
    Feb 2012
    Location
    Discord
    Posts
    3,114
    Mentioned
    37 Post(s)
    Quoted
    538 Post(s)

    Default

    It is more human like yes. In the past I wouldn't of bothered but bans are pretty ripe atm so very small things like this are important.
    Do I do it? honestly? yes and No. I have random adds with my waits but I don't bother with loops like the ones provided (I will usually exit the loop upon it being successful and not ones with "and"). I do normally add random waits on my timeouts though
    Last edited by The Killer; 11-13-2013 at 05:59 PM. Reason: Realised I do

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

    Default

    Yeah, I've always done my waits like that. Just keeps things a little more safe.
    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.


  5. #5
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    Yeah, I've always done my waits like that. Just keeps things a little more safe.
    I should hope you're doing it right!

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

    Default

    Quote Originally Posted by footballjds View Post
    I should hope you're doing it right!
    Ha, I suck at scripting.
    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.


  7. #7
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    Ha, I suck at scripting.
    that one script, what was it. For runespan? that was pretty intense

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

    Default

    Quote Originally Posted by footballjds View Post
    that one script, what was it. For runespan? that was pretty intense
    Ha, thanks, but @Ashaman88; helped with most of it. I setup the core, he did the rest really. Was too busy at work to do them.
    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.


  9. #9
    Join Date
    Oct 2013
    Location
    forums.scar-divi.com/
    Posts
    101
    Mentioned
    3 Post(s)
    Quoted
    77 Post(s)

    Default

    Is SRL utilizing Gaussian Variance with randomness?


  10. #10
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Wanted Returns View Post
    Is SRL utilizing Gaussian Variance with randomness?
    Is that gaussbox?

    Creds to DannyRS for this wonderful sig!

  11. #11
    Join Date
    Oct 2013
    Location
    forums.scar-divi.com/
    Posts
    101
    Mentioned
    3 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    Is that gaussbox?
    No... otherwise it wouldn't be circular.... the image file has to be square (unless I pulled up photoshop and did transparency etc.)

  12. #12
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Wanted Returns View Post
    No... otherwise it wouldn't be circular....
    Thought the same technique or smthing used in gaussbox lol

    Creds to DannyRS for this wonderful sig!

  13. #13
    Join Date
    Oct 2013
    Location
    forums.scar-divi.com/
    Posts
    101
    Mentioned
    3 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    Thought the same technique or smthing used in gaussbox lol
    There's also more simple uses for waiting etc.

  14. #14
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by Wanted Returns View Post
    There's also more simple uses for waiting etc.
    random waits with gaus? huh

  15. #15
    Join Date
    Oct 2013
    Location
    forums.scar-divi.com/
    Posts
    101
    Mentioned
    3 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by footballjds View Post
    random waits with gaus? huh
    For example

    Random generates a number between A and B

    It is likely to be any number between A and B equally

    However say you wanted to disperse it in a way where it was centralized towards the center or some other value

    "Like throwing darts at a target" ... 'humanly'...

  16. #16
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by Wanted Returns View Post
    For example

    Random generates a number between A and B

    It is likely to be any number between A and B equally

    However say you wanted to disperse it in a way where it was centralized towards the center or some other value

    "Like throwing darts at a target" ... 'humanly'...
    right on!

    My life dream(srl-forum/villavu life dream) has always been to play runescape with a video and mouse recorder for an hour, then try to replicate my style of playing.
    I'd be interested in the gaus wait thingy tho

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

    Default

    Quote Originally Posted by Kyle Undefined View Post
    Ha, thanks, but @Ashaman88; helped with most of it. I setup the core, he did the rest really. Was too busy at work to do them.
    It's all about that teamwork


    And nice pointers football and wanted

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

    Default

    wait(gaussRangeInt(5000, 10000)); done.



    Simba Code:
    program new;

    {$i srl-6/srl.simba}

    const
      HIGH = 1000;
      TRIES = 120000;

    var
      bmp: integer;
      t, i, del: integer;

    begin
      bmp := createBitmap(1001, 500);

      getMufasaBitmap(bmp).lineTo(point(0, 250), point(1000, 250), clRed);
      getMufasaBitmap(bmp).drawText('0', point(0, 100), bigChars, true, clRed);
      getMufasaBitmap(bmp).drawText(toStr(HIGH), point(930, 100), bigChars, true, clRed);

      for i := 0 to tries do
      begin
        t := gaussRangeInt(0, HIGH);

        if (fastGetPixel(bmp, t, 250) = clLime) then
        begin
          del := 0;
          repeat
            inc(del);

            if (fastGetPixel(bmp, t, 250 - del) <> clLime) then
            begin
              fastSetPixel(bmp, t, 250 - del, clLime);
              break;
            end;

            if (fastGetPixel(bmp, t, 250 + del) <> clLime) then
            begin
              fastSetPixel(bmp, t, 250 + del, clLime);
              break;
            end;
           until false;
        end else
          fastSetPixel(bmp, t, 250, clLime);
      end;

      debugBitmap(bmp);
    end.
    Last edited by Olly; 11-14-2013 at 10:58 PM.

  19. #19
    Join Date
    Oct 2013
    Location
    forums.scar-divi.com/
    Posts
    101
    Mentioned
    3 Post(s)
    Quoted
    77 Post(s)

    Default

    Why not just put that into the base SRL with optional Defines etc. so that it applies to the entire include etc.

    https://github.com/OSI1/OfficialSCAR...teger.scar#L93

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

    Default

    We could do, since we can override it would be great.


    Simba Code:
    function randomRange(const aFrom, aTo: integer): integer; override;
    begin
    {$IFDEF GAUSS}
      result := gaussRangeInt(aFrom, aTo);
    {$ELSE}
      inherited(aFrom, aTo);
    {$ENDIF}
    end;

  21. #21
    Join Date
    Oct 2013
    Location
    forums.scar-divi.com/
    Posts
    101
    Mentioned
    3 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    We could do, since we can override it would be great.


    Simba Code:
    function randomRange(const aFrom, aTo: integer): integer; override;
    begin
    {$IFDEF GAUSS}
      result := gaussRangeInt(aFrom, aTo);
    {$ELSE}
      inherited(aFrom, aTo);
    {$ENDIF}
    end;
    Yes but then you wouldn't be able to switch back and forth at will?

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

    Default

    Quote Originally Posted by Wanted Returns View Post
    Yes but then you wouldn't be able to switch back and forth at will?
    Could do the same with a global var i guess.

  23. #23
    Join Date
    Oct 2013
    Location
    forums.scar-divi.com/
    Posts
    101
    Mentioned
    3 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    Could do the same with a global var i guess.
    I wouldn't recommend using global variables for anything unless you have to.

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

    Default

    Quote Originally Posted by Wanted Returns View Post
    I wouldn't recommend using global variables for anything unless you have to.
    Okay then we'd have you go down an extra parameter line, randomRange(s, e: integer; gaussian: boolean = false) or something.

  25. #25
    Join Date
    Oct 2013
    Location
    forums.scar-divi.com/
    Posts
    101
    Mentioned
    3 Post(s)
    Quoted
    77 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    Okay then we'd have you go down an extra parameter line, randomRange(s, e: integer; gaussian: boolean = false) or something.
    No.. I'd do it the way I have it in OSI.

    {$DEFINE NoVariance} etc... to override and disable it

    or override it case by case simply by using RandomRange instead of RR...

Page 1 of 2 12 LastLast

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
  •