TATATATRATATATA

Untitled

Apr 4th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. --- This script will Randomize age, attributes, potential of all players.
  2. --- New attribute will be a value between 21 and 99
  3. --- New potential will be a value between 21 and 99 (but not lower that player ovr)
  4. --- New Age can be lower than current age by 10 years to higher than current age by 10 years
  5. --- It may take a few mins. Cheat Engine will stop responding and it's normal behaviour. Wait until you get 'Done' message.
  6.  
  7. --- HOW TO USE:
  8. --- https://i.imgur.com/xZMqzTc.gifv
  9. --- 1. Open Cheat table as usuall and enter your career.
  10. --- 2. In Cheat Engine click on "Memory View" button.
  11. --- 3. Press "CTRL + L" to open lua engine
  12. --- 4. Then press "CTRL + O" and open this script
  13. --- 5. Click on 'Execute' button to execute script and wait for 'done' message box.
  14.  
  15. --- AUTHOR: ARANAKTU
  16.  
  17. require 'lua/GUI/forms/playerseditorform/consts';
  18. require 'lua/consts';
  19.  
  20. local comp_desc = get_components_description_player_edit()
  21.  
  22. -- list of attributes
  23. local attributes_to_randomize = {
  24. "Potential",
  25. "Crossing",
  26. "Finishing",
  27. "HeadingAccuracy",
  28. "ShortPassing",
  29. "Volleys",
  30. "Marking",
  31. "StandingTackle",
  32. "SlidingTackle",
  33. "Dribbling",
  34. "Curve",
  35. "FreeKickAccuracy",
  36. "LongPassing",
  37. "BallControl",
  38. "GKDiving",
  39. "GKHandling",
  40. "GKKicking",
  41. "GKPositioning",
  42. "GKReflex",
  43. "ShotPower",
  44. "Jumping",
  45. "Stamina",
  46. "Strength",
  47. "LongShots",
  48. "Acceleration",
  49. "SprintSpeed",
  50. "Agility",
  51. "Reactions",
  52. "Balance",
  53. "Aggression",
  54. "Composure",
  55. "Interceptions",
  56. "AttackPositioning",
  57. "Vision",
  58. "Penalties",
  59. }
  60.  
  61. -- players table
  62. local sizeOf = 112 -- Size of one record in players database table (0x64)
  63.  
  64. -- iterate over all players in 'players' database table
  65. local i = 0
  66. local current_playerid = 0
  67. while true do
  68. local playerid_record = ADDR_LIST.getMemoryRecordByID(CT_MEMORY_RECORDS['PLAYERID'])
  69. local current_playerid = bAnd(bShr(readInteger(string.format('[%s]+%X', 'firstPlayerDataPtr', playerid_record.getOffset(0)+(i*sizeOf))), playerid_record.Binary.Startbit), (bShl(1, playerid_record.Binary.Size) - 1))
  70. if current_playerid == 0 then
  71. break
  72. end
  73.  
  74. writeQword('playerDataPtr', readPointer('firstPlayerDataPtr') + i*sizeOf)
  75.  
  76. -- get ovr_formula for player primiary position
  77. local ovr_formula = deepcopy(OVR_FORMULA[ADDR_LIST.getMemoryRecordByID(comp_desc['PreferredPosition1CB']['id']).Value])
  78.  
  79. -- Randomize Attributes
  80. local new_ovr = 0
  81. for j=1, #attributes_to_randomize do
  82. local new_attr_val = math.random(19, 98)
  83. local attr_name = attributes_to_randomize[j] .. 'Edit'
  84. for attr, perc in pairs(ovr_formula) do
  85. if attr == attr_name then
  86. new_ovr = new_ovr + (new_attr_val * perc)
  87. end
  88. end
  89. ovr_formula[attr_name] = nil
  90.  
  91. ADDR_LIST.getMemoryRecordByID(comp_desc[attr_name]['id']).Value = new_attr_val
  92. end
  93.  
  94. -- Update OVR
  95. new_ovr = math.floor(new_ovr)
  96. ADDR_LIST.getMemoryRecordByID(comp_desc['OverallEdit']['id']).Value = new_ovr
  97.  
  98. -- Keep potential higher than ovr
  99. local new_pot = tonumber(ADDR_LIST.getMemoryRecordByID(comp_desc['PotentialEdit']['id']).Value)
  100. if new_pot < new_ovr then
  101. if new_ovr >= 94 then
  102. ADDR_LIST.getMemoryRecordByID(comp_desc['PotentialEdit']['id']).Value = 99
  103. else
  104. ADDR_LIST.getMemoryRecordByID(comp_desc['PotentialEdit']['id']).Value = new_ovr + 5
  105. end
  106. end
  107.  
  108. -- Randomize Age
  109. local bd_record = ADDR_LIST.getMemoryRecordByID(CT_MEMORY_RECORDS['BIRTHDATE'])
  110. local current_age = tonumber(bd_record.Value)
  111. if math.random() >= 0.50 then
  112. -- younger
  113. bd_record.Value = current_age + (math.random(0, 10) * 365)
  114. else
  115. -- older
  116. bd_record.Value = current_age - (math.random(0, 10) * 365)
  117. end
  118.  
  119. i = i + 1
  120. end
  121.  
  122. showMessage("Done")
Add Comment
Please, Sign In to add comment