viewing paste Unknown #15685 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
function        script  getrand_code    {
 
        if(getarg(0) <= 0) return 0;
 
        setarray .@chars$[0], "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K",
 
                                                  "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
 
                                                  "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g",
 
                                                  "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r",
 
                                                  "s", "t", "u", "v", "w", "x", "y", "z", "1", "2", "3",
 
                                                  "4", "5", "6", "7",  "8", "9", "0", "!", "§", "$", "%",
 
                                                  "&", "/", "(", ")", "=", "?", "-", "_", ",", ".", "<",
 
                                                  ">", "|", "+", "#", "*", "~";
 
                                                 
 
        set .@rand_code$, "";
 
        for(set .@i, 0; .@i < getarg(0); .@i++)
 
                set .@rand_code$, .@rand_code$ + .@chars$[rand(0,getarraysize(.@chars$)-1)]; //generating random code here by using rand()
 
        return .@rand_code$;
 
}
Viewed 548 times, submitted by Guest.