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 


[RESOLVED]Automatic .CETRAINER New Version Download!
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Sun Apr 08, 2018 4:53 pm    Post subject: [RESOLVED]Automatic .CETRAINER New Version Download! This post has 1 review(s) Reply with quote

The code below reads and confirms a txt file with the remote URL.
But what I need is to write the txt text to be read into Lua.
For example, I must write a function and read and apply that function.
There is a valid reason:
If the game codes change, instead of making continuous Trainer,
you can update the codes (in Lua only) with a remote link. Wink

(Code @Corroder)

Code:
UDF1.CELabel1.caption = '1111'
UDF1.CELabel1.Visible = false
if syntaxcheck then return end
local url = "https://docs.google.com/document/d/1mavIeXQC_rlPuo3jCicTGEISchkqkWWw6M7aqHDB4o0/export?format=txt"
local http = getInternet()
local result = http.getURL(url)
if result then
 result=tostring(result:match("%d+"))
 local trainer_verifier = UDF1.CELabel1.caption
  if trainer_verifier ~= result then
showMessage("No Done")
 --  closeCE()
   return caFree
  else

showMessage("Done")
   return

UDF1.show();
end
end





I do not know if the subject has been processed before.
But if the request is first; Masters must be the signature of this issue. Wink

Thank you in advance for your ideas and participation.
------------------------------------ >>>
EDIT:
This was the case, and the result is in the messages.
Here is a Cetrainer example of the Resolved Result:

https://www.dropbox.com/s/6ro1jgyzqkuchhs/GameV32.CETRAINER?dl=1

Please read the messages for details and code.
NOTE:
If these codes have worked, do not forget to throw the Masters RAP.
Enjoy it!



RAP-Reputation.JPG
 Description:
 Filesize:  65.13 KB
 Viewed:  22079 Time(s)

RAP-Reputation.JPG



_________________
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


Last edited by AylinCE on Sat Apr 14, 2018 4:48 pm; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sun Apr 08, 2018 4:58 pm    Post subject: Reply with quote

This is what I use to load table files. You should be able to adapt it to what you need.

Code:
--------
-------- CE Table Require
--------
local TableLuaFilesDirectory = 'luaFiles'
function CETrequire(moduleStr)
   if moduleStr ~= nil then
      local localTableLuaFilePath = moduleStr
      if TableLuaFilesDirectory ~= nil or TableLuaFilesDirectory ~= '' then
         local sep = package.config:sub(1,1)
         localTableLuaFilePath = TableLuaFilesDirectory .. sep .. moduleStr
      end
      local f, err = io.open(localTableLuaFilePath .. '.lua')
      if f and not err then
         f:close()
         return require(localTableLuaFilePath)
      else
         local tableFile = findTableFile(moduleStr .. '.lua')
         if tableFile == nil then
            return nil
         end
         local stream = tableFile.getData()
         local fileStr = nil
         local bytes = stream.read(stream.Size)
         for i = 1, #bytes do
            if fileStr == nil then
               fileStr = ''
            end
            fileStr = fileStr .. string.char(bytes[i])
         end
         if fileStr then
            return assert(loadstring(fileStr))()
         end
      end
   end
   return nil
end
-- CETrequire('I2CETableCEA')
-- CETrequire('SomeLuaModuleStoredAsTableFile')
-- SomeLuaModuleStoredAsTableFile.printTest() -- Just an example.


But basically I think you'll need to use "assert(loadstring(fileStr))()" to load the Lua code.

_________________
Back to top
View user's profile Send private message Visit poster's website
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Sun Apr 08, 2018 5:46 pm    Post subject: Reply with quote

TheyCallMeTim13 wrote:
This is what I use to load table files. You should be able to adapt it to what you need.

Code:
--------
-------- CE Table Require
--------
local TableLuaFilesDirectory = 'luaFiles'
function CETrequire(moduleStr)
   if moduleStr ~= nil then
      local localTableLuaFilePath = moduleStr
      if TableLuaFilesDirectory ~= nil or TableLuaFilesDirectory ~= '' then
         local sep = package.config:sub(1,1)
         localTableLuaFilePath = TableLuaFilesDirectory .. sep .. moduleStr
      end
      local f, err = io.open(localTableLuaFilePath .. '.lua')
      if f and not err then
         f:close()
         return require(localTableLuaFilePath)
      else
         local tableFile = findTableFile(moduleStr .. '.lua')
         if tableFile == nil then
            return nil
         end
         local stream = tableFile.getData()
         local fileStr = nil
         local bytes = stream.read(stream.Size)
         for i = 1, #bytes do
            if fileStr == nil then
               fileStr = ''
            end
            fileStr = fileStr .. string.char(bytes[i])
         end
         if fileStr then
            return assert(loadstring(fileStr))()
         end
      end
   end
   return nil
end
-- CETrequire('I2CETableCEA')
-- CETrequire('SomeLuaModuleStoredAsTableFile')
-- SomeLuaModuleStoredAsTableFile.printTest() -- Just an example.


But basically I think you'll need to use "assert(loadstring(fileStr))()" to load the Lua code.


@TheyCallMeTim13 Master;
Thanks for the example.
However, please note that I'm a novice. Wink
How would I reconcile with the above code (Remote URL.txt).
I hope we can blend these two codes. Rolling Eyes

_________________
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
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sun Apr 08, 2018 5:52 pm    Post subject: Reply with quote

Aylin wrote:

@TheyCallMeTim13 Master;
Thanks for the example.
However, please note that I'm a novice. Wink
How would I reconcile with the above code (Remote URL.txt).
I hope we can blend these two codes. Rolling Eyes


TheyCallMeTim13 wrote:
...
But basically I think you'll need to use "assert(loadstring(fileStr))()" to load the Lua code.


Use some basic logic, replace or set "fileStr" with your code sting.
I'll help; but I won't write it for you, you'll never really learn much that way.

_________________
Back to top
View user's profile Send private message Visit poster's website
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Sun Apr 08, 2018 6:32 pm    Post subject: Reply with quote

Writing code is a valuable skill.
I must be honest; Code letter sounds complicated to me,
Dealing with 20-30 game complexes, producing continuous trainer,
group forums and constantly renewed, cheat codes to make Trainer.
In all of these, your help is a quick step.
I'm giving ideas for the production of a useful code.
If I can produce the code, I will post it.
Of course, these are my thoughts.
The decision to help or not is always yours.
thanks for the answer.

_________________
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
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Apr 08, 2018 6:57 pm    Post subject: This post has 1 review(s) Reply with quote

DB example from a topic here.


script stored on a web host storage with name examplescript.lua:

Code:

print("Welcome to an example lua script hosted on the cheat engine website")
local f=createForm(false)
f.position=poScreenCenter
f.BorderStyle=bsNone
f.Color=0x000100
f.OnClose=function(f)
return caFree
end

local i=createImage(f)
i.align=alClient
local
int=getInternet()
local logostr=int.getURL("http://cheatengine.org/celogo.png")
int.destroy()
local ss=createStringStream(logostr)
i.Picture.LoadFromStream(ss)
ss.destroy()

i.transparent=true
i.stretch=true
i.OnMouseMove=function(s)
s.Parent.dragNow()
end

local b=createButton(f)
b.caption="Close"
b.AnchorSideLeft.Side=asrCenter
b.AnchorSideLeft.Control=f
b.AnchorSideBottom.Side=asrBottom
b.AnchorSideBottom.Control=f
b.Anchors="[akLeft, akBottom]"
b.OnClick=function (s)
b.Parent.close()
end

f.setLayeredAttributes(0x000100, 230, LWA_COLORKEY | LWA_ALPHA )
f.show()



To load and execute that code (examplescript.lua) above from your trainer :

Code:
int=getInternet()
s=int.getURL("http://cheatengine.org/examplescript.lua")
int.destroy()
load(s)()

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Sun Apr 08, 2018 8:25 pm    Post subject: Reply with quote

After addressing the code,
eventually this code remains.

Code:
int=getInternet()
s=int.getURL("http://cheatengine.org/examplescript.lua")
int.destroy()
load(s)()


Only an arrangement in the original code will suffice.

example:

Code:
--UDF1.CELabel1.caption = '1111'
--UDF1.CELabel1.Visible = false
if syntaxcheck then return end
local url = "https://docs.google.com/document/d/1mavIeXQC_rlPuo3jCicTGEISchkqkWWw6M7aqHDB4o0/export?format=txt"
local http = getInternet()
local result = http.getURL(url)
if result then
 result=tostring(result:match("%d+"))  -- After the matc print
 local trainer_verifier = UDF1.CELabel1.caption -- the main road can be replaced: local my_function = decodeFunction('..the registration path can be shown here.. or ..r+..')
  if trainer_verifier ~= result then
showMessage("No Done")
 --  closeCE()
   return caFree
  else

showMessage("Done")
   return

--UDF1.show(); -- and here the function can be initialized: my_function();
my_function();
end
end


Rather than write new code, this code can be processed. 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
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Mon Apr 09, 2018 7:30 am    Post subject: Reply with quote

What I wrote above is an example, how to handle code, script, image, etc which stored in a web host.

'To handle" mean how to load that code/script.etc and then execute it if contain functions, form, class, etc. with this code :

Code:
int=getInternet()
s=int.getURL("http://cheatengine.org/examplescript.lua")  --- or what ever file you stored (maybe txt file, bin file, png file, etc) in your web host.
int.destroy()
load(s)()


After it loaded, then next you can call your function 'my_function'.

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Mon Apr 09, 2018 9:19 am    Post subject: Reply with quote

All ERROR!!!

I do not know how to translate sample codes into script.
Recommendation: 'Learn to follow the guidelines CE' If you say:

https://github.com/cheat-engine/cheat-engine/blob/master/Cheat%20Engine/bin/celua.txt

He tells you what it does,
but there is no information on how to use it.
'ExecuteScript' tests even a comma.


Code:
local s=Script()
s.align=alClient
local
int=getInternet()
local txtstr=int.getURL("https://docs.google.com/document/d/1mavIeXQC_rlPuo3jCicTGEISchkqkWWw6M7aqHDB4o0/export?format=txt")
int.destroy()
local ss=createStringStream(txtstr)
s.Script.LoadFromStream(ss)
ss.destroy()

int=getInternet()
s=int.getURL("https://docs.google.com/document/d/1mavIeXQC_rlPuo3jCicTGEISchkqkWWw6M7aqHDB4o0/export?format=txt")
int.destroy()
load(s) --()
my_function()


It may take years to learn these things.
But thanks for the help and ideas.
maybe.. another a time. Rolling Eyes

_________________
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
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Mon Apr 09, 2018 7:58 pm    Post subject: Reply with quote

This is last attempt to explain what to do by codes below, even I am not sure what are you trying to do, hope you get understand every words and comments to the codes here, by read it carefully...

Code:
----- set a variable which will use to check password
----- this part should be hide or encoded or use CEEdit to allow user input a password
UDF1.CELabel1.Caption = '1111'
UDF1.CELabel1.Visible = false

----- get password stored on web host site
if syntaxcheck then return end

---=-- THIS IS URL USE TO STORE PASSWORD
local url = "https://docs.google.com/document/d/1mavIeXQC_rlPuo3jCicTGEISchkqkWWw6M7aqHDB4o0/export?format=txt"
local http = getInternet()
local result = http.getURL(url)

----- check password macth to UDF1.Caption or not
-----
----- If password matched, then load your important codes from every where you store it
if result then  result=tostring(result:match("%d+")) end
 UDF1.Visible = false
 local trainer_verifier = UDF1.CELabel1.caption
 if trainer_verifier == result then
 int=getInternet()

 --- THIS IS URL USE TO STORE YOUR SCRIPT OR CODE
 s=int.getURL("http://cheatengine.org/examplescript.lua")   --- this just example, PUT YOUR OWN URL HERE
 int.destroy()
 load(s)()
end

----- If password not matched
if trainer_verifier ~= result then
  showMessage("Mr.Frodo..you took wrong path")
  return
end

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Tue Apr 10, 2018 6:02 am    Post subject: Reply with quote

Corroder wrote:
This is last attempt to explain what to do by codes below, even I am not sure what are you trying to do, hope you get understand every words and comments to the codes here..


I'm resetting all the questions.
Maybe I'm wrong.
Initially, I shared (@Corrod code):
He reads and confirms '1111' on the remote connection.
I need to: put the deCode code on the remote connection and
to read it and run it on Trainer.lua (or Script).
I would like to update the Trainer within the remote URL.
and a CT specimen. (Please read some information given in the CT script) :

https://www.dropbox.com/s/6nyhrtupxwbwti8/specimen1.CT?dl=0

thanks again

_________________
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
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Tue Apr 10, 2018 6:43 am    Post subject: This post has 1 review(s) Reply with quote

May be this is what your looking for, this is made by Zanzer and will auto-update the table from a server file (but I've never used it my self just remembered the thread).

Automatically Update to Latest Cheat Table

_________________
Back to top
View user's profile Send private message Visit poster's website
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Tue Apr 10, 2018 7:45 am    Post subject: Reply with quote

@TheyCallMeTim13 :
Quote:
May be this is what your looking for, this is made by Zanzer and will auto-update the table from a server file


Code:
int=getInternet()
 --- THIS IS URL USE TO STORE YOUR SCRIPT OR CODE
 s=int.getURL("https://docs.google.com/document/d/1OVn7FvHXUBLmEwX6ujOUW10U4WqJdb6eXo9aXGO3ZGw/export?format=txt")  -- this Aylin encode script URL
print(s)   --- to check if script load or not
 int.destroy()
 assert(loadstring(s))()      --- or  load(s)()


I think need manipulating this 'loadstring(s)()' since that script has stored and download as 'format=txt'.

@Aylin
So to test that script which stored on web host work or not :

1. Try make another simple script with no encodeFunction(), just readable script and store to web host and then call it with function above.
2. Or to make it more easier, just save that encode script as a lua file and call it (maybe with Zanzer auto update function as mentioned)

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 31

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Tue Apr 10, 2018 12:31 pm    Post subject: Reply with quote

@TheyCallMeTim13 Thanks.
If we can not solve the current scenario, your bid is probably valid.
But the trainer is updated from the registered connection.
A non-upgraded trainer, download link
how is it put into the old trainer? Rolling Eyes
Only used for version testing,
but I have some doubts I can update!

@Corroder:
Probably the code will work.
but it fails for some reasons.
I tried uploading (changed in remote URL Txt)
I tried this:

Code:
local my_function = decodeFunction('c-rkc^cjw^b#HcO=?Od*; .. etc etc etc..')
my_function()


and I tried this:

Code:
<?xml version="1.0" encoding="UTF-8"?>
-<CheatTable CheatEngineTableVersion="26">
-<Forms>
<UDF1 Encoding="Ascii85" Class="TCEForm">#
etc.. etc.. etc..
wEb#s') my_function() </LuaScript>
</CheatTable>


and I tried this:

Code:
<LuaScript>local my_function = decodeFunction('c-p.[-A etc.. etc.. etc..
wEb#s') my_function() </LuaScript>


and I tried this:

Code:
UDF1.CEGroupBox1.visible = false
UDF1.CEButton4.visible = true
UDF1.CEImage1.visible = false
etc.. etc.. etc..

UDF1.CEImage1.visible = false
UDF1.CEImage2.visible = false
end
form_show(UDF1)


In all, the errors that appear in the picture was taken. Rolling Eyes

There are two reasons that caught my attention:
1) Can remote URL-Txt change some characters?
2) Do the following commands require a change?

Code:
assert(loadstring(s))()


Code:
load(s)()


Code:
assert(load(s))()


There are two reasons that caught my attention:
1) Can remote URL-Txt change some characters?
2) Do the following commands require a change?
This script sees the script that needs to be loaded.
but can not load correctly,
I guess the commands may be missing!
or copy and paste, the character can be changed!
Please try it on your own, maybe it is complicated to explain,
you can get clearer information if you test it personally. Rolling Eyes Sad



FormatFactoryEkran Al&#305;nt&#305;s&#305;.jpg
 Description:
 Filesize:  115.05 KB
 Viewed:  30608 Time(s)

FormatFactoryEkran Al&#305;nt&#305;s&#305;.jpg



_________________
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
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Tue Apr 10, 2018 5:14 pm    Post subject: Reply with quote

DecodeFunction returns you a string, I think you should print it's output and look at what you got, before trying to load it.
Can't really help you with the errors without seeing the code itself,perhaps there's a mistake in the encoded code.

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
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 Lua Scripting All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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