Advertisement
Guest User

Untitled

a guest
Jun 19th, 2015
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. memory.usememorydomain("Combined WRAM")
  2. local p = memory.readbyte(0x03A54E) -- your position
  3. local t1 = {[1]=0x03A5B6,[2]=0x03A61E,[3]=0x03A686,[4]=0x03A6EE,[5]=0x03A756} --stick positions
  4.  
  5. function move(d,a)
  6. if (d == true) then
  7. if (a == 4) and (p == 1) then
  8. joypad.set({left = 1})
  9. gui.drawText(3,3,"Loop reached",'RED')
  10. elseif (a == 4) and (p == 2) then
  11. joypad.set({A = true})
  12. elseif (a == 12) and (p == 0) then
  13. joypad.set({Right = true})
  14. elseif (a == 12) and (p == 2) then
  15. joypad.set({B = true})
  16. elseif (a == 18) and (p == 1) then
  17. joypad.set({Left = true})
  18. elseif (a == 18) and (p == 0) then
  19. joypad.set({A = true})
  20. end
  21. end
  22. end
  23. while true do
  24. for i = 1, 5 do
  25. if (memory.readbyte(t1[i]+2)<=0x10) then
  26. if (memory.readbyte(t1[i]) == 4) or (memory.readbyte(t1[i]) == 12) or (memory.readbyte(t1[i]) == 18) then
  27. move(true,memory.readbyte(t1[i])) end
  28. end
  29. end
  30. emu.frameadvance()
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement