Advertisement
Kaztalek

speedvector.lua

Nov 29th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. --"speedvector.lua"
  2. --For use in MM (U) on BizHawk 1.9.1
  3.  
  4. --Addresses:
  5. local lAddr = 0x400880 --linear velocity
  6. local yAddr = 0x3FFE18 --y velocity
  7.  
  8. while true do
  9.     height = client.screenheight()
  10.     ySpeed = memory.readfloat(yAddr, true)
  11.     linSpeed = memory.readfloat(lAddr, true)
  12.     totalSpeed = math.sqrt(math.pow(ySpeed, 2) + math.pow(linSpeed, 2))
  13.     gui.text(0, height-48, "Linear Velocity: " .. linSpeed)
  14.     gui.text(0, height-34, "Y-velocity: " .. ySpeed)
  15.     gui.text(0, height-20, "Total Speed: " .. totalSpeed)
  16.     emu.frameadvance()
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement