Advertisement
Guest User

xeno_epsxe_script

a guest
Jul 30th, 2015
663
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.16 KB | None | 0 0
  1. --Xenogears "Trainer" script v1.2
  2. --beta aquarii
  3. --formatted for use on epsxe
  4. --jul 29, edited gui text
  5.  
  6. adresse_x_position = 0x06EF82
  7. adresse_y_position = 0x006EF84
  8. adresse_z_position = 0x006EF86
  9. adresse_seconde = 0x0059418
  10. adresse_minute = 0x0059420
  11. adresse_heure = 0x0059484
  12.  
  13. --non overworld step/encounter counts
  14. free_steps = 0x0B2294
  15. enc_steps = 0x0B22A0
  16.  
  17. --non-gear enemy HP locations
  18. enemyhp_1 = 0x0CD184
  19. enemyhp_2 = 0x0CD2F4
  20. enemyhp_3 = 0x0CD464
  21. enemyhp_4 = 0x0CD5D4
  22. enemyhp_5 = 0x0CD744
  23.  
  24. --gear based enemy HP locations
  25. gearenemyhp_1 = 0x0CD23C
  26. gearenemyhp_2 = 0x0CD3AC
  27. gearenemyhp_3 = 0x0CD51C
  28. gearenemyhp_4 = 0x0CD68C
  29.  
  30. --group them up together
  31. enemies = {enemyhp_1, enemyhp_2, enemyhp_3, enemyhp_4, enemyhp_5,
  32.     gearenemyhp_1, gearenemyhp_2, gearenemyhp_3, gearenemyhp_4}
  33.  
  34. while true do
  35.  
  36.     --copy values from mem locs to local variables
  37.     steps = memory.readwordsigned(free_steps)
  38.     encounter = memory.readwordsigned(enc_steps)
  39.    
  40.     --toss battle screen enemy HP (plus gears) into a table (table-ception)
  41.     ehp = {memory.readwordsigned(enemies[1]), memory.readwordsigned(enemies[2]),
  42.                 memory.readwordsigned(enemies[3]), memory.readwordsigned(enemies[4]),
  43.                 memory.readwordsigned(enemies[5]), memory.readwordsigned(enemies[6]),
  44.                 memory.readwordsigned(enemies[7]), memory.readwordsigned(enemies[8]),
  45.                 memory.readwordsigned(enemies[9])}
  46.                
  47.     --display steps
  48.     --TODO:
  49.     --figure out why some areas the encounters happen earlier
  50.     -- if free steps doesn't change, area has no encounters**
  51.     if encounter > 0 and encounter < 8384 then
  52.         gui.text(4, 80, "Free steps: "..steps)
  53.         gui.text(4, 90, "Steps till encounter: "..encounter)
  54.     end
  55.  
  56.     --displaying enemy information
  57.     --if encounter has been trigger (value of 8384 signed),
  58.     --display the HPs of enemies
  59.     ehp_x = 4           --x coord to display
  60.     ehp_y = 120         --y coord
  61.     e_num = 1           --Enemy #thisvalue
  62.    
  63.     --8384 is the value for battle initiated
  64.     if encounter == 8384 then
  65.         for k, v in pairs(ehp) do
  66.             if v ~= 0 then gui.text(ehp_x, ehp_y, "Enemy "..e_num..": "..v) end
  67.             ehp_y = ehp_y + 10
  68.             e_num = e_num + 1
  69.         end
  70.     else
  71.         ehp_y = 120
  72.         e_num = 1
  73.     end
  74.    
  75.     emu.frameadvance()
  76. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement