Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Filename = "yolo.state"
- TimeoutConstant = 80
- rightmost = 0
- timeout = TimeoutConstant
- function initializeRun()
- savestate.load(Filename)
- rightmost = 0
- timeout = TimeoutConstant
- end
- function getPositions()
- marioX = memory.read_s16_le(0x94)
- marioY = memory.read_s16_le(0x96)
- local layer1x = memory.read_s16_le(0x1A);
- local layer1y = memory.read_s16_le(0x1C);
- screenX = marioX-layer1x
- screenY = marioY-layer1y
- end
- initializeRun()
- while true do
- getPositions()
- if marioX > rightmost then
- rightmost = marioX
- timeout = TimeoutConstant
- end
- if timeout <= 0 then
- initializeRun()
- end
- timeout = timeout - 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement