Advertisement
Blazephlozard

Boing! lua

Jun 18th, 2020
1,291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.29 KB | None | 0 0
  1. function initLag()
  2.  
  3.     for i=1,movie.length() do
  4.         j = movie.getinput(i-1, 1)
  5.         if (j["Left"] or j["Right"]) then
  6.             tastudio.setlag(i, false)
  7.             for lags=1,12 do
  8.                 tastudio.setlag(i+lags, true)
  9.             end
  10.         elseif (j["Up"] or j["Down"]) then
  11.             tastudio.setlag(i, false)
  12.             for lags=1,13 do
  13.                 tastudio.setlag(i+lags, true)
  14.             end
  15.         end
  16.     end
  17.  
  18. end
  19.  
  20. --this function should mark all the appropriate lag frames without having to play through the run. not fully tested
  21. --initLag()
  22.  
  23. while true do
  24.     isLagged = false
  25.     if (not tastudio.islag(emu.framecount()-14)) then
  26.         j = movie.getinput(emu.framecount()-14, 1)
  27.         if (j["Up"] or j["Down"]) then
  28.             tastudio.setlag(emu.framecount(), true)
  29.             isLagged = true
  30.         end
  31.     end
  32.     if (not isLagged) then
  33.         for i=emu.framecount()-13,emu.framecount()-2 do
  34.             j = movie.getinput(i, 1)
  35.             if (not tastudio.islag(i)) then
  36.                 if (j["Left"] or j["Right"] or j["Up"] or j["Down"]) then
  37.                     tastudio.setlag(emu.framecount(), true)
  38.                     isLagged = true
  39.                 end
  40.             end
  41.         end
  42.     end
  43.    
  44.     --this could print in the console when it finds a wait frame, but it's easier to just look
  45.     --[[j = movie.getinput(emu.framecount()-1,1)
  46.     if (not isLagged and not (j["Left"] or j["Right"] or j["Up"] or j["Down"])) then
  47.         print(j)
  48.     end]]
  49.    
  50.     emu.frameadvance()
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement