CollectorTogami

Gen2NatureCheck.lua

Jan 27th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.51 KB | None | 0 0
  1. --Gen2NatureCheck by Collector Togami
  2. --Please select what game you are playing below to handle the offsets. At this time
  3. --this program only supports ENG versions of GSC.
  4.  
  5. Crystal=693
  6. NotCrystal=0
  7.  
  8. --Change the game version you wish to use here.
  9. GameVersion=Crystal
  10.  
  11. PartyStart=0x0000DA32+GameVersion
  12.  
  13. if GameVersion == Crystal then
  14.   PartySize=0x0000DCD7
  15. end
  16. if GameVersion == NotCrystal then
  17.   PartySize=0x0000DA22
  18.   end
  19.  
  20.  
  21.  
  22.  
  23. --This offset may not be constant across other languages
  24. PartyOffset=48
  25.  
  26. currentY=10
  27.  
  28.  
  29. --Thanks to MKDasher for this
  30. local naturename={
  31.  "Hardy","Lonely","Brave","Adamant","Naughty",
  32.  "Bold","Docile","Relaxed","Impish","Lax",
  33.  "Timid","Hasty","Serious","Jolly","Naive",
  34.  "Modest","Mild","Quiet","Bashful","Rash",
  35.  "Calm","Gentle","Sassy","Careful","Quirky"}
  36.  
  37.  
  38. while true do
  39.  
  40.   counter=1
  41.   currentParty=PartyStart
  42.  
  43.  
  44.      
  45.       currentY=10
  46.  
  47.   party=0
  48.  
  49.  
  50.  
  51.   while party < memory.readbyte(PartySize) do
  52.    
  53.  
  54.     --Not the best way to get exp but it will do for now
  55.     natureNum = memory.readbyte(currentParty)*0x10000
  56.     natureNum = natureNum + memory.readbyte(currentParty+1)*0x100
  57.     natureNum = natureNum + memory.readbyte(currentParty+2)
  58.    
  59.     natureNum = natureNum % 25
  60.    
  61.     gui.text(5,currentY, counter ..". "..naturename[natureNum+1])
  62.  
  63.      
  64.  
  65.    
  66.  
  67.     party = party + 1
  68.     counter = counter + 1
  69.     currentParty=currentParty+PartyOffset
  70.     currentY=currentY+10
  71.    
  72.    
  73.  
  74.   end
  75.       emu.frameadvance()
  76.      
  77.     end
Advertisement
Add Comment
Please, Sign In to add comment