View difference between Paste ID: 8QDKd0Gr and N0iAKcP0
SHOW: | | - or go back to the newest paste.
1-
// SVN ONLY SCRIPT!
1+
2-
------------------------------------------------------------------------
2+
appendword = [$arg1 = (concatword (getalias $arg1) $arg2)]
3-
"#" = [arg0 = $arg1; result $arg1]
3+
clampval = [max $arg2 (min $arg3 $arg1)]
4
5-
clampval = [result (max $arg2 (min $arg3 $arg1))]
5+
6-
clampvalf = [result (maxf $arg2 (minf $arg3 $arg1))]
6+
	keychars = [ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890]
7
	_str = "" ; _num = (? $arg1 (clampval $arg1 3 10) 5)
8
	loop i $_num [
9-
    "keychars" = [ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890] ; k_code = ""
9+
		loop p (? @arg2 (clampval @arg2 3 8) 4) [
10-
    loop i (# (? $arg1 (clampval $arg1 3 10) 5)) [
10+
			appendword _str (substr $keychars (rnd (strlen $keychars)) 1)
11-
        loop p (? @arg2 (clampval @arg2 3 8) 4) [
11+
		]
12-
		k_code = (concatword $k_code (substr $keychars (rnd (strlen $keychars)) 1))
12+
		if (< $i (- $_num 1)) [append _str ""]
13
	]
14-
        if (!= $i (- $arg0 1)) [append k_code ""]
14+
	say (strreplace $_str " " "-")
15-
    ]
15+
16-
    say (strreplace $k_code " " "-")
16+
17
// use /keygen <section amount> <section length>
18
// like, /keygen 6 5