SHARE
TWEET

CT crit viewer v 2.0

Cronokirby Aug 17th, 2016 139 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while true do
  2. if mainmemory.readbyte(0x0117)==01 then
  3.  
  4.     CritRefs = {}
  5.         for i = 0,4 do
  6.         memory.usememorydomain("CARTROM")
  7.         CritRefs[i] = memory.read_u8(0xFE00+mainmemory.read_u8(0xb3e6)+i)
  8.         end
  9.  
  10.     CritColor= 0xFFffa536
  11.         NotCritColor = 0xA0555555
  12.  
  13.     for n = 0,14 do
  14.    
  15.     CritChance = mainmemory.read_u8(0x5e72 + (math.floor(n/5)*0x80))
  16.         if CritRefs[n%5] <= CritChance then
  17.                     Color = CritColor else
  18.                     Color = NotCritColor
  19.                 end
  20.                
  21.             Xpos = mainmemory.read_u8(0x975a + (math.floor(n*0.2)))
  22.             Ypos = mainmemory.read_u8(0x9765 + (math.floor(n*0.2)))
  23.            
  24.                 gui.drawRectangle(Xpos+6*((n%5)-1),Ypos-30,3,3,Color,Color)
  25.         end
  26.        
  27. end
  28. emu.frameadvance()
  29. end
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top