Advertisement
Kaztalek

Weirdshot Macro

Feb 6th, 2015
545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.94 KB | None | 0 0
  1. --Name "weirdshot.lua" (with quotes)
  2. --For use in MM (U) on BizHawk 1.9.1
  3. --Gives first frame weirdshot
  4. --Assumes you are human, have bomb bag, and can use bombs in the area
  5. --Place the item you want to weirdshot with on c-right. If a valid item isn't there, hookshot is placed on c-right.
  6. --Adds 1 to your bomb count and temporarily puts bombs on c-left if they weren't there already. C-left is then replaced back with what was there before the script was ran.
  7. --Can't guarantee this will always work due to space, slopes, enemies, or lag. This was tested on flat, open surfaces.
  8. --Addresses:
  9. --c-left  0x1EF6BD
  10. --c-right 0x1EF6BF
  11. --bomb count 0x1EF716
  12.  
  13. local cleft = memory.readbyte(0x1EF6BD)
  14. local cright = memory.readbyte(0x1EF6BF)
  15.  
  16. memory.writebyte(0x1EF716, memory.readbyte(0x1EF716)+1)
  17. if  cleft ~= 6 then
  18.     memory.writebyte(0x1EF6BD, 6)
  19. end
  20. if  cright ~= 15 and cright ~= 1 and cright ~= 74 and cright ~= 75 and cright ~= 76 then
  21.     memory.writebyte(0x1EF6BF, 15) 
  22. end
  23. emu.frameadvance()
  24.  
  25. local frame = 1
  26. while frame <= 234 do
  27.     if frame <= 21 then
  28.         joypad.setfrommnemonicstr("|..|    0,    0,.........Z.....ll.|")
  29.     elseif frame <= 33 then
  30.         joypad.setfrommnemonicstr("|..|    0,    0,.........Z......l.|")
  31.     elseif frame <= 36 then
  32.         joypad.setfrommnemonicstr("|..|  127, -128,.........Z......lr|")
  33.     elseif frame <= 81 then
  34.         joypad.setfrommnemonicstr("|..|  127, -128,.........Z......l.|")
  35.     elseif frame <= 96 then
  36.         joypad.setfrommnemonicstr("|..|    0,    0,.........Z....r.lr|")
  37.     elseif frame >= 178 and frame <= 180 then
  38.         joypad.setfrommnemonicstr("|..|    0,    0,.........Z.A....l.|")
  39.     elseif frame <= 186 then
  40.         joypad.setfrommnemonicstr("|..|    0,    0,.........Z......l.|")
  41.     elseif frame <= 222 then
  42.         joypad.setfrommnemonicstr("|..| -128, -128,.........Z......l.|")
  43.     else
  44.         joypad.setfrommnemonicstr("|..| -128, -128,.........Z....r.l.|")
  45.     end
  46.     frame = frame + 1
  47.     emu.frameadvance()
  48. end
  49. memory.writebyte(0x1EF6BD, cleft)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement