User File #638185264480958107

Upload All User Files

#638185264480958107 - dino advance script

dinosaurrawr.lua
100 downloads
Uploaded 5/1/2023 8:27 AM by Cephla (see all 19)
ror
local obstacle = 1

function advance()
    joypad.set({Down=false, A=false})
    for i = 1, 14 do
        emu.frameadvance()
    end
end

while true do
    if mainmemory.readbyte(0x1602) < 60 or mainmemory.readbyte(0x1622) < 60 then
        joypad.set({Down=false})
        joypad.set({A=true})
        emu.frameadvance()
        if mainmemory.readbyte(0x1602) < 255 and obstacle == 1 then
            advance()
            for i = 1, 10 do
                joypad.set({Down=true})
                emu.frameadvance()
            end
        elseif mainmemory.readbyte(0x1622) < 255 and obstacle == 2 then
            advance()
            for i = 1, 10 do
                joypad.set({Down=true})
                emu.frameadvance()
            end 
        end
    else
        emu.frameadvance()
    end
    if obstacle == 1 then
        obstacle = obstacle + 1
    else
        obstacle = obstacle - 1
    end
end