Advertisement
Guest User

Untitled

a guest
May 22nd, 2021
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.62 KB | None | 0 0
  1. -- This Lua Script is for Romancing SaGa 2 on lsnes.
  2.  
  3. -- version 2.
  4. -- set colours, added RNG and SP Graph.
  5.  
  6. -- Wagnus Prism Light (0x01, 0x09, 0x0B, 0x14, 0x22, 0x25, 0x27, 0x34, 0x3B, 0x40, 0x4E, 0x54, 0x55, 0x65, 0x6A, 0x93, 0x94, 0xAC, 0xBC, 0xBD, 0xBE, 0xCB, 0xE0, 0xE2, 0xE3, 0xE6, 0xE7)
  7.  
  8. --[[    -- I don't know how to translate below six lines.
  9. --memory.usememorydomain("CARTROM") -- BizHawk
  10. --~     rng = {}
  11. --~ for i = 0, 0xFF do
  12. --~     rng[i+1] = memory.readbyte(0xC2EF04+i)  --rng[i] = i-1 (rng[0] = 1, ... , rng[256] = 255)
  13.     -- 0x02EF04-0x02F003
  14. --~ end
  15. ]]  -- instead the above,
  16. rng = {234, 101,    90, 123,    244,    71, 14, 170,    71, 159,    57, 155,    90, 227,    177,    132,    141,    238,    114,    128,    84, 52, 51, 24, 121,    169,    210,    228,    35, 25, 34, 97, 9,  215,    93, 202,    3,  40, 220,    43, 94, 179,    201,    232,    39, 102,    102,    248,    80, 158,    48, 13, 100,    242,    235,    220,    46, 132,    231,    103,    7,  35, 122,    191,    174,    48, 147,    206,    96, 142,    226,    152,    145,    12, 97, 236,    252,    137,    209,    20, 115,    216,    245,    222,    144,    145,    147,    43, 77, 80, 10, 68, 142,    40, 10, 45, 166,    182,    185,    191,    241,    30, 209,    51, 246,    96, 0,  229,    59, 208,    152,    12, 182,    37, 102,    28, 20, 210,    34, 17, 34, 66, 223,    104,    46, 137,    124,    236,    168,    176,    88, 177,    200,    184,    104,    86, 17, 228,    113,    111,    236,    124,    108,    52, 72, 133,    239,    70, 85, 181,    155,    182,    228,    141,    90, 156,    8,  229,    9,  223,    215,    223,    68, 148,    33, 122,    240,    248,    205,    74, 204,    127,    74, 8,  11, 249,    192,    122,    78, 60, 102,    244,    144,    226,    58, 96, 56, 6,  105,    150,    115,    3,  67, 1,  30, 52, 226,    188,    193,    174,    135,    188,    246,    106,    182,    43, 188,    231,    165,    254,    135,    183,    134,    134,    157,    118,    177,    100,    130,    165,    204,    49, 10, 110,    101,    205,    83, 56, 163,    147,    188,    39, 131,    227,    31, 94, 193,    89, 215,    37, 103,    137,    238,    205,    32, 30, 106,    238,    71, 191,    143,    88, 86, 135,    41, 86,}
  17. rngCol = {}
  18. for i = 0, 0xFF do
  19.     residue20 = rng[i+1] % 0x20
  20.     residue40 = rng[i+1] % 0x40
  21.     if residue40 == 0 then  -- rare drop
  22.         rngCol[i+1] = "blue"
  23.     elseif residue20 == 0 then  -- normal drop
  24.         rngCol[i+1] = "lightgreen"
  25.     elseif rng[i+1] < 0x1F then -- waza 7
  26.         rngCol[i+1] = "pink"
  27.     elseif rng[i+1] < 0x32 then -- waza same level
  28.         rngCol[i+1] = "yellow"
  29.     else
  30.         rngCol[i+1] = "white"
  31.     end
  32. end
  33.  
  34. --memory.usememorydomain("WRAM")    -- BizHawk
  35.  
  36. sel = 0
  37. valueSP = {}
  38. ipg0 = 0
  39. ipg1 = 0
  40. msg1 = 0
  41. msg0 = 0
  42. btlOn = 1
  43. lastStart = 0
  44. lastEnd = 0
  45.  
  46. on_paint = function()
  47.     gui.right_gap(600);
  48.  
  49.     -- for supporting scrolling text messages and inputting battle commands. If you'd like to use it, uncomment below five lines, please.
  50. --~     msg1 = memory.readbyte(0x7E1F01)
  51. --~     if msg1 ==  0 and msg0 ~= 0 then
  52. --~         print("msg ", movie.framecount())
  53. --~     end
  54. --~     msg0 = msg1
  55.  
  56.     local Xpos
  57.     local Ypos
  58.     Xpos = memory.readbyte(0x7E1342)
  59.     Ypos = memory.readbyte(0x7E13D6)
  60.     gui.text(970, 0, string.format("(%X,%X)", Xpos, Ypos))
  61.  
  62.     local EP
  63.     local totalBattle
  64.     local battle
  65.     local safe
  66.     local safe2 = {}
  67.     local Hiraga
  68.     EP = memory.readbyte(0x7EF693)
  69.     totalBattle = memory.readword(0x7EF8AE)
  70.     battle = memory.readbyte(0x7EF694)
  71.     safe = memory.readbyte(0x7EF7A2) + 0x100 * memory.readbyte(0x7EF7A3) + 0x10000 * memory.readbyte(0x7EF7A4)
  72.     safe2[1] = math.floor(safe/1000000)
  73.     safe2[2] = math.floor((safe-(safe2[1]*1000000))/1000)
  74.     safe2[3] = safe - (safe2[1]*1000000)-(safe2[2]*1000)
  75.     Hiraga = memory.readbyte(0x7EF697)
  76.  
  77.     if safe2[1] ~= 0 then
  78.         gui.text(970, 12, string.format("%3d,%03d,%03d", safe2[1], safe2[2], safe2[3]))
  79.     elseif safe2[2] ~= 0 then
  80.         gui.text(970, 12, string.format("%3d,%03d", safe2[2], safe2[3]))
  81.     else
  82.         gui.text(970, 12, string.format("%3d", safe2[3]))
  83.     end
  84.     gui.text(970, 24, string.format("EP %d", EP))
  85.     gui.text(970, 36, string.format("%d/%d", battle, totalBattle))
  86.     gui.text(970, 48, string.format("%dsei", Hiraga))
  87.     local jump
  88.     local battle16 = battle % 0x10
  89.  
  90.     if EP >= battle16 then
  91.         if battle < 0x30 then
  92.             jump = battle16 + 0x30
  93.         else
  94.             jump = battle
  95.         end
  96. --~         gui.text(512, 50, string.format("jump%d", jump))
  97. --~         gui.text(512, 62, string.format("tBtl%d->%d", totalBattle, totalBattle + math.floor(jump/4)))
  98. --~         gui.text(512, 74, string.format("%dsei->%dsei", Hiraga, Hiraga + math.floor((jump/0x20) + (1/2))))
  99.     end
  100.  
  101.     local gameMode
  102.     gameMode = memory.readbyte(0x7FAFC7)
  103. --~     gui.text(512, 0, sel)
  104.     selectKey = memory.readbyte(0x7E0D12)
  105.     if  gameMode == 1 and selectKey == 0x20 then
  106.         ipg1 = 1
  107.     else
  108.         ipg1 = 0
  109.     end
  110.     if gameMode == 1 and ipg1 == 1 and ipg0 == 0 then
  111.         sel = sel + 1
  112.     end
  113.     ipg0 = ipg1
  114.  
  115.     local comSelect = memory.readbyte(0x7E0D1A)
  116.     local numParty = memory.readbyte(0x7EF618)
  117.     if gameMode ~= 1 then
  118. --~         if comSelect < 0 or comSelect >= numParty then
  119.             for j = 0, 0xF do
  120.                 for i = 0, 0xF do
  121.                     gui.text(545+i*26, 5, string.format("%2X", i), "gray")
  122.                     gui.text(545+i*26, 27+j*20, string.format("%2X", rng[1+i+0x10*j]), rngCol[1+i+0x10*j])
  123.                     gui.text(520, 27+j*20, string.format("%2X", 0x10*j), "gray")
  124.                 end
  125.             end
  126. --~         end
  127.     end
  128.     local currentRNG = memory.readbyte(0x7E0D1F)
  129.     gui.rectangle(545-2+(currentRNG-16*math.floor(currentRNG/16))*26, 27+20*math.floor(currentRNG/16), 26, 20, 1, "yellow")
  130.  
  131.     n = 2
  132.     a = 3
  133.     b = 2
  134.     gui.rectangle(752, 448-100, n-1, 100, 1, "lightgreen", "lightgreen")
  135.     if gameMode ~= 1 then
  136. --~         if comSelect < 0 or comSelect >= numParty then
  137.             gui.rectangle(750, 448-a*math.floor(rng[currentRNG+1]/8), 2*n, a*math.floor(rng[currentRNG+1]/8), 1, "black", rngCol[currentRNG+1])
  138.             for i=0, 106/n do
  139.                 local k = (currentRNG+i+1+1) % 0x100
  140.                 if k == 0 then
  141.                     k = 0x100
  142.                 end
  143.                 gui.rectangle(754+i*2*n, 448-a*math.floor(rng[k]/8), 2*n, a*math.floor(rng[k]/8), 1, "black", rngCol[k])
  144.             end
  145.             for j=0, 118/n do
  146.                 local k = (currentRNG-j-1+1) % 0x100
  147.                 if k == 0 then
  148.                     k = 0x100
  149.                 end
  150.                 gui.rectangle(746-j*2*n, 448-a*math.floor(rng[k]/8), 2*n, a*math.floor(rng[k]/8), 1, "black", rngCol[k])
  151.             end
  152.             gui.text(753, 448-100, string.format("%2X->%2X", currentRNG, rng[currentRNG+1]), "lightgreen")
  153. --~         end
  154.     end
  155.  
  156.     local EV = memory.readbyte(0x7E0D80)    -- current effect value
  157.     gui.text(970, 329, string.format("EV %d", EV))
  158.  
  159.     local currentRNG = memory.readbyte(0x7E0D1F)
  160.     gui.text(970, 341, string.format("RNG %2X->%2X", currentRNG, rng[currentRNG+1]), "yellow")
  161.     local preRNG = (currentRNG-1) % 0x100
  162.     gui.text(970, 353, string.format("    %2X->%2X", preRNG, rng[preRNG+1]), "gray")
  163.  
  164.     defP = {}
  165.     for i = 1, 5 do
  166.         defP[i] = {}
  167.             for j = 1, 8 do
  168. --~                 defP[i][j] = memory.readbyte(0x7EF055 + 0x100*(i-1) + j-1)  -- joined order
  169.                 defP[i][j] = memory.readbyte(0x7EAA55 + 0x100*(i-1) + j-1)  -- order in battles
  170.             end
  171.     end
  172.  
  173.     if gameMode == 1 then
  174.         local x = 965
  175.         local y = 90
  176.         local gap = 12
  177.         gui.text(x, y, "srd")
  178.         gui.text(x, y+gap, "axe")
  179.         gui.text(x, y+gap*2, "spr")
  180.         gui.text(x, y+gap*3, "arw")
  181.         gui.text(x, y+gap*4, "heat")
  182.         gui.text(x, y+gap*5, "cold")
  183.         gui.text(x, y+gap*6, "elec")
  184.         gui.text(x, y+gap*7, "sprt")
  185.  
  186.         for i = 1, 5 do
  187.             for j = 1, 8 do
  188.                 gui.text(x+12+24*i, y+gap*(j-1), defP[i][j])
  189.             end
  190.         end
  191.     end
  192.  
  193.     agility = {}
  194.     SP = {}
  195.     SPCol = {}
  196.     HP = {}
  197.     nonbtlHP = {}
  198.     for i = 1, 5 do
  199.         agility[i] = memory.readbyte(0x7EAA65+0x0100*(i-1))
  200.         HP[i] = memory.readword(0x7EAA0E + 0x100*(i-1))
  201.         nonbtlHP[i] = memory.readword(0x7EF010 + 0x100*(i-1))
  202.     end
  203.  
  204.     -- for checking the first characters' HP, especially Bear(3rd). If you'd like to use it, uncomment below three lines, please.
  205. --~     for i = 1, 5 do
  206. --~         gui.text(1080, 0+12*(i-1), HP[i])
  207. --~     end
  208.  
  209.     eHP = {}
  210.     eMHP = {}
  211.     eAgi = {}
  212.     eEXP = {}
  213.     eWaza={}
  214.     monsID = {}
  215.     local monNum
  216.     monNum = memory.readbyte(0x7E0D22)
  217.     --for i=1, monNum do
  218.     for i=1, 6 do
  219.         eHP[i] = memory.readword(0x7EA00E+0x100*(i-1))
  220.         eMHP[i] = memory.readbyte(0x7EA010+0x100*(i-1))
  221.         eAgi[i] = memory.readbyte(0x7EA065 + 0x100*(i-1))
  222.         eWaza[i] = memory.readbyte(0x7EA018 + 0x100*(i-1))
  223.         monsID[i] = memory.readword(0x7E1203 + 0x5*(i))
  224.     end
  225.  
  226.     if monNum > 6 then
  227.         monNum = 6
  228.     end
  229.     local gameMode
  230.     gameMode = memory.readbyte(0x7FAFC7)
  231.     if gameMode == 1 then
  232.         gui.text(970, 245, "HP")
  233.         gui.text(1010, 245, "Agi")
  234.         gui.text(1040, 245, "WLvl")
  235.         for i=1, monNum do
  236.             gui.text(970, 260+12*(i-1), string.format("%2d", eHP[i]))
  237.             gui.text(1015, 260+12*(i-1), string.format("%d", eAgi[i]))
  238.             gui.text(1035, 260+12*(i-1), string.format("%2d", eWaza[i]))
  239.         end
  240.     end
  241.  
  242.     for i = 1, 5 do
  243.         SP[i] = {}
  244.         SPCol[i] = {}
  245.         for j = 0, 0xFF do
  246.             SP[i][j+1] = (agility[i])*2 + (rng[1+(j)] % ((agility[i])*2)) + 1
  247.             if (SP[i][j+1] > math.floor( agility[i] * (7/2)) ) then
  248.                 SPCol[i][j+1] = "aqua"
  249.             elseif (SP[i][j+1] < math.floor( agility[i] * 5/2) ) then
  250.                 SPCol[i][j+1] = "pink"
  251.             else
  252.                 SPCol[i][j+1] = "white"
  253.             end
  254.         end
  255.     end
  256.  
  257.     local comSelect = memory.readbyte(0x7E0D1A)
  258.     local numParty = memory.readbyte(0x7EF618)
  259.     if gameMode == 1 then
  260.         if comSelect >= 0 and comSelect < numParty then
  261.             for j = 0, 0xF do
  262.                 for i = 0, 0xF do
  263.                     gui.text(545+i*26, 5, string.format("%2X", i), "gray")
  264.                     if sel % 2 == 0 then
  265.                         gui.text(545+i*26, 27+j*20, string.format("%2d", SP[comSelect+1][1+i+0x10*j]), SPCol[comSelect+1][1+i+0x10*j])
  266.                     else
  267.                         gui.text(545+i*26, 27+j*20, string.format("%2X", rng[1+i+0x10*j]), rngCol[1+i+0x10*j])
  268.                     end
  269.                     gui.text(520, 27+j*20, string.format("%2X", 0x10*j), "gray")
  270.                 end
  271.             end
  272.             local currentRNG = memory.readbyte(0x7E0D1F)
  273.             gui.rectangle(545-2+(currentRNG-16*math.floor(currentRNG/16))*26, 27+20*math.floor(currentRNG/16), 26, 20, 1, "yellow")
  274.         else
  275.             for j = 0, 0xF do
  276.                 for i = 0, 0xF do
  277.                     gui.text(545+i*26, 5, string.format("%2X", i), "gray")
  278.                     gui.text(545+i*26, 27+j*20, string.format("%2X", rng[1+i+0x10*j]), rngCol[1+i+0x10*j])
  279.                     gui.text(520, 27+j*20, string.format("%2X", 0x10*j), "gray")
  280.                 end
  281.             end
  282.         end
  283.     end
  284.  
  285.     gotSP = {}
  286.     local comSelect = memory.readbyte(0x7E0D1A)
  287.     for i = 1, comSelect do
  288.         gotSP[i] = memory.readbyte(0x7E0DD7 + (i-1))
  289.         if gotSP[i] ~= 0 then
  290.             valueSP[i] = gotSP[i]
  291.         end
  292.     end
  293.  
  294.     local numParty = memory.readbyte(0x7EF618)
  295.     local gameMode
  296.     gameMode = memory.readbyte(0x7FAFC7)
  297.     if gameMode == 1 then
  298.         if countSP ~= numParty then
  299.             if comSelect >= 0 and comSelect < numParty+1 then
  300.                 for i = 1, comSelect do
  301.                     if valueSP[i] ~= 0 then
  302.                         gui.text(970, 380+(i-1)*12, string.format("       %3d", valueSP[i]))
  303.                     end
  304.                 end
  305.             end
  306.         end
  307.     end
  308.  
  309.     local gameMode = memory.readbyte(0x7FAFC7)
  310.     local t = movie.framecount()
  311.     if btlOn ~= gameMode and gameMode ~= 1 then
  312.         lastEnd = t
  313.         btlTime = lastEnd - lastStart
  314.         print(string.format("btlEnd %d, btlTime %d", t, btlTime))
  315.     end
  316.     if btlOn ~= gameMode and gameMode ~= 0 then
  317.         lastStart = t
  318.         print(string.format("btlStart %d", t))
  319.     end
  320.     btlOn = gameMode
  321.  
  322.     local numParty
  323.     local comSelect = memory.readbyte(0x7E0D1A)
  324.     local currentRNG = memory.readbyte(0x7E0D1F)
  325.     local numParty = memory.readbyte(0x7EF618)
  326.  
  327.     if numParty < 6 then
  328.         if comSelect >=0 and comSelect <  numParty then
  329.             gui.text(970, 365, string.format("SP  %2X->%2d", currentRNG, SP[comSelect+1][currentRNG+1]), SPCol[comSelect+1][currentRNG+1])
  330.         end
  331.     end
  332.  
  333.     if gameMode == 1 then
  334.         if comSelect >= 0 and comSelect < numParty then
  335.             if sel % 2 == 0 then
  336.                 if currentRNG == 0xFF then
  337.                     currentRNG = 0
  338.                 end
  339.                 gui.rectangle(750, 448-b*math.floor(SP[comSelect+1][currentRNG+1]/a), 2*n, b*math.floor(SP[comSelect+1][currentRNG+1]/a), 1, "black", SPCol[comSelect+1][currentRNG+1])
  340.                 local currentRNG = memory.readbyte(0x7E0D1F)
  341.                 for i=0, 106/n do
  342.                     k = (currentRNG+i+1+1) % 0x100
  343.                     if k == 0 then
  344.                         k = 0x100
  345.                     end
  346.                     gui.rectangle(754+i*2*n, 448-b*math.floor(SP[comSelect+1][k]/a), 2*n, b*math.floor(SP[comSelect+1][k]/a), 1, "black", SPCol[comSelect+1][k])
  347.                 end
  348.                 for j=0, 118/n do
  349.                     k = (currentRNG-j-1+1) % 0x100
  350.                     if k == 0 then
  351.                         k = 0x100
  352.                     end
  353.                     gui.rectangle(746-j*2*n, 448-b*math.floor(SP[comSelect+1][k]/a), 2*n, b*math.floor(SP[comSelect+1][k]/a), 1, "black", SPCol[comSelect+1][k])
  354.                 end
  355.                 local comSelect = memory.readbyte(0x7E0D1A)
  356.                 numParty = memory.readbyte(0x7EF618)
  357.                 if comSelect >= 0 and comSelect < numParty then
  358.                     if currentRNG == 0xFF then
  359.                         currentRNG = 0
  360.                     end
  361.                 end
  362.                 gui.text(753, 448-100,string.format("%2X->%2d", currentRNG, SP[comSelect+1][currentRNG+1]), "lightgreen")
  363.             else
  364.                 gui.rectangle(750, 448-a*math.floor(rng[currentRNG+1]/8), 2*n, a*math.floor(rng[currentRNG+1]/8), 1, "black", rngCol[currentRNG+1])
  365.                 for i=0, 106/n do
  366.                     local k = (currentRNG+i+1+1) % 0x100
  367.                     if k == 0 then
  368.                         k = 0x100
  369.                     end
  370.                     gui.rectangle(754+i*2*n, 448-a*math.floor(rng[k]/8), 2*n, a*math.floor(rng[k]/8), 1, "black", rngCol[k])
  371.                 end
  372.                 for j=0, 118/n do
  373.                     local k = (currentRNG-j-1+1) % 0x100
  374.                     if k == 0 then
  375.                         k = 0x100
  376.                     end
  377.                     gui.rectangle(746-j*2*n, 448-a*math.floor(rng[k]/8), 2*n, a*math.floor(rng[k]/8), 1, "black", rngCol[k])
  378.                 end
  379.                 gui.text(753, 448-100, string.format("%2X->%2X", currentRNG, rng[currentRNG+1]), "lightgreen")
  380.             end
  381.         else
  382.             gui.rectangle(750, 448-a*math.floor(rng[currentRNG+1]/8), 2*n, a*math.floor(rng[currentRNG+1]/8), 1, "black", rngCol[currentRNG+1])
  383.             for i=0, 106/n do
  384.                 local k = (currentRNG+i+1+1) % 0x100
  385.                 if k == 0 then
  386.                     k = 0x100
  387.                 end
  388.                 gui.rectangle(754+i*2*n, 448-a*math.floor(rng[k]/8), 2*n, a*math.floor(rng[k]/8), 1, "black", rngCol[k])
  389.             end
  390.             for j=0, 118/n do
  391.                 local k = (currentRNG-j-1+1) % 0x100
  392.                 if k == 0 then
  393.                     k = 0x100
  394.                 end
  395.                 gui.rectangle(746-j*2*n, 448-a*math.floor(rng[k]/8), 2*n, a*math.floor(rng[k]/8), 1, "black", rngCol[k])
  396.             end
  397.             gui.text(753, 448-100, string.format("%2X->%2X", currentRNG, rng[currentRNG+1]), "lightgreen")
  398.         end
  399.     end
  400.  
  401.  
  402.     --[[
  403.     local comSelect = memory.readbyte(0x7E0D1A)
  404.     local numParty = memory.readbyte(0x7EF618)
  405.     local agilityTest = 20
  406.     local SPTest = {}
  407.     local SPTestCol = {}
  408.     local rngMod = {}
  409.     local rngModCol = {}
  410.     agilityTest = 20
  411.     print(agilityTest)
  412.     for j = 0, 0xFF do
  413.         SPTest[j+1] = (agilityTest)*2 + (rng[1+(j)] % (agilityTest*2)) + 1
  414.         if (SPTest[j+1] > math.floor( agilityTest * (7/2)) ) then
  415.             SPTestCol[j+1] = "aqua"
  416.         elseif (SPTest[j+1] < math.floor( agilityTest * 5/2) ) then
  417.             SPTestCol[j+1] = "pink"
  418.         else
  419.             SPTestCol[j+1] = "white"
  420.         end
  421.         rngMod[j+1] = rng[1+(j)] % 4    -- change values
  422.         if rngMod[j+1] == 0 then
  423.             rngModCol[j+1] = "red"
  424.         else
  425.             rngModCol[j+1] = "white"
  426.         end
  427.     end
  428.     for j = 0, 0xF do
  429.         for i = 0, 0xF do
  430.             gui.text(545+i*26, 5, string.format("%2X", i), "gray")
  431. --~             gui.text(545+i*26, 27+j*20, string.format("%2d", SPTest[1+i+0x10*j]), SPTestCol[1+i+0x10*j])
  432. --~             gui.text(545+i*26, 27+j*20, string.format("%2d", rngMod[1+i+0x10*j]), rngCol[1+i+0x10*j])
  433.             gui.text(545+i*26, 27+j*20, string.format("%2d", rngMod[1+i+0x10*j]), rngModCol[1+i+0x10*j])
  434.             gui.text(520, 27+j*20, string.format("%2X", 0x10*j), "gray")
  435.         end
  436.     end
  437.     local currentRNG = memory.readbyte(0x7E0D1F)
  438.     gui.rectangle(545-2+(currentRNG-16*math.floor(currentRNG/16))*26, 27+20*math.floor(currentRNG/16), 26, 20, 1, "yellow")
  439.     ]]
  440.     --[[
  441.     gui.rectangle(750, 448-b*math.floor(SPTest[currentRNG+1]/a), 2*n, b*math.floor(SPTest[currentRNG+1]/a), 1, "black", SPTestCol[currentRNG+1])
  442.     for i=0, 106/n do
  443.         local k = (currentRNG+i+1+1) % 0x100
  444.         if k == 0 then
  445.             k = 0x100
  446.         end
  447.         gui.rectangle(754+i*2*n, 448-b*math.floor(SPTest[k]/a), 2*n, b*math.floor(SPTest[k]/a), 1, "black", SPTestCol[k])
  448.     end
  449.     for j=0, 118/n do
  450.         local k = (currentRNG-j-1+1) % 0x100
  451.         if k == 0 then
  452.             k = 0x100
  453.         end
  454.         gui.rectangle(746-j*2*n, 448-b*math.floor(SPTest[k]/a), 2*n, b*math.floor(SPTest[k]/a), 1, "black", SPTestCol[k])
  455.     end
  456.     gui.text(753, 448-100, string.format("%2X->%2d", currentRNG, SPTest[currentRNG+1]), "lightgreen")
  457.     ]]
  458.     --[[
  459.     d = 25
  460. --~     gui.rectangle(750, 448-d*math.floor(rngMod[currentRNG+1]), 2*n, d*math.floor(rngMod[currentRNG+1]), 1, "black", rngCol[currentRNG+1])
  461.     gui.rectangle(750, 448-d*math.floor(rngMod[currentRNG+1]), 2*n, d*math.floor(rngMod[currentRNG+1]), 1, "black", rngModCol[currentRNG+1])
  462.     for i=0, 106/n do
  463.         local k = (currentRNG+i+1+1) % 0x100
  464.         if k == 0 then
  465.             k = 0x100
  466.         end
  467. --~         gui.rectangle(754+i*2*n, 448-d*math.floor(rngMod[k]), 2*n, d*math.floor(rngMod[k]), 1, "black", rngCol[k])
  468.         gui.rectangle(754+i*2*n, 448-d*math.floor(rngMod[k]), 2*n, d*math.floor(rngMod[k]), 1, "black", rngModCol[k])
  469.     end
  470.     for j=0, 118/n do
  471.         local k = (currentRNG-j-1+1) % 0x100
  472.         if k == 0 then
  473.             k = 0x100
  474.         end
  475. --~         gui.rectangle(746-j*2*n, 448-d*math.floor(rngMod[k]), 2*n, d*math.floor(rngMod[k]), 1, "black", rngCol[k])
  476.         gui.rectangle(746-j*2*n, 448-d*math.floor(rngMod[k]), 2*n, d*math.floor(rngMod[k]), 1, "black", rngModCol[k])
  477.     end
  478.     gui.text(753, 448-100, string.format("%2X->%2X", currentRNG, rngMod[currentRNG+1]), "lightgreen")
  479.     ]]
  480.  
  481.  
  482. end
  483.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement