daily pastebin goal
15%
SHARE
TWEET

yelbotV2.lua

a guest Jun 16th, 2013 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local sf=string.format
  2. local save=savestate.saveslot
  3. local load=savestate.loadslot
  4.  
  5. local function set(s,b)
  6.   local input = joypad.get()
  7.   input[s]=b
  8.   joypad.set(input)
  9. end
  10. local function wait(x)
  11.   for i=1,x do emu.frameadvance() end
  12. end
  13. local function check(a,b,c,d)
  14.   local b1 = mainmemory.read_u8(0x1358)
  15.   local b2 = mainmemory.read_u8(0x1359)
  16.   if b1==0x64 and (b2==0xCF or b2==0xD0 or b2==0xEA) then
  17.     print(sf("%02X %02X %d %d %d %d",b1,b2,a,b,c,d))
  18.   end
  19.   --print(sf("%02X %02X",b1,b2))
  20. end
  21.  
  22. local t = {
  23.   {0,0,0,0},
  24.   {0,0,0,1},{0,0,1,0},{0,1,0,0},{1,0,0,0},
  25.   {0,0,0,2},{0,0,1,1},{0,0,2,0},{0,1,0,1},{0,1,1,0},{0,2,0,0},{1,0,0,1},{1,0,1,0},{1,1,0,0},{2,0,0,0},
  26.   {0,0,0,3},{0,0,1,2},{0,0,2,1},{0,0,3,0},{0,1,0,2},{0,1,1,1},{0,1,2,0},{0,2,0,1},{0,2,1,0},{0,3,0,0},{1,0,0,2},{1,0,1,1},{1,0,2,0},{1,1,0,1},{1,1,1,0},{1,2,0,0},{2,0,0,1},{2,0,1,0},{2,1,0,0},{3,0,0,0},
  27.   {0,0,0,4},{0,0,1,3},{0,0,2,2},{0,0,3,1},{0,0,4,0},{0,1,0,3},{0,1,1,2},{0,1,2,1},{0,1,3,0},{0,2,0,2},{0,2,1,1},{0,2,2,0},{0,3,0,1},{0,3,1,0},{0,4,0,0},{1,0,0,3},{1,0,1,2},{1,0,2,1},{1,0,3,0},{1,1,0,2},{1,1,1,1},{1,1,2,0},{1,2,0,1},{1,2,1,0},{1,3,0,0},{2,0,0,2},{2,0,1,1},{2,0,2,0},{2,1,0,1},{2,1,1,0},{2,2,0,0},{3,0,0,1},{3,0,1,0},{3,1,0,0},{4,0,0,0},
  28.   {0,0,0,5},{0,0,1,4},{0,0,2,3},{0,0,3,2},{0,0,4,1},{0,0,5,0},{0,1,0,4},{0,1,1,3},{0,1,2,2},{0,1,3,1},{0,1,4,0},{0,2,0,3},{0,2,1,2},{0,2,2,1},{0,2,3,0},{0,3,0,2},{0,3,1,1},{0,3,2,0},{0,4,0,1},{0,4,1,0},{0,5,0,0},{1,0,0,4},{1,0,1,3},{1,0,2,2},{1,0,3,1},{1,0,4,0},{1,1,0,3},{1,1,1,2},{1,1,2,1},{1,1,3,0},{1,2,0,2},{1,2,1,1},{1,2,2,0},{1,3,0,1},{1,3,1,0},{1,4,0,0},{2,0,0,3},{2,0,1,2},{2,0,2,1},{2,0,3,0},{2,1,0,2},{2,1,1,1},{2,1,2,0},{2,2,0,1},{2,2,1,0},{2,3,0,0},{3,0,0,2},{3,0,1,1},{3,0,2,0},{3,1,0,1},{3,1,1,0},{3,2,0,0},{4,0,0,1},{4,0,1,0},{4,1,0,0},{5,0,0,0},
  29.   {0,0,0,6},{0,0,1,5},{0,0,2,4},{0,0,3,3},{0,0,4,2},{0,0,5,1},{0,0,6,0},{0,1,0,5},{0,1,1,4},{0,1,2,3},{0,1,3,2},{0,1,4,1},{0,1,5,0},{0,2,0,4},{0,2,1,3},{0,2,2,2},{0,2,3,1},{0,2,4,0},{0,3,0,3},{0,3,1,2},{0,3,2,1},{0,3,3,0},{0,4,0,2},{0,4,1,1},{0,4,2,0},{0,5,0,1},{0,5,1,0},{0,6,0,0},{1,0,0,5},{1,0,1,4},{1,0,2,3},{1,0,3,2},{1,0,4,1},{1,0,5,0},{1,1,0,4},{1,1,1,3},{1,1,2,2},{1,1,3,1},{1,1,4,0},{1,2,0,3},{1,2,1,2},{1,2,2,1},{1,2,3,0},{1,3,0,2},{1,3,1,1},{1,3,2,0},{1,4,0,1},{1,4,1,0},{1,5,0,0},{2,0,0,4},{2,0,1,3},{2,0,2,2},{2,0,3,1},{2,0,4,0},{2,1,0,3},{2,1,1,2},{2,1,2,1},{2,1,3,0},{2,2,0,2},{2,2,1,1},{2,2,2,0},{2,3,0,1},{2,3,1,0},{2,4,0,0},{3,0,0,3},{3,0,1,2},{3,0,2,1},{3,0,3,0},{3,1,0,2},{3,1,1,1},{3,1,2,0},{3,2,0,1},{3,2,1,0},{3,3,0,0},{4,0,0,2},{4,0,1,1},{4,0,2,0},{4,1,0,1},{4,1,1,0},{4,2,0,0},{5,0,0,1},{5,0,1,0},{5,1,0,0},{6,0,0,0},
  30.   {0,0,0,7},{0,0,1,6},{0,0,2,5},{0,0,3,4},{0,0,4,3},{0,0,5,2},{0,0,6,1},{0,0,7,0},{0,1,0,6},{0,1,1,5},{0,1,2,4},{0,1,3,3},{0,1,4,2},{0,1,5,1},{0,1,6,0},{0,2,0,5},{0,2,1,4},{0,2,2,3},{0,2,3,2},{0,2,4,1},{0,2,5,0},{0,3,0,4},{0,3,1,3},{0,3,2,2},{0,3,3,1},{0,3,4,0},{0,4,0,3},{0,4,1,2},{0,4,2,1},{0,4,3,0},{0,5,0,2},{0,5,1,1},{0,5,2,0},{0,6,0,1},{0,6,1,0},{0,7,0,0},{1,0,0,6},{1,0,1,5},{1,0,2,4},{1,0,3,3},{1,0,4,2},{1,0,5,1},{1,0,6,0},{1,1,0,5},{1,1,1,4},{1,1,2,3},{1,1,3,2},{1,1,4,1},{1,1,5,0},{1,2,0,4},{1,2,1,3},{1,2,2,2},{1,2,3,1},{1,2,4,0},{1,3,0,3},{1,3,1,2},{1,3,2,1},{1,3,3,0},{1,4,0,2},{1,4,1,1},{1,4,2,0},{1,5,0,1},{1,5,1,0},{1,6,0,0},{2,0,0,5},{2,0,1,4},{2,0,2,3},{2,0,3,2},{2,0,4,1},{2,0,5,0},{2,1,0,4},{2,1,1,3},{2,1,2,2},{2,1,3,1},{2,1,4,0},{2,2,0,3},{2,2,1,2},{2,2,2,1},{2,2,3,0},{2,3,0,2},{2,3,1,1},{2,3,2,0},{2,4,0,1},{2,4,1,0},{2,5,0,0},{3,0,0,4},{3,0,1,3},{3,0,2,2},{3,0,3,1},{3,0,4,0},{3,1,0,3},{3,1,1,2},{3,1,2,1},{3,1,3,0},{3,2,0,2},{3,2,1,1},{3,2,2,0},{3,3,0,1},{3,3,1,0},{3,4,0,0},{4,0,0,3},{4,0,1,2},{4,0,2,1},{4,0,3,0},{4,1,0,2},{4,1,1,1},{4,1,2,0},{4,2,0,1},{4,2,1,0},{4,3,0,0},{5,0,0,2},{5,0,1,1},{5,0,2,0},{5,1,0,1},{5,1,1,0},{5,2,0,0},{6,0,0,1},{6,0,1,0},{6,1,0,0},{7,0,0,0},
  31.   {0,0,0,8},{0,0,1,7},{0,0,2,6},{0,0,3,5},{0,0,4,4},{0,0,5,3},{0,0,6,2},{0,0,7,1},{0,0,8,0},{0,1,0,7},{0,1,1,6},{0,1,2,5},{0,1,3,4},{0,1,4,3},{0,1,5,2},{0,1,6,1},{0,1,7,0},{0,2,0,6},{0,2,1,5},{0,2,2,4},{0,2,3,3},{0,2,4,2},{0,2,5,1},{0,2,6,0},{0,3,0,5},{0,3,1,4},{0,3,2,3},{0,3,3,2},{0,3,4,1},{0,3,5,0},{0,4,0,4},{0,4,1,3},{0,4,2,2},{0,4,3,1},{0,4,4,0},{0,5,0,3},{0,5,1,2},{0,5,2,1},{0,5,3,0},{0,6,0,2},{0,6,1,1},{0,6,2,0},{0,7,0,1},{0,7,1,0},{0,8,0,0},{1,0,0,7},{1,0,1,6},{1,0,2,5},{1,0,3,4},{1,0,4,3},{1,0,5,2},{1,0,6,1},{1,0,7,0},{1,1,0,6},{1,1,1,5},{1,1,2,4},{1,1,3,3},{1,1,4,2},{1,1,5,1},{1,1,6,0},{1,2,0,5},{1,2,1,4},{1,2,2,3},{1,2,3,2},{1,2,4,1},{1,2,5,0},{1,3,0,4},{1,3,1,3},{1,3,2,2},{1,3,3,1},{1,3,4,0},{1,4,0,3},{1,4,1,2},{1,4,2,1},{1,4,3,0},{1,5,0,2},{1,5,1,1},{1,5,2,0},{1,6,0,1},{1,6,1,0},{1,7,0,0},{2,0,0,6},{2,0,1,5},{2,0,2,4},{2,0,3,3},{2,0,4,2},{2,0,5,1},{2,0,6,0},{2,1,0,5},{2,1,1,4},{2,1,2,3},{2,1,3,2},{2,1,4,1},{2,1,5,0},{2,2,0,4},{2,2,1,3},{2,2,2,2},{2,2,3,1},{2,2,4,0},{2,3,0,3},{2,3,1,2},{2,3,2,1},{2,3,3,0},{2,4,0,2},{2,4,1,1},{2,4,2,0},{2,5,0,1},{2,5,1,0},{2,6,0,0},{3,0,0,5},{3,0,1,4},{3,0,2,3},{3,0,3,2},{3,0,4,1},{3,0,5,0},{3,1,0,4},{3,1,1,3},{3,1,2,2},{3,1,3,1},{3,1,4,0},{3,2,0,3},{3,2,1,2},{3,2,2,1},{3,2,3,0},{3,3,0,2},{3,3,1,1},{3,3,2,0},{3,4,0,1},{3,4,1,0},{3,5,0,0},{4,0,0,4},{4,0,1,3},{4,0,2,2},{4,0,3,1},{4,0,4,0},{4,1,0,3},{4,1,1,2},{4,1,2,1},{4,1,3,0},{4,2,0,2},{4,2,1,1},{4,2,2,0},{4,3,0,1},{4,3,1,0},{4,4,0,0},{5,0,0,3},{5,0,1,2},{5,0,2,1},{5,0,3,0},{5,1,0,2},{5,1,1,1},{5,1,2,0},{5,2,0,1},{5,2,1,0},{5,3,0,0},{6,0,0,2},{6,0,1,1},{6,0,2,0},{6,1,0,1},{6,1,1,0},{6,2,0,0},{7,0,0,1},{7,0,1,0},{7,1,0,0},{8,0,0,0},
  32.   {0,0,0,9},{0,0,1,8},{0,0,2,7},{0,0,3,6},{0,0,4,5},{0,0,5,4},{0,0,6,3},{0,0,7,2},{0,0,8,1},{0,0,9,0},{0,1,0,8},{0,1,1,7},{0,1,2,6},{0,1,3,5},{0,1,4,4},{0,1,5,3},{0,1,6,2},{0,1,7,1},{0,1,8,0},{0,2,0,7},{0,2,1,6},{0,2,2,5},{0,2,3,4},{0,2,4,3},{0,2,5,2},{0,2,6,1},{0,2,7,0},{0,3,0,6},{0,3,1,5},{0,3,2,4},{0,3,3,3},{0,3,4,2},{0,3,5,1},{0,3,6,0},{0,4,0,5},{0,4,1,4},{0,4,2,3},{0,4,3,2},{0,4,4,1},{0,4,5,0},{0,5,0,4},{0,5,1,3},{0,5,2,2},{0,5,3,1},{0,5,4,0},{0,6,0,3},{0,6,1,2},{0,6,2,1},{0,6,3,0},{0,7,0,2},{0,7,1,1},{0,7,2,0},{0,8,0,1},{0,8,1,0},{0,9,0,0},{1,0,0,8},{1,0,1,7},{1,0,2,6},{1,0,3,5},{1,0,4,4},{1,0,5,3},{1,0,6,2},{1,0,7,1},{1,0,8,0},{1,1,0,7},{1,1,1,6},{1,1,2,5},{1,1,3,4},{1,1,4,3},{1,1,5,2},{1,1,6,1},{1,1,7,0},{1,2,0,6},{1,2,1,5},{1,2,2,4},{1,2,3,3},{1,2,4,2},{1,2,5,1},{1,2,6,0},{1,3,0,5},{1,3,1,4},{1,3,2,3},{1,3,3,2},{1,3,4,1},{1,3,5,0},{1,4,0,4},{1,4,1,3},{1,4,2,2},{1,4,3,1},{1,4,4,0},{1,5,0,3},{1,5,1,2},{1,5,2,1},{1,5,3,0},{1,6,0,2},{1,6,1,1},{1,6,2,0},{1,7,0,1},{1,7,1,0},{1,8,0,0},{2,0,0,7},{2,0,1,6},{2,0,2,5},{2,0,3,4},{2,0,4,3},{2,0,5,2},{2,0,6,1},{2,0,7,0},{2,1,0,6},{2,1,1,5},{2,1,2,4},{2,1,3,3},{2,1,4,2},{2,1,5,1},{2,1,6,0},{2,2,0,5},{2,2,1,4},{2,2,2,3},{2,2,3,2},{2,2,4,1},{2,2,5,0},{2,3,0,4},{2,3,1,3},{2,3,2,2},{2,3,3,1},{2,3,4,0},{2,4,0,3},{2,4,1,2},{2,4,2,1},{2,4,3,0},{2,5,0,2},{2,5,1,1},{2,5,2,0},{2,6,0,1},{2,6,1,0},{2,7,0,0},{3,0,0,6},{3,0,1,5},{3,0,2,4},{3,0,3,3},{3,0,4,2},{3,0,5,1},{3,0,6,0},{3,1,0,5},{3,1,1,4},{3,1,2,3},{3,1,3,2},{3,1,4,1},{3,1,5,0},{3,2,0,4},{3,2,1,3},{3,2,2,2},{3,2,3,1},{3,2,4,0},{3,3,0,3},{3,3,1,2},{3,3,2,1},{3,3,3,0},{3,4,0,2},{3,4,1,1},{3,4,2,0},{3,5,0,1},{3,5,1,0},{3,6,0,0},{4,0,0,5},{4,0,1,4},{4,0,2,3},{4,0,3,2},{4,0,4,1},{4,0,5,0},{4,1,0,4},{4,1,1,3},{4,1,2,2},{4,1,3,1},{4,1,4,0},{4,2,0,3},{4,2,1,2},{4,2,2,1},{4,2,3,0},{4,3,0,2},{4,3,1,1},{4,3,2,0},{4,4,0,1},{4,4,1,0},{4,5,0,0},{5,0,0,4},{5,0,1,3},{5,0,2,2},{5,0,3,1},{5,0,4,0},{5,1,0,3},{5,1,1,2},{5,1,2,1},{5,1,3,0},{5,2,0,2},{5,2,1,1},{5,2,2,0},{5,3,0,1},{5,3,1,0},{5,4,0,0},{6,0,0,3},{6,0,1,2},{6,0,2,1},{6,0,3,0},{6,1,0,2},{6,1,1,1},{6,1,2,0},{6,2,0,1},{6,2,1,0},{6,3,0,0},{7,0,0,2},{7,0,1,1},{7,0,2,0},{7,1,0,1},{7,1,1,0},{7,2,0,0},{8,0,0,1},{8,0,1,0},{8,1,0,0},{9,0,0,0},
  33. }
  34.  
  35. --savestate 9 at frame 334
  36.  
  37. for i=1,#t do
  38.   local a=t[i][1]
  39.   local b=t[i][2]
  40.   local c=t[i][3]
  41.   local d=t[i][4]
  42.   if b~=1 then
  43.     load(9)
  44.     wait(0+a)
  45.     set("Start",true)
  46.     wait(61+b)
  47.     set("A",true)
  48.     wait(157+c)
  49.     set("Start",true)
  50.     wait(110+d)
  51.     set("A",true)
  52.     wait(30)
  53.     check(a,b,c,d)
  54.   end
  55. end
  56.  
  57. emu.frameadvance()
  58. print("lua finished")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top