Advertisement
0xwas

smrpg lua

Jun 30th, 2012
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.96 KB | None | 0 0
  1. local posy=7
  2.  
  3. function smvinfo()
  4.         local hours = math.floor(movie.framecount()/216000)
  5.         local minutes = math.floor((movie.framecount() - hours*216000)/3600)
  6.         local seconds = math.floor((movie.framecount() - hours*216000 - minutes*3600)/60)
  7.         local frames = (movie.framecount() - hours*216000 -  minutes*3600 - seconds*60)*5/3
  8.  
  9.     if movie.playing () == true then
  10.         gui.text(1,1,string.format("frames:%d/%d (%d:%02d:%02d.%02d)\nlags:%d\nrerecords:%d",movie.framecount(), movie.length(),hours,minutes,seconds,frames,emu.lagcount(), movie.rerecordcount ()))
  11.     elseif movie.recording() == true then
  12.         gui.text(1,1,string.format("frames:%d (%d:%02d:%02d.%02d)\nlags:%d\nrerecords:%d",movie.framecount(),hours,minutes,seconds,frames,emu.lagcount(), movie.rerecordcount ()))
  13.     else
  14.         gui.text(1,1,string.format("frames:%d (%d:%02d:%02d.%02d,no movie)\nlags:%d",emu.framecount(),hours,minutes,seconds,frames,emu.lagcount()))
  15.     end
  16. end
  17.  
  18. function placeboautotext()
  19.     local convo=memory.readbyte(0x7E0210)
  20.     local convo2=memory.readbyte(0x7E06E1)
  21.     if convo == 163 or convo2 == 140 then
  22.         joypad.set(1, {A = true})
  23.     end
  24. end
  25.  
  26.  
  27. function draw()
  28.     -- enemy HPs
  29.     local e1=memory.readword(0x7EFC11)
  30.     local e2=memory.readword(0x7EFC91)
  31.     local e3=memory.readword(0x7EFD11)
  32.     local e4=memory.readword(0x7EFD91)
  33.     local e5=memory.readword(0x7EFE11)
  34.     local e6=memory.readword(0x7EFE91)
  35.     --party HPs
  36.     local p1=memory.readword(0x7EFA91)
  37.     local p2=memory.readword(0x7EFB11)
  38.     local p3=memory.readword(0x7EFB91)
  39.     --position in field
  40.     local x=memory.readword(0x702002)
  41.     local y=memory.readword(0x702000)
  42.     local z=memory.readword(0x702004)
  43.     --other infomation
  44.     local coin=memory.readword(0x7FF8AF)
  45.     local fcoin=memory.readbyte(0x7FF8B3)
  46.     local fp=memory.readbyte(0x7EFA0C)
  47.     local mfp=memory.readbyte(0x7EFA0D)
  48.     local ffp=memory.readbyte(0x7FF8B1) -- Field FP
  49.     local fmfp=memory.readbyte(0x7FF8B2) --Field maxFP
  50.     local jump=memory.readbyte(0x7EE010) -- Jump power
  51.     local firec=memory.readbyte(0x702D6C) -- number of fbs you did
  52.     local firet=memory.readbyte(0x702D6D)
  53.     local damage=memory.readword(0x7E00C2)
  54.     local field=memory.readbyte(0x7E000A)
  55.     local field2=memory.readbyte(0x7E01D8)
  56.     --charactar exps
  57.     local mexp=memory.readword(0x7FF80A)
  58.     local mexp2=memory.readword(0x7FF85A)
  59.     local gexp=memory.readword(0x7FF846)
  60.     local bexp=memory.readword(0x7FF832)
  61.     local pexp=memory.readword(0x7FF81E)
  62.     --charactar LVs and future exp in battle
  63.     local mlv=memory.readbyte(0x7FF800)
  64.     local mlv2=memory.readbyte(0x7FF850)
  65.     local glv=memory.readbyte(0x7FF83C)
  66.     local blv=memory.readbyte(0x7FF828)
  67.     local plv=memory.readbyte(0x7FF814)
  68.     local gaexp=memory.readword(0x7EFA02)
  69.     --charactar accessory
  70.     local mac=memory.readbyte(0x7FF80E)
  71.     local mac2=memory.readbyte(0x7FF85E)
  72.     local gac=memory.readbyte(0x7FF84A)
  73.     local bac=memory.readbyte(0x7FF836)
  74.     local pac=memory.readbyte(0x7FF822)
  75.  
  76.  
  77.         if e2 == 21845 then
  78.             e2 = 0
  79.         end
  80.         if e3 == 21845 then
  81.             e3 = 0
  82.         end
  83.         if e4 == 21845 then
  84.             e4 = 0
  85.         end
  86.         if e5 == 21845 then
  87.             e5 = 0
  88.         end
  89.         if e6 == 21845 then
  90.             e6 = 0
  91.         end
  92.  
  93.         if p2 == 21845 then
  94.             p2 = 0
  95.         end
  96.  
  97.         if p3 == 21845 then
  98.             p3 = 0
  99.         end
  100.  
  101.         if firec > 100 or firet > 100 then
  102.             firec,firet = 0,0
  103.         end
  104.  
  105.         if damage > 9000 then
  106.             damage=0
  107.         end
  108.  
  109.         --who equips Exp. Booster
  110.         if mac==80 and field == 6 or mac==80 and field ==2 and field2 == 2 then
  111.             gui.text(172,9,"*")
  112.         elseif pac==80 and field == 6 or pac==80 and field ==2 and field2 == 2 then
  113.             gui.text(172,41,"*")
  114.         elseif mac2==80 and field == 6 or mac2==80 and field ==2 and field2 == 2 then
  115.             gui.text(172,17,"*")
  116.         elseif gac==80 and field == 6 or gac==80 and field ==2 and field2 == 2 then
  117.             gui.text(172,25,"*")
  118.         elseif bac==80 and field == 6 or bac==80 and field ==2 and field2 == 2 then
  119.             gui.text(172,33,"*")
  120.         end
  121.        
  122.         if field == 2 then
  123.             gui.text(1,1*posy*4,string.format("x:%d\ny:%d\nz:%d",x,y,z))
  124.             gui.text(1,1*posy*8,string.format("coin:%d\nfrog:%d\nfp:%d/%d",coin,fcoin,ffp,fmfp))
  125.         if field2 == 2 then
  126.             gui.text(180,1,"---exp(lv)---")
  127.             gui.text(180,9,string.format("Mario  : %d(%d) \nMallow : %d(%d)\n Geno  : %d(%d)\nBowser : %d(%d)\nPeach  : %d(%d)",mexp,mlv,mexp2,mlv2,gexp,glv,bexp,blv,pexp,plv))
  128.         end
  129.  
  130.         elseif field == 6 then
  131.             gui.text(1,posy*4,"-enemy")
  132.             gui.text(1,1+posy*5,string.format("e1:%d\ne2:%d\ne3:%d\ne4:%d\ne5:%d\ne6:%d",e1,e2,e3,e4,e5,e6))
  133.             gui.text(1,posy*13,"-party")
  134.             gui.text(1,1+posy*14,string.format("p1:%d\np2:%d\np3:%d",p1,p2,p3))
  135.             gui.text(1,posy*18,"-misc")
  136.             gui.text(1,1+posy*19,string.format("FP:%d/%d\njump:%d",fp,mfp,jump))
  137.             gui.text(1,1+posy*22,string.format("FBcount:%d\nFBtimer:%d\ndmg:%d",firec,firet,damage))
  138.             gui.text(180,1,"---exp(lv)---")
  139.             gui.text(180,9,string.format("Mario  : %d(%d) \nMallow : %d(%d)\n Geno  : %d(%d)\nBowser : %d(%d)\nPeach  : %d(%d)\nexpgain: %d",mexp,mlv,mexp2,mlv2,gexp,glv,bexp,blv,pexp,plv,gaexp))
  140.         end
  141. end
  142.  
  143. while true do
  144.     smvinfo()
  145.     placeboautotext()
  146.     draw()
  147.     emu.frameadvance()
  148. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement