Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Automatically Update to Latest Cheat Table

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Nov 01, 2016 9:56 pm    Post subject: Automatically Update to Latest Cheat Table This post has 1 review(s) Reply with quote

Not an extension, but a useful script to make sure people are using your latest tables.

I use an external link on Google Drive to store the current version number.

The table itself keeps track of its own version number.

When there is a later version, it will prompt the user to download it. They need only click save afterwards.

Download AutoUpdate1.CT below and execute the Check for Updates script.

If you answer Yes to the prompts, it will automatically download AutoUpdate2.CT from here.

If you again Check for Updates, it will state you now have the latest version!



AutoUpdate1.CT
 Description:
Old Version

Download
 Filename:  AutoUpdate1.CT
 Filesize:  1.83 KB
 Downloaded:  3968 Time(s)


AutoUpdate2.CT
 Description:
Latest Table

Download
 Filename:  AutoUpdate2.CT
 Filesize:  1.83 KB
 Downloaded:  5523 Time(s)

Back to top
View user's profile Send private message
usernotfound
Expert Cheater
Reputation: 0

Joined: 21 Feb 2016
Posts: 115

PostPosted: Tue Nov 01, 2016 10:52 pm    Post subject: Reply with quote

Awesome! Thanks for sharing Zanzer Very Happy
Back to top
View user's profile Send private message
Betcha
Expert Cheater
Reputation: 4

Joined: 13 Aug 2015
Posts: 232
Location: Somewhere In Space

PostPosted: Wed Nov 02, 2016 4:47 am    Post subject: Re: Automatically Update to Latest Cheat Table Reply with quote

This must be in every table lol.
Amazing feature!
Back to top
View user's profile Send private message
KéKéCoRe
Expert Cheater
Reputation: 0

Joined: 16 Mar 2015
Posts: 101
Location: France - Lorraine - Moselle (57)

PostPosted: Thu Feb 23, 2017 2:26 pm    Post subject: Reply with quote

If I put this on my cheat tables, or on my trainers?
And that I put it online.
And that I put another version, online with more function, the others will be able to download them directly on the program?
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Feb 24, 2017 7:44 pm    Post subject: This post has 1 review(s) Reply with quote

Trainer might give some difficulties.

Not sure your antivirus software would appreciate an application downloading an EXE from the Internet.

Also, you probably can't save over a running executable.

It's still possible, just might need to jump through some extra hoops.
Back to top
View user's profile Send private message
Scorm
Newbie cheater
Reputation: 0

Joined: 06 Dec 2018
Posts: 11

PostPosted: Sun Dec 16, 2018 2:08 am    Post subject: Reply with quote

Thanks for sharing the idea and code, will probably be using something similar!
Back to top
View user's profile Send private message
Tarnum75
How do I cheat?
Reputation: 0

Joined: 06 Jan 2022
Posts: 2

PostPosted: Wed Oct 08, 2025 4:46 am    Post subject: AutoUpdate1.CT and AutoUpdate2.CT Reply with quote

Hi, i'm Tarnum and i wanted to tell you that i made an interesting discovery, this "AutoUpdate1.CT" and "AutoUpdate2.CT" that you made allows you to automatically update to the latest version of the cheat table, for example, i have Age of Empires Definitive Edition build 97381 on Steam and i would like it to automatically update the version of the cheat table itself, that is 97381, where can I put this "AutoUpdate1.CT?" how does it work? once you've put it there, how do you automatically update the game's cheat table to the latest version, 97381? one answer, and thanks! Smile
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1522

PostPosted: Wed Oct 08, 2025 8:11 am    Post subject: Re: AutoUpdate1.CT and AutoUpdate2.CT Reply with quote

Tarnum75 wrote:
Hi, i'm Tarnum and i wanted to tell you that i made an interesting discovery, this ...


************************************************
I think @Zanzer provided an example for at least intermediate users.
That's why he posted a code example instead of explaining it.

Here's a more descriptive example of client-side code that updates ".CT" and ".CETRAINER."

What you need to do:

1) You need a Google account. Or, you can try another server that provides alternative features.
2) Create a new page in Google Docs.
https://docs.google.com/
(Click "Blank document" on the homepage.)
Give the new document a name in the top left corner.
Enter the information in the order listed, starting with blank lines.
Example:

-------------
12345
myGame_v2.CT
http://forum.cheatengine.org/download.php?id=119714

Click the "Share" button in the top right corner. In the window that opens, click "Restricted" under "Public access." Select "Anyone with the link." Confirm "Can view." Grab the link from the "Copy link" button and click "Done."

From the link you copied, take the section shown below ( ... Docs ID ... ) and replace it with the same section from the "version_url" given in the code.

https://docs.google.com/document/d/ ... Docs ID ... /edit?usp=sharing

3) After this step, your code is likely ready, and you can complete the following function to run when the table is opened or activated with a button.

Trigger the following function to run the code: checkVer(version_url)

************************************************
Here's the ready-to-use code:
(Edit the version URL as described above.)

Code:

local version_url = "https://docs.google.com/document/d/1YuhwVpUjjxNlDTcS2tMOaG_rbvMFkp3q2vyaUc3rBdk/export?format=txt"
local TABLE_VERSION = 1

local path = TrainerOrigin or MainForm --The last location where the user opened the table.
if path==nil then path = os.getenv("TEMP") end
print(path)

local version, newname, table_url = 0, "", ""

function loadTbl(tblUrl,name)
local http = getInternet()
local latest = http.getURL(tblUrl)
  if latest ~= nil then
     fullpath = path .. "\\" .. name
     local file = io.open(fullpath, "w")
     file:write(latest)
     file:close()
     loadTable(name)
  else
     messageDialog("Failed to load the new table!", mtError, mbOK)
  end
 http.destroy()
end

function checkVer(verUrl)
local http = getInternet()
local result = http.getURL(verUrl)
sl = createStringList()
 if result then
  sl.Text = result
  for i=1, sl.count - 1 do
      version = tonumber(sl[1])
      newname = sl[2]
      table_url = sl[3]
  end

  if version > TABLE_VERSION then
    local answer = messageDialog("There is a newer version of this table.\nWould you like to download it now?", mtWarning, mbYes, mbNo)
    if answer == mrYes then
      messageDialog("Be sure to save the new table!", mtInformation, mbOK)
      --print("Loaded Table start!")
      loadTbl(table_url,newname)
    end
  else
    messageDialog("You currently have the latest version!", mtInformation, mbOK)
  end
 else
  messageDialog("Failed to find latest version!", mtError, mbOK)
 end
 http.destroy()
 sl.destroy()
end

checkVer(version_url)


The meaning of the lines in the Google document:
0) "---------------"
This line is unused and required. If CE reads this document from the first line, it will give an error, and you must include the first line.
1) Version: If you add a new version here, the code in the table will be executed. Upgrade it if a new version is available.
2) Table name: Some users want to indicate the version in the table name. Fill in this section with the new version name. (.CT or .Cetrainer)
3) New version table URL: Insert the download link for the new version table here.

Process these four lines correctly in order. Trainer will read from line 1 and perform the matching.

Enjoy it! Wink

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25796
Location: The netherlands

PostPosted: Wed Oct 08, 2025 3:33 pm    Post subject: Reply with quote

just a fyi, loadTable can load tables from stream objects

so:
Code:

ss=createStringStream(latest)
loadTable(ss)
ss.destroy()


it's still recommended to save the table afterwards though

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1522

PostPosted: Wed Oct 08, 2025 6:57 pm    Post subject: Reply with quote

Your suggestion is better, @DB, thanks.
This way:

1) It opens the new version in the existing table.
2) It saves the existing table with the new version and name.

Note: Especially for ".cetrainers," set the timer to a delay of at least 3 seconds.
This way, it can better read the name of the opened table.

Code:
local version_url = "https://docs.google.com/document/d/1YuhwVpUjjxNlDTcS2tMOaG_rbvMFkp3q2vyaUc3rBdk/export?format=txt"
local TABLE_VERSION = 1

local path = TrainerOrigin or MainForm --The last location where the user opened the table.
if path==nil then path = os.getenv("TEMP") end
print(path)
mf = MainForm
local sd = mf.SaveDialog1
local od = mf.OpenDialog1
local filefullpath

tr1 = createTimer()
tr1.Interval=3000
tr1.OnTimer=function(t)
filefullpath = sd.Filename or od.Filename or ''
print(filefullpath)
t.Destroy()
end
tr1.Enabled=true

local version, newname, table_url = 0, "", ""

function loadTbl(tblUrl,name)
local http = getInternet()
local latest = http.getURL(tblUrl)
  if latest ~= nil then
     fullpath = path .. "\\" .. name
     ss=createStringStream(latest)
     loadTable(ss)
     os.rename(filefullpath,fullpath)
     saveTable(fullpath)
     ss.destroy()
  else
     messageDialog("Failed to load the new table!", mtError, mbOK)
  end
 http.destroy()
end

function checkVer(verUrl)
local http = getInternet()
local result = http.getURL(verUrl)
sl = createStringList()
 if result then
  sl.Text = result
  for i=1, sl.count - 1 do
      version = tonumber(sl[1])
      newname = sl[2]
      table_url = sl[3]
  end

  if version > TABLE_VERSION then
    local answer = messageDialog("There is a newer version of this table.\nWould you like to download it now?", mtWarning, mbYes, mbNo)
    if answer == mrYes then
      messageDialog("Be sure to save the new table!", mtInformation, mbOK)
      --print("Loaded Table start!")
      loadTbl(table_url,newname)
    end
  else
    messageDialog("You currently have the latest version!", mtInformation, mbOK)
  end
 else
  messageDialog("Failed to find latest version!", mtError, mbOK)
 end
 http.destroy()
 sl.destroy()
end

checkVer(version_url)

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites