Guest User

Untitled

a guest
Aug 17th, 2013
61
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. lastXpos = 0
  2. lastYpos = 0
  3. lasttimer = 0
  4. lastXcam = 0
  5. lastYcam = 0
  6. lagged = false
  7.  
  8. function Stuff()
  9. Xpos = memory.readbyte(0x4c1)
  10. Ypos = memory.readbyte(0x4c3)
  11. timer = memory.readbyte(0xd9)
  12. Xcam = memory.readbyte(0x368)
  13. Ycam = memory.readbyte(0x369)
  14.  
  15. Xspd = Xpos - lastXpos
  16. Yspd = Ypos - lastYpos
  17. Xcamspd = Xcam - lastXcam
  18. Ycamspd = Ycam - lastYcam
  19.  
  20. gui.text( 70, 208, string.format("X: %d\nY: %d",Xpos,Ypos))
  21. gui.text(170, 208, string.format("Xcam: %4d\nYcam: %4d",Xcam,Ycam))
  22. gui.text(115, 208, string.format("Tmr: %d",timer))
  23. gui.text(Xpos, Ypos, string.format("%.2f\n%.2f",Xspd,Yspd), "#00ff00ff")
  24.  
  25. lastXpos = Xpos
  26. lastYpos = Ypos
  27. lasttimer = timer
  28. lastXcam = Xcam
  29. lastYcam = Ycam
  30.  
  31. end
  32.  
  33. function DetectLag()
  34. lagflag = true
  35. end
  36. function SetLag()
  37. if lagflag then
  38. emu.setlagflag(false);
  39. lagflag = false;
  40. else
  41. emu.setlagflag(true);
  42. end
  43. end
  44. memory.registerexecute(0xfd7d, DetectLag)
  45. memory.registerexecute(0x802E, SetLag)
  46. emu.registerafter(Stuff)
RAW Paste Data