Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- index = 1
- rns = { 13, 2, 6, 8, 7, 9, 14, 10, 2, 4, 14, 4, 12, 15, 13, 12, 11, 1, 3, 15, 0, 6, 7, 8, 11, 5, 0, 3, 5, 1, 9, 10 }
- while true do
- if memory.readword(0x30001C0 + index*56) > 0 then
- -- display eyedoor activation region
- local cameraX, cameraY = memory.readword(0x30013B8), memory.readword(0x30013BA)
- local enemyX, enemyY = memory.readword(0x30001B0 + index*56), memory.readword(0x30001AE + index*56)
- local xStart = bit.arshift(enemyX - 0x1C0 - cameraX, 2)
- local yStart = bit.arshift(enemyY - 0x80 - cameraY, 2)
- local xEnd = bit.arshift(enemyX + 0x1C0 - cameraX, 2)
- local yEnd = bit.arshift(enemyY + 0x80 - cameraY, 2)
- gui.box(xStart, yStart, xEnd, yEnd, "#00F00020", "#20C020")
- -- check if in range
- local samusX, samusY = memory.readword(0x30013E6), memory.readword(0x30013E8)
- if math.abs(samusX - enemyX) < 0x1C0 and math.abs(samusY - enemyY) < 0x80 then
- gui.text(3, 11, "In", "green")
- else
- gui.text(3, 11, "Out", "red")
- end
- -- calculate when eyedoor will open
- local timer1 = memory.readbyte(0x30001D8 + index*56)
- local frame1 = (memory.readbyte(0x3000C77) + timer1) % 256
- local frame2 = (memory.readword(0x3000002) + timer1) % 65536
- local enRN = rns[((frame1 + bit.rshift(frame2, 4) + index + enemyX + enemyY) % 32) + 1]
- local timer2 = timer1 + 61 + enRN * 4
- frame1 = (memory.readbyte(0x3000C77) + timer2) % 256
- frame2 = (memory.readword(0x3000002) + timer2) % 65536
- enRN = rns[((frame1 + bit.rshift(frame2, 4) + index + enemyX + enemyY) % 32) + 1]
- local timer3 = timer2 + 61 + enRN * 4
- gui.text(3, 19, timer1)
- gui.text(3, 27, timer2)
- gui.text(3, 35, timer3)
- end
- vba.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement