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 


Form-Color Button with simple codes

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
Aylin
Grandmaster Cheater
Reputation: 10

Joined: 16 Feb 2017
Posts: 643

PostPosted: Sun Feb 02, 2020 10:11 pm    Post subject: Form-Color Button with simple codes Reply with quote

I have no complicated coding ability.
For this reason, I completed the project with simple codes that did not tire the user.

Add colored buttons (images) to your trainer form.
Add as much as you want. And assign "OnClick" to these buttons.
If desired, place it in the CE Autorun folder and use the following command:

Code:
ColorButton(f, 20, 90, "Hack 1", Hack1, Hack2)


And download this zip archive, open it and install it in the CE Autorun folder.

https://www.dosyaupload.com/fqQ0

In your form, it will be enough to edit this command:
f = You Trainer name. Example UDF1 or MyTrainer
20 = Button Left
90 = Button Top
"Hack 1" = Button caption
Hack1 = Enable Hack function
Hack2 = Disable Hack Function

Code:
f = createForm(true)
f.Position = poDesktopCenter
f.Width = 320
f.Height = 200
f.caption = "Color Button"

local btnLbl1 = createLabel(f)
btnLbl1.AutoSize = false
btnLbl1.Alignment= "taCenter"
btnLbl1.Height=30
btnLbl1.Width=100
btnLbl1.Left=110
btnLbl1.Top=15
btnLbl1.Font.Size=12
btnLbl1.Font.Style="fsBold"
btnLbl1.caption="Button  ?"
-------
function Hack1()
if btnLbl1.caption=="Button  ?" then
btnLbl1.caption="Button  2" end
if btnLbl1.caption=="Button  1" then
btnLbl1.caption="Button  2" end
end

function Hack2()
if btnLbl1.caption=="Button  ?" then
btnLbl1.caption="Button  1" end
if btnLbl1.caption=="Button  2" then
btnLbl1.caption="Button  1" end
end

ColorButton(f, 20, 90, "Hack 1", Hack1, Hack2)
ColorButton(f, 180, 90, "Hack 2", Hack1, Hack2)


-----------------------------------------------
If you are going to have a global user-oriented deployment, try the sample code below:
Note: Button pictures are in the .zip archive at the link above.
Add the 2 button pictures you want to use to the Trainer with "add file".


Code:
f = createForm(true)
f.Position = poDesktopCenter
f.Width = 320
f.Height = 200
f.caption = "Color Button"

local btnLbl1 = createLabel(f)
btnLbl1.AutoSize = false
btnLbl1.Alignment= "taCenter"
btnLbl1.Height=30
btnLbl1.Width=100
btnLbl1.Left=110
btnLbl1.Top=15
btnLbl1.Font.Size=12
btnLbl1.Font.Style="fsBold"
btnLbl1.caption="Button  ?"
-------
function Hack1()
if btnLbl1.caption=="Button  ?" then
btnLbl1.caption="Button  2" end
if btnLbl1.caption=="Button  1" then
btnLbl1.caption="Button  2" end
end

function Hack2()
if btnLbl1.caption=="Button  ?" then
btnLbl1.caption="Button  1" end
if btnLbl1.caption=="Button  2" then
btnLbl1.caption="Button  1" end
end

function ColorButton(f, left, top, text, OnClick11, OnClick12)
local btnImg = createImage(f)
btnImg.Height = 43
btnImg.Width = 120
btnImg.Left = left
btnImg.Top = top
btnImg.Stretch = true
btnImg.picture.loadFromStream(findTableFile("BtnShdw1.png").stream)
btnImg.visible=true
------
local btnImg1 = createImage(f)
btnImg1.Height = 40
btnImg1.Width = 120
btnImg1.Left = left
btnImg1.Top = top
btnImg1.Stretch = true
btnImg1.picture.loadFromStream(findTableFile("Btn4.png").stream)
btnImg1.visible=true
------
local btnImg2 = createImage(f)
btnImg2.Height = 40
btnImg2.Width = 120
btnImg2.Left = left
btnImg2.Top = top
btnImg2.Stretch = true
btnImg2.picture.loadFromStream(findTableFile("Btn8.png").stream)
btnImg2.visible=false
------
local btnLbl2 = createLabel(f)
btnLbl2.AutoSize = false
btnLbl2.Alignment= "taCenter"
btnLbl2.Height=btnImg1.Height - 16
btnLbl2.Width=btnImg1.Width
btnLbl2.Left=btnImg1.Left
btnLbl2.Top=btnImg1.Top + 8
btnLbl2.Font.Size=11
btnLbl2.Font.Style="fsBold"
btnLbl2.caption=(text.." OFF")
btnLbl2.bringToFront()
------
function ClickEx()
if btnImg1.visible==true then
btnLbl2.caption=(text.." ON")
btnImg1.visible=false
btnImg2.visible=true
OnClick11()
else
btnLbl2.caption=(text.." OFF")
btnImg2.visible=false
btnImg1.visible=true
OnClick12()
end
end
btnLbl2.OnClick=ClickEx
end

ColorButton(f, 20, 90, "Hack 1", Hack1, Hack2)
ColorButton(f, 180, 90, "Hack 2", Hack1, Hack2)


2 button pictures (Enable-Disable) 1 shadow effect picture.
Add the same pictures from the Zip archive to the Trainer.

If you want more variety for the buttons, feel free to write in the comments.

Enjoy it! Wink



Ek1.png
 Description:
 Filesize:  31.13 KB
 Viewed:  3141 Time(s)

Ek1.png



_________________
Hi Hitler Take control of your trainer
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 MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions 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 can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites