Language: lua
local RNG = 0x7E00FB
local DROP_TABLE = 0xC0BA8D
local dropPattern = 1
function itemPrediction(x, y, num)
local key = input.get()
if(key.numpad0 == true) then
dropPattern = 0
end
if(key.numpad1 == true) then
dropPattern = 1
end
if(key.numpad2 == true) then
dropPattern = 2
end
if(key.numpad3 == true) then
dropPattern = 3
end
if(key.numpad4 == true) then
dropPattern = 4
end
if(key.numpad5 == true) then
dropPattern = 5
end
if(dropPattern == 0) then
return
end
gui.text(x + 2, y + 0x1C, string.format("%d", dropPattern))
local rng = memory.readword(RNG)
local val
local drop
local dropTable = memory.readbyterange(DROP_TABLE + 8 * (dropPattern), 8)
local color = {}
color[8] = "#00FF00" --life small
color[7] = "#00FF00" --life big
color[6] = "#0000FF" --weapon small
color[5] = "#0000FF" --weapon big
color[4] = "#FF0000" --bolt small
color[3] = "#FF0000" --bolt big
color[2] = "#FFFF00" --1up
color[1] = "#808080" --nothing
color[0] = "#FFFFFF" --background
gui.drawbox(x, y + 8, x + num, y + 0x18, color[0])
for i = 0, num do
val = bit.band(bit.rshift(bit.band(rng * 3, 0xFF00), 8) + rng, 0xFF)
drop = 8
for j = 0, 7 do
val = val - dropTable[8 - j]
if(val < 0) then
break
end
drop = drop - 1
end
gui.line(x + i, y + 0x18 - bit.rshift(rng, 12), x + i, y + 0x18, color[drop])
if(drop == 3 or drop == 5 or drop == 7) then
gui.drawline(x + i, y + 0x19, x + i, y + 0x1A, color[drop])
end
rng = bit.band(rng * 3, 0xFF00) + bit.band(bit.rshift(bit.band(rng * 3, 0xFF00), 8) + rng, 0xFF)
end
end
while true do
itemPrediction(0, 0xBC, 0xA0)
snes9x.frameadvance()
end
Press numpad 1~5 changes drop pattern. When you press zero, script disappears.
Green: Life energy, Blue: Weapon energy, Red: Bolt, Yellow: 1up, Gray: nothing
A bar which overflows under the frame means a big one.