Advertisement
Guest User

Untitled

a guest
Apr 12th, 2016
99
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Luascript for bizhawk 1.11.6
  2. -- by mugg1991
  3. -- Gremlins 2 The New Batch gb
  4.  
  5. function text(x, y, text, color)
  6.     gui.pixelText(x, y, text,color,0x00000000)
  7. end
  8.  
  9. ----------------------------------------------------------------------
  10. local drawFrameCountAndInput = function(x,y)
  11.  
  12.     if movie.mode()=="PLAY" then
  13.         text(x, y,emu.framecount().."/"..movie.length(),0xFFFFFFFF)
  14.     else
  15.         text(x, y,emu.framecount(),0xFFFFFFFF)
  16.     end
  17.        
  18.     text(x, y+8,emu.lagcount(),0xFFF05050)
  19.  
  20.     if emu.islagged() then
  21.         text(x-5, y+8,"*",0xFFF05050)
  22.     end
  23.    
  24.     local inputtable = {}
  25.    
  26.     if movie.mode()=="INACTIVE" then
  27.         inputtable = joypad.getimmediate()
  28.     elseif movie.mode()=="PLAY" or movie.mode()=="RECORD" then
  29.         inputtable = movie.getinput(emu.framecount()-1)
  30.     end
  31.    
  32.     local buttons = {["Up"]="^", ["Down"]="v", ["Left"]="<", ["Right"]=">", ["Select"]="s", ["Start"]="S", ["A"]="A", ["B"]="B", ["L"]="L", ["R"]="R"}
  33.     local s = ""
  34.     for k,v in pairs(inputtable) do
  35.         if v==true then
  36.             s=s..buttons[k]
  37.         end
  38.     end
  39.     text(x,y+16,s,0xFFffffff)
  40.  
  41. end
  42.  
  43. function hex(num)
  44.    local dig = 2
  45.    local hexstr = '0123456789ABCDEF'
  46.    local s = ''
  47.    --while num > 0 do
  48.    while dig > 0 do -- use digit instead so there is padding
  49.        local mod = math.fmod(num, 16)
  50.        s = string.sub(hexstr, mod+1, mod+1) .. s
  51.        num = math.floor(num / 16)
  52.        dig = dig - 1
  53.    end
  54.    if s == '' then s = '0' end
  55.    return s
  56. end
  57.  
  58. client.SetGameExtraPadding(0,28,0,0)
  59.  
  60. memory.usememorydomain("System Bus")
  61.  
  62. event.onexit(function()
  63. client.SetGameExtraPadding(0,0,0,0)
  64. end)
  65.  
  66. while true do
  67.    
  68.     --declare values:
  69.     Xpos = memory.read_u16_be(0xff96)
  70.     Ypos = memory.read_u16_be(0xff98)
  71.     Invinc = 0x40 - memory.read_u8(0xc0cb)
  72.     if Invinc == 0x40 then Invinc = "" end
  73.     SuitcaseHitpoints = memory.read_u8(0xc0ae)
  74.     if SuitcaseHitpoints < 1 then SuitcaseHitpoints="" end
  75.     HP = memory.read_u8(0xc0c6)+1
  76.     if HP > 9 or HP < 1 then HP="Dead" end
  77.     BossHP = memory.read_u8(0xc200)
  78.     if BossHP == 0 then BossHP="" end
  79.    
  80.     --display values:  
  81.     text(43,10,"X",0x80FFFFFF) 
  82.     text(43,18,"Y",0x80FFFFFF) 
  83.     text(50,10,Xpos,0xFFFFFFFF)
  84.     text(50,18,Ypos,0xFFFFFFFF)
  85.    
  86.     text(84,10,"Inv",0x80FFFFFF)
  87.     text(100,10,Invinc,0xFFFFD040) 
  88.    
  89.     text(80,18,"Case",0x80FFFFFF)
  90.     text(100,18,SuitcaseHitpoints,0xFFFFD040)  
  91.  
  92.     text(130,10,"HP",0x80FFFFFF)
  93.     text(140,10,HP,0xFFFFFFFF)
  94.  
  95.     text(114,18,"BossHP",0x80FFFFFF)
  96.     text(140,18,BossHP,0xFFFFFFFF)
  97.    
  98.     drawFrameCountAndInput(10,2)
  99.     emu.frameadvance()
  100.  
  101. end
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement