Posted: Tue Jul 23, 2019 8:03 pm Post subject: Cheat Engine Lua and Intro - Gif
The masters have published a lot on the subject.
To me, this is the most useful.
You can click, you can determine the location.
You can prepare multiple gifs and run them independently.
We give you the full code and as an example:
The following example: Trainer input animation.
You can change and use it as you wish.
Before specifying a few basic rules:
Let me talk about the masters who produced this coding.
This code generating and developing;
@Corroder and @FreeER, thanks.
17 I used it with the Trainer and reached it in its final form.
And having it will add some fun to your Trainer.
There are 3 basic rules: ( of course interchangeable. )
1) Picture names can be from "frame_001" to "frame_999".
2) You should split a normal ".gif" image into fragmented ".png" s.
... here is a site that will do this easily to you. : https://ezgif.com/split
cf.: (Ezgif.jpeg)
3-1) Do not activate Script repeatedly during editing.
This ensures that the images are loaded twice and there is confusion.
Note that when you create "createGif" it generates.
3-2) and do not activate Script in the "Form Design" panel.
Records the generated gif in the "Form Designer".
Delete it and don't host it in "Form Designer."
Currently available code: (No images )
Code:
local form1 = createForm(true) --Form1 = UDF1 or CETrainer name
form1.Position = poDesktopCenter
form1.Width = 316
form1.Height = 460
form1.caption="Form Play Gif"
local b1 = createButton(form1)
control_setPosition(b1, 123, 390)
b1.caption="Stop G1"
local b2 = createButton(form1)
control_setPosition(b2, 123, 430)
b2.caption="Stop G2"
----------------- Voice Message -------------------
local t1 = createTimer(form1)
t1.Interval = 10000
t1.OnTimer = function()
showMessage=(speak("Click Cheat Engine to donate.", waittilldone));
end
t1.Enabled = true
------------------- Image Gif Code ----------------
--ImageGIF Code Creator: Corroder and FreeER Thanks
---------------------------------------------------
function createGIF(form, width, top, frames, doCenter)
local pics={}
for _,frame in pairs(frames) do
local pic
if frame.ClassName == 'TMemoryStream' then
pic = createPicture()
pic.loadFromStream(frame)
else -- first try to load as a tableFile then as a filepath
local file = findTableFile(frame)
if file then
pic = createPicture()
pic.loadFromStream(file.Stream)
else
-- loadFromFile doesn't report success, nor does the Picture object
-- have a way to check, so do it ourselves first.
local function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
if file_exists(frame) then
pic = createPicture()
pic.loadFromFile(frame)
end
end
end
-- if successfully loaded then add it
if pic then pics[#pics+1] = pic end
end
-- if we failed to load any frames
if #frames ~= 0 and #pics == 0 then return nil end
pics.currentPicture = 1
local mImage = createImage(form)
mImage.top = top
mImage.left = mImage.left
if doCenter then
mImage.left = (form.width-mImage.width) / 2
end
mImage.stretch = true
local gif = {}
gif.image = mImage
gif.pics = pics
gif.next = function()
pics.currentPicture = (pics.currentPicture % #pics) + 1
mImage.Picture = pics[pics.currentPicture]
end
gif.timer = createTimer(mImage)
gif.timer.Interval = 3000 / #gif.pics -- frames per second
gif.timer.OnTimer = function(sender) gif.next() end
return gif
end
local frameNameFormat = 'frame_%03d.png'
---------------------- Create Gif -----------------------
------------------------- Gif 1--------------------------
local t = {}
for i=1,11 do
t[i] = findTableFile(frameNameFormat:format(i)).Stream
end
local gif1 = createGIF(form1, 277, 280, t, false)
gif1.image.width = 277
gif1.image.Left = 20
gif1.image.Top = 10
gif1.image.height = 320
gif1.image.stretch = true
------------------------- Gif 2 -------------------------
local t = {}
for i=12,19 do
t[#t+1] = findTableFile(frameNameFormat:format(i)).Stream
end
local gif2 = createGIF(form1, 296, 280, t, false)
gif2.image.width = 296
gif2.image.Left = 10
gif2.image.Top = 340
gif2.image.height = 40
gif2.image.stretch = true
-------------- Gif Play False or True ---------------
gif1.image.Visible = true
gif2.image.Visible = true
----------------- Gif Play - Pause ------------------
b1.OnClick = function()
if gif1.image.Visible == false then
gif1.image.Visible = true
t1.Enabled = true
b1.caption="Stop G1"
else
gif1.image.Visible = false
b1.caption="Play G1"
t1.Enabled = false
end
end
b2.OnClick = function()
if gif2.image.Visible == false then
gif2.image.Visible = true
b2.caption="Stop G2"
else
gif2.image.Visible = false
b2.caption="Play G2"
end
end
gif2.image.OnClick = function()
shellExecute("https://www.paypal.com/xclick/business=dark_byte%40hotmail.com&no_note=1&tax=0&lc=US")
end
I think you could use this project and help CE a bit.
Note: With this code, 13 gifs in one Trainer and
I used 127 pictures.
They all worked smoothly.
Here is the code I used, CE Lua Game Trainer.
Take some stress and test the gifs.
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