Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Charlie uses the following formula for calculating delays:
- -- BaseDelay + [808C99C + [3000C77]]
- -- BaseDelay = 120 for the first round and when Samus shoots too early
- -- BaseDelay = 240 for the second, third, and fourth rounds
- -- 3000C77 is a 1 byte frame counter, so its values range from 0-255
- -- 808C99C is the location of a table containing the values 0-255 in a random order
- -- Therefore, the best delay is 120 or 240, while the worst delay is 375 or 495
- -- This script displays three different things:
- -- The current timer value is in the top left corner
- -- The first column shows what the new timer value will be if Charlie
- -- is hit successfully within the first n frames it becomes vulnerable
- -- The second column shows what the new timer value will be
- -- if Samus hits Charlie too early within the next n frames
- -- change this value to see a different number of frames
- frameWindow = 18
- while true do
- -- display timer
- local timer = memory.readword(0x3000814)
- gui.text(2, 2, timer)
- -- calculate delay if Charlie is successfully hit
- local frame = memory.readbyte(0x3000C77)
- -- calculation is done 3 frames after being hit
- local vulnerable = (timer + frame + 3) % 256
- for i=1,frameWindow do
- local delay = memory.readbyte(0x808C99C + vulnerable)
- color = { delay, 255 - delay, 32 }
- gui.text(18, -6 + i*8, 240 + delay, color)
- vulnerable = (vulnerable + 1) % 256
- end
- -- calculate delay if Samus shoots too early
- for i=1,frameWindow do
- local delay = memory.readbyte(0x808C99C + frame)
- color = { delay, 255 - delay, 32 }
- gui.text(34, -6 + i*8, 120 + delay, color)
- frame = (frame + 1) % 256
- end
- vba.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement