AylinCE Grandmaster Cheater Supreme
Reputation: 35
Joined: 16 Feb 2017 Posts: 1478
|
Posted: Mon May 11, 2020 7:57 am Post subject: Update Trainer from remote server. |
|
|
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.
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
Enjoy it.
_________________
|
|