Browse Source

added autoset script to repo

master
4 years ago
parent
commit
52eecb720f
1 changed files with 27 additions and 0 deletions
  1. 27
    0
      luas/autoset.lua

+ 27
- 0
luas/autoset.lua View File

@@ -0,0 +1,27 @@
--Inputs: (Address list of Cheat Engine, Entry description)
function autoset(entries, str_entry_description)
local entry = entries.getMemoryRecordByDescription(str_entry_description)
if entry ~= nil then
if entry.Active ~= true then
entry.Active = true
else
--if already active, it needs a toggle otherwise effect won't occur.
entry.Active = false
entry.Active = true
end
end
end
function autoenable_favorites()
--This means the trainer will read in a text file from the same directory.
--You can edit or append to this if
--you wish to store files in a different folder instead.
local favoritesfile = TrainerOrigin .. "favorites.txt"
local records = getAddressList()
local file = io.open(favoritesfile, "r")
if file ~= nil then
for line in io.lines(favoritesfile) do
autoset(records, line)
end
end
end

Loading…
Cancel
Save