Mercurial > codedump
comparison mod7.nsb @ 106:66dc98750bc4
Update mod7.nsb
committer: GitHub <noreply@github.com>
author | Paper <37962225+mrpapersonic@users.noreply.github.com> |
---|---|
date | Tue, 18 Oct 2022 18:42:18 -0400 |
parents | bf6d6304f6f7 |
children | 96e5d721538f |
comparison
equal
deleted
inserted
replaced
105:bf6d6304f6f7 | 106:66dc98750bc4 |
---|---|
1 {if:{argslen}|=|1|then:{ | 1 {if:{argslen}|=|1|then:{ |
2 if:{arg:0}|=|--oem|then:{choose:95|96|97|98|99|00|01|02|03}{range:100|365}-OEM-{lua: | 2 if:{arg:0}|=|--oem|then:{choose:95|96|97|98|99|00|01|02|03}{set:day|{range:1|365}}{repeat:{len:{substring:{repeat:3|a}|{len:{get:day}}}}|0}{get:day}-OEM-{lua: |
3 function sumdigits(n) | 3 function sumdigits(n) |
4 local sum = 0 | 4 local sum = 0 |
5 while n > 0 do | 5 while n > 0 do |
6 sum = sum + n%10 | 6 sum = sum + n%10 |
7 n = math.floor(n/10) | 7 n = math.floor(n/10) |
12 the = 1 | 12 the = 1 |
13 while (sumdigits(the) % 7 ~= 0) do | 13 while (sumdigits(the) % 7 ~= 0) do |
14 the = (math.random(1, 99999)*10)+math.random(1,7) | 14 the = (math.random(1, 99999)*10)+math.random(1,7) |
15 end | 15 end |
16 print(string.format("%07d", the)) | 16 print(string.format("%07d", the)) |
17 }-{range:10000|99999}|else: | 17 }-{set:day|{range:1|99999}}{repeat:{len:{substring:{repeat:5|a}|{len:{get:day}}}}|0}{get:day}|else: |
18 {set:first|{range:111|999}}{ | 18 {set:first|{range:111|999}}{ |
19 if:{get:first}|=|333|then:{set:first|332}}{ | 19 if:{get:first}|=|333|then:{set:first|332}}{ |
20 if:{get:first}|=|444|then:{set:first|443}}{ | 20 if:{get:first}|=|444|then:{set:first|443}}{ |
21 if:{get:first}|=|555|then:{set:first|554}}{ | 21 if:{get:first}|=|555|then:{set:first|554}}{ |
22 if:{get:first}|=|666|then:{set:first|665}}{ | 22 if:{get:first}|=|666|then:{set:first|665}}{ |
29 while (the % 7 ~= 0) do | 29 while (the % 7 ~= 0) do |
30 the = (math.random(1, 999999)*10)+math.random(1,7) | 30 the = (math.random(1, 999999)*10)+math.random(1,7) |
31 end | 31 end |
32 print(string.format("%07d", the)) | 32 print(string.format("%07d", the)) |
33 }} | 33 }} |
34 |else:`.t mod7 <--normal> OR <--office> OR <--oem>`} | 34 |else:{code: |
35 MOD7(1) | |
36 | |
37 NAME | |
38 mod7 | |
39 | |
40 SYNOPSIS | |
41 .t mod7 [ option ] | |
42 | |
43 DESCRIPTION | |
44 A generator for old Microsoft products using the | |
45 mod7 key algorithm. | |
46 | |
47 OPTIONS | |
48 --normal | |
49 Generate a normal Windows 95/NT 4 key. | |
50 --office | |
51 Generate a normal Office 97 key. | |
52 --oem | |
53 Generate an OEM Windows 95/NT 4 key. | |
54 }} |