• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# dq5commonrng

a guest Jan 19th, 2012 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. while true do
5.         offset = 0xFF
6.
7.         for j = 1, 5 do
8.
9.         offset = 0xFF
10.
11.         for i = 1, 8 do
12.
13.         resist = seed2
14.         resist = bit.bxor(resist, offset)
15.         carry = math.floor(seed1 * 2 / 256)
16.         seed1 = seed1 * 2 % 256
17.         seed2 = (seed2 * 2) % 256 + carry
18.         offset = offset * 2 % 256
19.         resist = resist * 2
20.         if resist > 255 then
21.                 seed1 = bit.bxor(seed1, 0x21)
22.                 seed2 = bit.bxor(seed2, 0x10)
23.         end
24.         end
25.
26.         offset = 0xFF
27.
28.         for i = 1, 8 do
29.
30.         resist = seed2
31.         resist = bit.bxor(resist, offset)
32.         carry = math.floor(seed1 * 2 / 256)
33.         seed1 = seed1 * 2 % 256
34.         seed2 = (seed2 * 2) % 256 + carry
35.         offset = offset * 2 % 256
36.         resist = resist * 2
37.         if resist > 255 then
38.                 seed1 = bit.bxor(seed1, 0x21)
39.                 seed2 = bit.bxor(seed2, 0x10)
40.         end
41.         end
42.
43.         count = count + 1
44.
45.         gui.text(10,10*(j+4),((seed1+1)%256).." "..seed2.." "..((seed1+1+count)%256))
46.
47.         if j == 3 then
48.                 seed3 = seed1
49.                 seed4 = seed2
50.                 count2 = count
51.         end
52.
53.         end
54.
55.         seed3 = seed3 + 2
56.
57.         for j = 1, 5 do
58.
59.         offset = 0xFF
60.
61.         for i = 1, 8 do
62.
63.         resist = seed4
64.         resist = bit.bxor(resist, offset)
65.         carry = math.floor(seed3 * 2 / 256)
66.         seed3 = seed3 * 2 % 256
67.         seed4 = (seed4 * 2) % 256 + carry
68.         offset = offset * 2 % 256
69.         resist = resist * 2
70.         if resist > 255 then
71.                 seed3 = bit.bxor(seed3, 0x21)
72.                 seed4 = bit.bxor(seed4, 0x10)
73.         end
74.         end
75.
76.         offset = 0xFF
77.
78.         for i = 1, 8 do
79.
80.         resist = seed4
81.         resist = bit.bxor(resist, offset)
82.         carry = math.floor(seed3 * 2 / 256)
83.         seed3 = seed3 * 2 % 256
84.         seed4 = (seed4 * 2) % 256 + carry
85.         offset = offset * 2 % 256
86.         resist = resist * 2
87.         if resist > 255 then
88.                 seed3 = bit.bxor(seed3, 0x21)
89.                 seed4 = bit.bxor(seed4, 0x10)
90.         end
91.         end
92.
93.         count2 = count2 + 1
94.
95.         gui.text(10,10*(j+10),((seed3+1)%256).." "..seed4.." "..((seed3+1+count2)%256))
96.
97.         end