Advertisement
Guest User

majuu.lua

a guest
Aug 11th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.09 KB | None | 0 0
  1. while true do
  2.    
  3.    
  4.     textX=20
  5.     textY=30
  6.    
  7.     hp = mainmemory.read_u8(0x00009f)
  8.     gui.text(textX,textY,string.format("HP:   %d",hp))
  9.     psy = mainmemory.read_u8(0x0000A4)
  10.     gui.text(textX,textY+7,string.format("CHG:  %d",psy))
  11.     hspd = mainmemory.read_s8(0x000095)
  12.     vspd = mainmemory.read_s8(0x000096)
  13.     gui.text(textX,textY+14,string.format("HSPD: %d",hspd))
  14.     gui.text(textX,textY+21,string.format("VSPD: %d",vspd))
  15.    
  16.     playerX = mainmemory.read_u8(0x00008B)
  17.     playerY = mainmemory.read_u8(0x00008E)
  18.    
  19.     hitboxX = mainmemory.read_u8(0x0000aa)
  20.     hitboxY = mainmemory.read_u8(0x0000ab)
  21.    
  22.     --gui.drawBox(playerX-(0x05),playerY-0x1C,playerX+(0x05), playerY,"blue")
  23.     gui.drawBox(playerX-hitboxX,playerY-hitboxY,playerX+hitboxX, playerY,"blue")
  24.     --gui.drawPixel(playerX,playerY, "green")
  25.    
  26.    
  27.     for i = 0x27,0,-1 do --enemy hitboxes
  28.        
  29.         enemyX = mainmemory.read_u8(0x000748+i)
  30.         enemyY = mainmemory.read_u8(0x0007e8+i)
  31.         myType = mainmemory.read_u8(0x000680+i)
  32.        
  33.         if myType~=0 and myType~=0x02 and myType~=0x0a and myType~=0x03 then
  34.         --if myType==0x40 then
  35.         if mainmemory.read_u8(0x000a68+i)>1  then
  36.             if mainmemory.read_u8(0x000770+i)==0 then
  37.                 if mainmemory.read_u8(0x000810+i)==0 then
  38.                     hitboxX = mainmemory.read_u8(0x0006d0+i)
  39.                     hitboxY = mainmemory.read_u8(0x0006f8+i)
  40.                
  41.                     gui.drawBox(enemyX-(hitboxX),enemyY-hitboxY,enemyX+(hitboxX), enemyY,"red")
  42.                     --gui.drawPixel(enemyX,enemyY, "red")
  43.                     gui.text(enemyX,enemyY,string.format("%d",mainmemory.read_u8(0x000a68+i)))
  44.                     --gui.text(enemyX,enemyY+7,string.format("%x",mainmemory.read_u8(0x000680+i)))
  45.                     --gui.text(enemyX,enemyY+21,string.format("%x",hitboxY))
  46.                 end
  47.             end
  48.             else
  49.            
  50.             if mainmemory.read_u8(0x000770+i)==0 then
  51.                 if mainmemory.read_u8(0x000810+i)==0 then
  52.                     hitboxX = mainmemory.read_u8(0x0006d0+i)
  53.                     hitboxY = mainmemory.read_u8(0x0006f8+i)
  54.                
  55.                     gui.drawBox(enemyX-(hitboxX),enemyY-hitboxY,enemyX+(hitboxX), enemyY,"red")
  56.                     --gui.drawPixel(enemyX,enemyY, "red")
  57.                     --gui.text(enemyX,enemyY,string.format("%d",mainmemory.read_u8(0x000888+i)))
  58.                     --gui.text(enemyX,enemyY+7,string.format("%x",mainmemory.read_u8(0x000680+i)))
  59.                     --gui.text(enemyX,enemyY+14,string.format("%x",hitboxX))
  60.                     --gui.text(enemyX,enemyY+21,string.format("%x",hitboxY))
  61.                 end
  62.             end
  63.             --end
  64.         end
  65.         end
  66.        
  67.        
  68.     end
  69.    
  70.     for i = 0x0F,0,-1 do --Player Attacks
  71.        
  72.         locX = mainmemory.read_u8(0x000ae0+i)
  73.         locY = mainmemory.read_u8(0x000b10+i)
  74.        
  75.         ID = mainmemory.read_u8(0x000a90+i)
  76.        
  77.         if ID~=0 and ID~=4 then
  78.             if mainmemory.read_u8(0x000af0+i)==0 then
  79.                 if mainmemory.read_u8(0x000b20+i)==0 then
  80.                     hitboxX = mainmemory.read_u8(0x000ab0+i)
  81.                     hitboxY = mainmemory.read_u8(0x000ac0+i)
  82.                
  83.                     gui.drawBox(locX-(hitboxX),locY-(hitboxY),locX+(hitboxX), locY+(hitboxY),"white")
  84.                     --gui.drawPixel(enemyX,enemyY, "red")
  85.                     --gui.text(locX,locY,string.format("%d",mainmemory.read_u8(0x000a90+i)))
  86.                     --gui.text(enemyX,enemyY+14,string.format("%x",hitboxX))
  87.                     --gui.text(enemyX,enemyY+21,string.format("%x",hitboxY))
  88.                 end
  89.             end
  90.         end
  91.        
  92.        
  93.     end
  94.    
  95.    
  96.    
  97.     emu.frameadvance()
  98. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement