Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- memory.usememorydomain("Combined WRAM")
- local p = memory.readbyte(0x03A54E) -- your position
- local t1 = {[1]=0x03A5B6,[2]=0x03A61E,[3]=0x03A686,[4]=0x03A6EE,[5]=0x03A756} --stick positions
- function move(d,a)
- if (d == true) then
- if (a == 4) and (p == 1) then
- joypad.set({left = 1})
- gui.drawText(3,3,"Loop reached",'RED')
- elseif (a == 4) and (p == 2) then
- joypad.set({A = true})
- elseif (a == 12) and (p == 0) then
- joypad.set({Right = true})
- elseif (a == 12) and (p == 2) then
- joypad.set({B = true})
- elseif (a == 18) and (p == 1) then
- joypad.set({Left = true})
- elseif (a == 18) and (p == 0) then
- joypad.set({A = true})
- end
- end
- end
- while true do
- for i = 1, 5 do
- if (memory.readbyte(t1[i]+2)<=0x10) then
- if (memory.readbyte(t1[i]) == 4) or (memory.readbyte(t1[i]) == 12) or (memory.readbyte(t1[i]) == 18) then
- move(true,memory.readbyte(t1[i])) end
- end
- end
- emu.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement