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 


Update Trainer from remote server.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 30

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Mon May 11, 2020 7:57 am    Post subject: Update Trainer from remote server. Reply with quote

What does it do?
User; You will only give a Trainer with buttons.
But apart from a command, there will be a hollow table. (without functions in the lua script)
You will have all functions installed from the remote server.
Here is the result of my research;
Although I have made dozens of updates, I share the code and the site that works best.
Note: Instead of making continuous tables, update the code inside.
If you are not making unlimited time trainers, see the topic below.
After each update, the user will ask for confirmation to use the trainer.
Trainer version and user approval: https://forum.cheatengine.org/viewtopic.php?t=613418

Inspired by the relevant code: https://forum.cheatengine.org/viewtopic.php?p=5647769#5647769
The relevant site has been used:

The relevant site has been used:Google Sites:( https://sites.google.com/site/ )
Why Google Sites?
Probably many Upload sites will not perform as expected.
As long as you upload the file you upload to Google Sites with the same name;
your link address will never change. (.Luac)
This will provide you with a fixed way of updating.

1) (Sites1)
Create >>> on the Classic Google Sites (Select)
İmage: https://i.imgur.com/CZKncGH.jpg


2) (Sites2)
Set the site name. (1) Complete the security below. (2)
Click "Create" and confirm. (3)
Note: If the site did not occur, try changing the name.
Probably conflicted with a site of the same name.
image: https://i.imgur.com/Ej3fKff.jpg


3-4) (Sites3)
Click the settings icon >> Click Manage site.
Manage site >> Click "attachments"
image: https://i.imgur.com/W6FEMx0.jpg


5) (Sites5)
5-1) Click "Load" to load. Select the ".luac" file you created and upload it.
(Sites5(L1))
5-2) To get the link; Right click on "Download" and select "Copy link address".
(Sites5(L2))
5-3) To install the new version; Check the box at the beginning of the current file.
Choose "Change" from the options above and upload your ".luac" attached file with the same name.
(Sites5(N1, N2))
image: https://i.imgur.com/dUtHpgB.jpg


If you have come here; I assume that we have a connection.

Now let's move on to coding..

First of all, there is a detail to keep in mind;
After distributing the current Trainer table to users,
You cannot add any buttons or objects in updates.
(At least, it cannot be added in the Form Designer)
Instead, you can create all additions in Lua Script.
(createButton (UDF1.CEPanel1) and button.OnClick etc.)

Of course for these updates. Wink
In the first table, you add the necessary details.


Now open Cheat Engine and create a Form
Cheat Engine >> Table >> Create form
Do nothing, just add a button to the form and close the form designer.
Put the code below into Lua Script.

Code:
UDF1.CEButton1.OnClick=function()
UDF1.CEButton1.visible=false
int=getInternet()
s=int.getURL("https://sites.google.com/site/examles01/exampleTrainer.luac?attredirects=0&d=1")
int.destroy()
load(s)()
end
UDF1.show()


Copy the code >> Table >> Show Cheat Table Lua Script >> paste the code.
Click "Execute Script" to confirm and save the form as ".CETRAINER".
Turn off the Cheat Engin.
Now open the Cetrainer table and click the button.
ok.. Enjoy it.
****** ******* *******
And there must be a bonus.
You probably want to write the new version on behalf of Trainer.
(Or if the user changed the Trainer name, you can fix it.)

Note: Trainer extension is based on ".CETRAINER".
  You can also try with ".CT", it will give the same results.

The following is an example of this code:
https://forum.cheatengine.org/viewtopic.php?t=593741

Code:
local mf = getMainForm()
local sd = mf.SaveDialog1
local od = mf.OpenDialog1

local filefullpath = sd.Filename or od.Filename
local newFilename = TrainerOrigin.."Examle Trainer V1-11.CETRAINER"

local tt4=createTimer() tt4.Interval=4000 tt4.Enabled=true
tt4.OnTimer=function()
if filefullpath~=newFilename then
os.rename(filefullpath, newFilename)
print("Updated Version")
tt4.Enabled=false
else
print("You are using the Current Version.")
tt4.Enabled=false
end
end


If the above code doesn't work for you, try the code below.

Code:
local pth=TrainerOrigin
local mf = getMainForm().SaveDialog1.fileName or getMainForm().OpenDialog1.fileName
--print("\n0   "..pth)
--print("\n01   "..mf)
--------------------
filename = string.match(mf, pth..'(.*)')
--print("\n1   "..filename)
local newName="Examle Trainer V1-11.CETRAINER"


local tt4=createTimer() tt4.Interval=4000 tt4.Enabled=true
tt4.OnTimer=function()
if filename~=newName then
os.rename(pth..filename, pth..newName)
--print("Updated Version")
tt4.Enabled=false
else
--print("You are using the Current Version.")
tt4.Enabled=false
end
end


Finish Smile
Enjoy it.

_________________
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
Oxijen
Expert Cheater
Reputation: 0

Joined: 07 May 2020
Posts: 163
Location: On The Moon

PostPosted: Mon Oct 19, 2020 9:56 am    Post subject: Reply with quote

Weirdest Topic Ever.
No reply on an epic work Evil or Very Mad

Pretty Cool Cool

_________________
I can see you Hitler
Especially When I am On the Moon!!
You are Right now in cheat engine forum Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials 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 cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites