Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.75 KB | None | 0 0
  1. while true do
  2.  
  3. --  KEY
  4. -- .--------------------.--------------------.
  5. -- | JEL | Jellyfish    | BLW | Blowfish     |
  6. -- | PIR | Pirana       | SEA | Sea Bream    |
  7. -- | PUF | Puffer       | SBS | Sea Bass     |
  8. -- | TRT | Trout        | POR | Black Porgy  |
  9. -- | RBW | RainbowTrout | OCT | Octopus      |
  10. -- | RED | Red Catfish  | ANG | Angler       |
  11. -- | BAS | Bass         | DEV | Devilfish    |
  12. -- | MAR | MartianSquid | SPR | Spearfish    |
  13. -- | BLK | Black Bass   | WHL | Whale        |
  14. -- | BAR | Barandy      | MCK | Mackerel     |
  15. -- | MOW | Man-o'-War   | MAN | Manillo      |
  16. -- | FLY | Flying Fish  |--------------------'
  17. -- '--------------------'
  18.  
  19. -- The following tables hold the game's 23 fish in the order
  20. -- the game indexes them, both abbreviated names and lengths.
  21.  
  22. local name = {"JEL", "PIR", "PUF", "TRT", "RBW", "RED", "BAS",
  23.               "MAR", "BLK", "BAR", "MOW", "FLY", "BLW", "SEA",
  24.               "SBS", "POR", "OCT", "ANG", "DEV", "SPR", "WHL",
  25.               "MCK", "MAN"}
  26. local max =  {30, 40, 50, 70, 70, 80, 40, 80, 90, 200, 30, 20,
  27.               20, 40, 60, 60, 70, 100, 120, 160, 240, 70, 200}
  28.  
  29.   local i
  30.   for i = 0, 24, 1 do
  31.     caught = mainmemory.read_u8(0x0014688A+i*0x98)
  32.     type = mainmemory.read_u8(0x0014688E+i*0x98) + 1
  33.     length = mainmemory.read_u8(0x00146918+i*0x98)
  34.     xpos = mainmemory.read_s16_le(0x001468B6+i*0x98)
  35.     ypos = mainmemory.read_s16_le(0x001468B8+i*0x98)
  36.     if length > 0 then
  37.       if caught == 0 then
  38.         gui.text(xpos,ypos,""..length,"red")
  39.         gui.text(302,20+i*8,""..length)
  40.         gui.text(278,20+i*8,""..name[type])
  41.         if length >= max[type] then
  42.           gui.text(292,20+i*8,"*","green")
  43.         end
  44.       end
  45.     end
  46.   end
  47.  
  48.   emu.frameadvance()
  49.  
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement