# HG changeset patch # User Paper <37962225+mrpapersonic@users.noreply.github.com> # Date 1666135385 14400 # Node ID 96e5d721538ff4f3e939d6da472e5a4da20c0897 # Parent 66dc98750bc4074b88ab1ca3cbfa5a550647c64d Update mod7.nsb committer: GitHub diff -r 66dc98750bc4 -r 96e5d721538f mod7.nsb --- a/mod7.nsb Tue Oct 18 18:42:18 2022 -0400 +++ b/mod7.nsb Tue Oct 18 19:23:05 2022 -0400 @@ -1,5 +1,5 @@ {if:{argslen}|=|1|then:{ -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: +if:{arg:0}|=|--oem|then:{set:day|{range:1|365}}{repeat:{len:{substring:{repeat:3|a}|{len:{get:day}}}}|0}{get:day}{choose:95|96|97|98|99|00|01|02|03}-OEM-{lua: function sumdigits(n) local sum = 0 while n > 0 do @@ -11,8 +11,9 @@ the = 1 while (sumdigits(the) % 7 ~= 0) do - the = (math.random(1, 99999)*10)+math.random(1,7) + the = math.random(1, 99999) end +the = (the*10)+math.random(1,7) print(string.format("%07d", the)) }-{set:day|{range:1|99999}}{repeat:{len:{substring:{repeat:5|a}|{len:{get:day}}}}|0}{get:day}|else: {set:first|{range:111|999}}{ @@ -25,8 +26,17 @@ if:{get:first}|=|999|then:{set:first|998}}{get:first}{ if:{arg:0}|=|--office|then:{ if:{substring:{get:first}|2|3}|=|9|then:0|else:{len:{repeat:{substring:{get:first}|2|3}|a}{repeat:1|a}}}}-{lua: +function sumdigits(n) + local sum = 0 + while n > 0 do + sum = sum + n%10 + n = math.floor(n/10) + end + return sum +end + the = 1 -while (the % 7 ~= 0) do +while (sumdigits(the) % 7 ~= 0) do the = (math.random(1, 999999)*10)+math.random(1,7) end print(string.format("%07d", the))