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

Thread: RandomStringGenerator

  1. #1
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default RandomStringGenerator

    SCAR Code:
    procedure RandomStringGenerator;
    var
    P : Integer;
    Spam : String;
    begin
      for P := 0 to (2+random(10)) do
      begin  
        case random(36) of
           0:Spam := Spam +'0';
           1:Spam := Spam +'a';
           2:Spam := Spam +'b';
           3:Spam := Spam +'c';
           4:Spam := Spam +'d';
           5:Spam := Spam +'e';
           6:Spam := Spam +'f';
           7:Spam := Spam +'g';
           8:Spam := Spam +'h';
           9:Spam := Spam +'i';
           10:Spam := Spam +'j';
           11:Spam := Spam +'k';
           12:Spam := Spam +'l';
           13:Spam := Spam +'m';
           14:Spam := Spam +'n';
           15:Spam := Spam +'o';
           16:Spam := Spam +'p';
           17:Spam := Spam +'q';
           18:Spam := Spam +'r';
           19:Spam := Spam +'s';
           20:Spam := Spam +'t';
           21:Spam := Spam +'u';
           22:Spam := Spam +'v';
           23:Spam := Spam +'w';
           24:Spam := Spam +'x';
           25:Spam := Spam +'y';
           26:Spam := Spam +'z';
           27:Spam := Spam +'1';
           28:Spam := Spam +'2';
           29:Spam := Spam +'3';
           30:Spam := Spam +'4';
           31:Spam := Spam +'5';
           32:Spam := Spam +'6';
           33:Spam := Spam +'7';
           34:Spam := Spam +'8';
           35:Spam := Spam +'9';
        end;
      end;
    writeln(Spam);
    end;
    Just a random string generator from my Air Runner. This can be used for anti-ban and for creating good, safe passwords. I have yet to test it, and it was cut out of a lot of other random sayings, so I don't know for sure if it will compile. Feel free to use so long as you credit me.
    Active only during the Summer...

  2. #2
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Yes could be good for passwords. you might need to make sure the person looks in the debug box before the person deletes it

  3. #3
    Join Date
    Oct 2006
    Posts
    207
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could also do something like this:
    SCAR Code:
    for p :+ 0 to 2 + random(10) do
      begin
        i := random(36);
        if(i <= 9) then
        begin
          spam := spam + intToStr(i);
        end else
        begin
          spam := spam + chr(i + 55);
        end;
      end;

  4. #4
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    That won't work Jack...

    If you don't set the string, then it's automatically:

    SCAR Code:
    ''

    So basically...this would just type a random letter, which could be done in a for/to/do loop...I think...
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  5. #5
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Hope you learn something people:

    SCAR Code:
    Function RandomString(sLength: Integer): String;
    Var
      Let: String;
      I: Integer;
    Begin
      Let := 'abcdefghijklmnopqrstuvwxyzåäö0123456789';
      For I := 0 To sLength Do
        Result := Result + Let[Random(Length(Let))];
    End;

  6. #6
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Read my previous post n3ss3s
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  7. #7
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Did I misunderstood or..?

    SCAR Code:
    program New;
    Var
      A: String;
    begin
      A := '';
      Writeln(A);
    end.

    Empty space it gives.

  8. #8
    Join Date
    Jan 2007
    Location
    BC, Canada
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Random Word Generator

    This is how its done booh-ya.

    SCAR Code:
    program RandomWord;

    var
      RandomWord: String;

    begin
      Repeat
        insert(Chr(RandomRange(97,122)),RandomWord,(Length(RandomWord)+1));
      until(Length(RandomWord) > (RandomRange(5,10)));
      writeln(RandomWord);
    end.

    or if you want a list of words to choose from.

    SCAR Code:
    program RandomWord;

    var
      RandomWord: String;
      i: Integer;

    begin
      repeat
        Inc(i);
        Repeat
          insert(Chr(RandomRange(97,122)),RandomWord,(Length(RandomWord)+1));
        until(Length(RandomWord) > (RandomRange(5,10)));
        writeln(RandomWord);
        delete(RandomWord,1,Length(RandomWord));
      until(i > 20);
    end.

  9. #9
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Why would you want to insert a random char in a random position?

    You can just go from start to end, and it will do the same thing.

  10. #10
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Sorry to tell you people, but SCAR's "random" numbers are predictable
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  11. #11
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Yup,

    SCAR Code:
    Writeln(IntToStr(Random(5)));
      ClearDebug; // Bwuahahahaa! EVIL HAX! >:)
      Writeln(IntToStr(1));

    mind sharing your knowledge, r0b0t?

  12. #12
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OK, why would this not work?
    SCAR Code:
    procedure RandomStringGenerator;
    var
    P : Integer;
    Spam : String;
    begin
      for P := 0 to (2+random(10)) do
        case random(36) of
           0:Spam := Spam +'0';
           1:Spam := Spam +'a';
           2:Spam := Spam +'b';
           3:Spam := Spam +'c';
           4:Spam := Spam +'d';
           5:Spam := Spam +'e';
           6:Spam := Spam +'f';
           7:Spam := Spam +'g';
           8:Spam := Spam +'h';
           9:Spam := Spam +'i';
           10:Spam := Spam +'j';
           11:Spam := Spam +'k';
           12:Spam := Spam +'l';
           13:Spam := Spam +'m';
           14:Spam := Spam +'n';
           15:Spam := Spam +'o';
           16:Spam := Spam +'p';
           17:Spam := Spam +'q';
           18:Spam := Spam +'r';
           19:Spam := Spam +'s';
           20:Spam := Spam +'t';
           21:Spam := Spam +'u';
           22:Spam := Spam +'v';
           23:Spam := Spam +'w';
           24:Spam := Spam +'x';
           25:Spam := Spam +'y';
           26:Spam := Spam +'z';
           27:Spam := Spam +'1';
           28:Spam := Spam +'2';
           29:Spam := Spam +'3';
           30:Spam := Spam +'4';
           31:Spam := Spam +'5';
           32:Spam := Spam +'6';
           33:Spam := Spam +'7';
           34:Spam := Spam +'8';
           35:Spam := Spam +'9';
    end;
    writeln(Spam);
    end;
    I've run this through and it compiles.
    Santa, you're wrong.
    Force_work's does, and it's pretty awesome.
    N3ss's has an out of range error.
    SCAR Code:
    Program new;
    Function RandomString(sLength: Integer): String;
    Var
      Let: String;
      I: Integer;
    Begin
      Let := 'abcdefghijklmnopqrstuvwxyzåäö0123456789';
      For I := 0 To sLength Do
        Result := Result + Let[Random(Length(Let))];
    End;
    begin
    RandomString(11);
    end.
    Active only during the Summer...

  13. #13
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    It does work, but we are trying to show you more advanced ways.

  14. #14
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Or less code ways...

    But, anyway, if you used the Random function enough, you would find a pattern.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  15. #15
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I can't say that I've seen the insert function before.
    Are you saying it operates on squares, and when it passes the maximum range, it subtracts from itself?
    Ex.
    x = x*x+1
    Active only during the Summer...

  16. #16
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by JackLKrawl
    N3ss's has an out of range error.
    ROFL, get used to it, lol

    @n3s: *Cough!* Edgeville Yew Cutter Version 1.0 *Cough!*

    And n3s did the same as you, Jack, when he was new
    He made a script called "Ultima Password Creator"
    He used a gigantic Case-statement, and here he just copy-pasted Freddy's response to the script I remember old things, lol

    EDIT: Did anyone say overuse of smileys?

    -Knives

  17. #17
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    N3ss3s is getting you out of range because an Array of Char starts from 1, not 0. It should be:

    SCAR Code:
    Program new;
    Function RandomString(sLength: Integer): String;
    Var
      Let: String;
      I: Integer;
    Begin
      Let := 'abcdefghijklmnopqrstuvwxyzåäö0123456789';
      For I := 1 To sLength Do
        Result := Result + Let[Random(Length(Let))];
    End;
    begin
    RandomString(11);
    end.

    And Jack, I didn't say yours wouldn't compile...but why the hell would you just have a bunch of random letters? I was assuming you'd have a 'base' word to start off with, and then you added a few random letters.

    So much for constructive criticism:

    Santa, you're wrong.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  18. #18
    Join Date
    Sep 2007
    Location
    Michigan
    Posts
    3,862
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    0 is included in random() so you still get a error once in awhile so you have to do:
    SCAR Code:
    Function RandomString(sLength: Integer): String;
    Var
      Let: String;
      I: Integer;
    Begin
      Let := 'abcdefghijklmnopqrstuvwxyz0123456789';
      For I := 1 To sLength Do
        Result := Result + Let[Random(Length(Let))+1];
    End;

    begin
      writeln(RandomString(11));
    end.
    (Scripts outdated until I update for new SRL changes)
    AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
    If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
    Summer = me busy, won't be around much.

  19. #19
    Join Date
    Jan 2007
    Location
    BC, Canada
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    Why would you want to insert a random char in a random position?

    You can just go from start to end, and it will do the same thing.
    take a closer look at my code it insert's a random char at the end of the string not a random position.

  20. #20
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    Sorry to tell you people, but SCAR's "random" numbers are predictable
    Random() is not truly random, but you nor any human would be able to predict it, and more importantly, neither can jagex. So it is a random as we need it to be, and as far as we can tell, and for most people/me, that is close enough to omit the extra 6 letters (pseudo).

  21. #21
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I understand now...Jack has 2 accounts at SRL...which isn't allowed.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  22. #22
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    N3ss3s is getting you out of range because an Array of Char starts from 1, not 0. It should be:
    Oh crap, TNotArrayOfChars are taking me over!

    Join us... Join us...

    Knives were you here back then?

    Or just saw the thread and expected I was new back then?

    Anyhow, thanks freddy xD


    Umm why do you think Jack has two accs?

  23. #23
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by n3ss3s
    Knives were you here back then?
    Yes, I had another account with a ridiculous name... I was here for the scripts at the time... A leecher as we all started. I was looking through random scripts and saw yours on page 5 or something (I was bored).

    I got interested in SCAR and wanted a fresh start (Equals a new account), so I asked WT-Fakawi to remove my account (the one with the ridiculous name). But he denied (As I could just have been a hacker), so I just made this one. I've been happy ever since

    -Knives

  24. #24
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Okay, we should get back on topic, but umm whats the danger in deleting a hackers account from a request?

  25. #25
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Santa_Clause View Post
    N3ss3s is getting you out of range because an Array of Char starts from 1, not 0. It should be:

    SCAR Code:
    Program new;
    Function RandomString(sLength: Integer): String;
    Var
      Let: String;
      I: Integer;
    Begin
      Let := 'abcdefghijklmnopqrstuvwxyzåäö0123456789';
      For I := 1 To sLength Do
        Result := Result + Let[Random(Length(Let))];
    End;
    begin
    RandomString(11);
    end.

    And Jack, I didn't say yours wouldn't compile...but why the hell would you just have a bunch of random letters? I was assuming you'd have a 'base' word to start off with, and then you added a few random letters.

    So much for constructive criticism:
    You said mine didn't work, I wasn't attacking you.
    The point of this is to randomly generate passwords or create the illusion of an extremely frustrated autoer that isn't autoing.
    Active only during the Summer...

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
  •