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 


Create Your Custom Form Trainer Using CE Lua

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

Joined: 10 Apr 2015
Posts: 892

PostPosted: Sat Apr 27, 2019 12:22 am    Post subject: Create Your Custom Form Trainer Using CE Lua Reply with quote

Hi, there...
This is just a simple customize basic CE Trainer form which you can use for your game hack trainer.

1. Form GUI already made and editable
2. Some functions for form control are included
3. Give attention to form components anchors such as button, edit box, etc must be edit according to form minimize or maximize

Code:
----------------------------------------------------------- Form Basic Control

-- function to control form when it drag
--

function DragIt()   
 f.DragNow()
end

-- function to control form set to minimized when minimize button has clicked
-- double click your form on the left bottom corner to set it normal
--

function formMinimize()   ---
 f.WindowState = 'wsMinimized'
end


-- function to control form set to maximized when maximize button has clicked
-- click again maximize button to set it to normal form
--

x = 0

function formMaximize()
 if x == 0 then
 f.WindowState = 'wsMaximized'
 x = 1
 else
 f.WindowState = 'wsNormal'
 x = 0
 end
end

-- function to close the form and close CE
--

function formClose()
 f.Close()
 closeCE()
 return caFree
end

----------------------------------------------------------- Form GUI

-- The Main Form
-- edit form width, height as you wish
-- edit form color as you wish

f = createForm()
f.Width = 300                 
f.Height = 300
f.Position = 'poScreenCenter'
f.Color = '2372490'
f.BorderStyle = 'bsNone'
f.onMouseDown = DragIt


-- Main Panel to placing your Trainer Name, Min.Button, Max.Button and Close Button.
-- edit panel height if you want more space
-- give attention to panel anchors, it set to follow Main Form Size
-- edit panel color as you wish
--

pnUp = createPanel(f)
pnUp.setPosition(5,30)
pnUp.setSize(290,265)
pnUp.Color = '10212351'
pnUp.BorderStyle = 'bsNone'
pnUp.BevelInner = 'bvLowered'
pnUp.BevelOuter = 'bvLowered'
pnUp.Anchors = '[akTop,akLeft,akRight,akBottom]'


-- Main Label to placing your Trainer Title
-- give attention to labels anchors, it set to left, top whatever Main Form size changed
--

fTitle = createLabel(f)
fTitle.setPosition(10,5)
fTitle.Font.Color = '0xFFFFFF'
fTitle.Font.Size = 11
fTitle.Font.Name = 'Verdana'
fTitle.Caption = 'My Trainer'
fTitle.Anchors = '[akTop,akLeft]'


-- 3 Basic Buttons: Minimize, Maximize and Close Buttons
-- It's created using 3 images, adjust images size and position according to your source images size
-- give attention to labels anchors, it set to right, top whatever Main Form size changed
-- add your source images to CE File Table with the name: btnMin.png, btnMax.png, and btnClose.png (or according to your source images type)
-- cursor mode set to hand point when entering the buttons/images (cursor code: -21)
--

img_BtnMin = createImage(f)
img_BtnMin.Picture.loadFromStream(findTableFile('btnMin.png').Stream)
img_BtnMin.setSize(22,22)
img_BtnMin.setPosition(232,4)
img_BtnMin.Stretch = true
img_BtnMin.Transparent = true
img_BtnMin.Cursor = -21
img_BtnMin.Anchors = '[akTop,akRight]'
img_BtnMin.onClick = formMinimize

img_BtnMax = createImage(f)
img_BtnMax.Picture.loadFromStream(findTableFile('btnMax.png').Stream)
img_BtnMax.setSize(22,22)
img_BtnMax.setPosition(254,4)
img_BtnMax.Stretch = true
img_BtnMax.Transparent = true
img_BtnMax.Cursor = -21
img_BtnMax.Anchors = '[akTop,akRight]'
img_BtnMax.onClick = formMaximize

img_BtnClose = createImage(f)
img_BtnClose.Picture.loadFromStream(findTableFile('btnClose.png').Stream)
img_BtnClose.setSize(22,22)
img_BtnClose.setPosition(275,4)
img_BtnClose.Stretch = true
img_BtnClose.Transparent = true
img_BtnClose.Cursor = -21
img_BtnClose.Anchors = '[akTop,akRight]'
img_BtnClose.onClick = formClose

----------------------------------------------------------- Form Components Here
-- create here your form trainer scripts for components such as buttons, panel, edit box, etc
-- create and place here your scripts functions and events handlers


Good luck...

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
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