TATATATRATATATA

Untitled

Sep 4th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 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.  
  75. writeQword('playerDataPtr', readPointer('firstPlayerDataPtr') + i*sizeOf)
  76.  
  77. -- get ovr_formula for player primiary position
  78. local ovr_formula = deepcopy(OVR_FORMULA[ADDR_LIST.getMemoryRecordByID(comp_desc['PreferredPosition1CB']['id']).Value])
  79.  
  80. -- Randomize Attributes
  81. local new_ovr = 0
  82. for j=1, #attributes_to_randomize do
  83. local new_attr_val = math.random(19, 98)
  84. local attr_name = attributes_to_randomize[j] .. 'Edit'
  85. for attr, perc in pairs(ovr_formula) do
  86. if attr == attr_name then
  87. new_ovr = new_ovr + (new_attr_val * perc)
  88. end
  89. end
  90. ovr_formula[attr_name] = nil
  91.  
  92. ADDR_LIST.getMemoryRecordByID(comp_desc[attr_name]['id']).Value = new_attr_val
  93. end
  94.  
  95. -- Update OVR
  96. new_ovr = math.floor(new_ovr)
  97. ADDR_LIST.getMemoryRecordByID(comp_desc['OverallEdit']['id']).Value = new_ovr
  98.  
  99. -- Keep potential higher than ovr
  100. local new_pot = tonumber(ADDR_LIST.getMemoryRecordByID(comp_desc['PotentialEdit']['id']).Value)
  101. if new_pot < new_ovr then
  102. if new_ovr >= 94 then
  103. ADDR_LIST.getMemoryRecordByID(comp_desc['PotentialEdit']['id']).Value = 99
  104. else
  105. ADDR_LIST.getMemoryRecordByID(comp_desc['PotentialEdit']['id']).Value = new_ovr + 5
  106. end
  107. end
  108.  
  109. -- Randomize Age
  110. local bd_record = ADDR_LIST.getMemoryRecordByID(CT_MEMORY_RECORDS['BIRTHDATE'])
  111. local current_age = tonumber(bd_record.Value)
  112. if math.random() >= 0.50 then
  113. -- younger
  114. bd_record.Value = current_age + (math.random(0, 10) * 365)
  115. else
  116. -- older
  117. bd_record.Value = current_age - (math.random(0, 10) * 365)
  118. end
  119.  
  120. i = i + 1
  121. end
  122.  
  123. showMessage("Done")
Add Comment
Please, Sign In to add comment