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 


Hotkey customization in custom created form.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
LOKEN 7 (Death GOD 7)
Advanced Cheater
Reputation: 0

Joined: 21 Jan 2017
Posts: 78
Location: Kathmandu,Nepal

PostPosted: Sat Sep 02, 2017 4:46 am    Post subject: Hotkey customization in custom created form. Reply with quote

Can anyone here help me with hotkeys customization in custom form?
I viewed some other forum posts and found a start that to assign hotkeys by right clicking the address/script then click on set/change hotkeys.
And then after that I have to click on generate generic lua table from table.then I should change the trainer output format to script only.I did upto that and I got myself a lua scripts.

And the trainer works

But I want to change it color when the cheat is activated
I used label to show which key activates what cheat.
Let's assume I have 2 cheats and I have 2 label.
1.c1
2.c2

Both label (c1,c2 ) have something already written in black color
And when the cheats activates through hotkeys I want to change the color of labels.

Can anyone help me what to write in lua script code
Code:

function onPostHotKey(Hotkey)
...........
.....
....
end

To change color?

Thanks for reading to the last.
Regards 7

_________________
Don't think that I'm beginner because
EACH MASTER WAS ONCE BEGINNER
"If you are good at something,never do it for free"-The Joker
Dont Judge Me, Judge Yourself
I know you are looking at this post, Hitler
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

Joined: 07 Nov 2008
Posts: 4184
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Sep 03, 2017 7:24 am    Post subject: Reply with quote

In autogenerated forms, there are TCHEAT components (TCHEAT is a combination of few objects: hotkeylabel, descriptionlabel; and optional: tcheckbox and tedit)

You can change three properties with FormDesigner: Color, Textcolor and Activationcolor
(background color, text color, text color when active)



If you are using Labels instead of TCHEAT, you can change the color like this:
Code:
CETrainer.CELabel1.Color = 0x00ffff -- background color (yellow)
CETrainer.CELabel1.Font.Color = 0xff0000 -- text color (blue)

_________________
Back to top
View user's profile Send private message MSN Messenger
LOKEN 7 (Death GOD 7)
Advanced Cheater
Reputation: 0

Joined: 21 Jan 2017
Posts: 78
Location: Kathmandu,Nepal

PostPosted: Sun Sep 03, 2017 10:43 am    Post subject: Reply with quote

Thanks.I don't know how to use tcheat .can you explain
_________________
Don't think that I'm beginner because
EACH MASTER WAS ONCE BEGINNER
"If you are good at something,never do it for free"-The Joker
Dont Judge Me, Judge Yourself
I know you are looking at this post, Hitler
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

Joined: 07 Nov 2008
Posts: 4184
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Sep 04, 2017 9:53 am    Post subject: Reply with quote

TCHEAT objects are generated when you use "trainer generator" and "form designer". Look into "object inspector".


there you can change Activationcolor (text color when active), Color (background color), Textcolor (text color when not active)

_________________
Back to top
View user's profile Send private message MSN Messenger
LOKEN 7 (Death GOD 7)
Advanced Cheater
Reputation: 0

Joined: 21 Jan 2017
Posts: 78
Location: Kathmandu,Nepal

PostPosted: Mon Sep 04, 2017 12:41 pm    Post subject: Reply with quote

I know it comes there when I generate generic trainer but I can't use it in custom trainer. HELP?
_________________
Don't think that I'm beginner because
EACH MASTER WAS ONCE BEGINNER
"If you are good at something,never do it for free"-The Joker
Dont Judge Me, Judge Yourself
I know you are looking at this post, Hitler
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

Joined: 07 Nov 2008
Posts: 4184
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Sep 04, 2017 3:25 pm    Post subject: Reply with quote

CheatComponent (it's class is 'tcheat', it is used in Cheat Engine 5.x trainers, newer CE still can use it), if you make everything from the scratch, there's no icon in toolbox.

So, open second CE instance, add one entry with hotkey to addresslist. Generate "generic trainer", then open form designer, select tcheat object and copy it clipboard. Close second CE. Paste it in first CE to your custom Form, do it while this form is in "designing" state (you clicked menu Table->UDF1->Edit and FormDesigner toolbox is visible)

Or copy/paste this one:
Code:
object CHEAT0: tcheat
  Left = 0
  Height = 28
  Top = 0
  Width = 200
  CheatNr = 0
  Textcolor = clDefault
  Editwidth = 100
  Hotkey = 'no hotkey'
  Description = 'some description'
  Hotkeyleft = 0
  Descriptionleft = 90
  Activationcolor = clRed
  ShowHotkey = True
  HasEditBox = False
  HasCheckbox = False
end

_________________
Back to top
View user's profile Send private message MSN Messenger
Corroder
Master Cheater
Reputation: 8

Joined: 10 Apr 2015
Posts: 425

PostPosted: Mon Sep 04, 2017 4:56 pm    Post subject: Reply with quote

or maybe something like this ?.

Code:
red="0x000000FF"
black="0x00999999"

f = createForm()
f.Show()

label = createLabel(f)
label.Top = 40
label.Left = 30
label.Caption = 'Press F to activating hack'
label.Font.Size = 14

label1 = createLabel(f)
label1.Top = label.top + label.height + 10
label1.Left = 30
label1.Caption = 'Hack Not Active...'
label1.Font.Color = black

chg = true
function onPostHotKey()
   if chg then
       chg = false
       label1.Caption = 'Hack Not Active...'
       label1.Font.Color = black
    else
       chg = true
       label1.Caption = 'Hack activated...'
       label1.Font.Color = red
    end
end

if key1 then key1.destroy(); key1=nil end
key1 = createHotkey(onPostHotKey, VK_F)
key1.DelayBetweenActivate = 200



Just press F button. Again and again....

_________________
I can't do it now because I don't know yet and because You knew it before me. There is heaven above the sky.
Back to top
View user's profile Send private message
LOKEN 7 (Death GOD 7)
Advanced Cheater
Reputation: 0

Joined: 21 Jan 2017
Posts: 78
Location: Kathmandu,Nepal

PostPosted: Mon Sep 04, 2017 10:56 pm    Post subject: Reply with quote

@Corroder
For first I had also used label but Its long and I don't want to type again and again :😮
Very Happy

@mzr.inz
thanks I will try it out

And also Can we copy the object from one form to another? Question

_________________
Don't think that I'm beginner because
EACH MASTER WAS ONCE BEGINNER
"If you are good at something,never do it for free"-The Joker
Dont Judge Me, Judge Yourself
I know you are looking at this post, Hitler
Back to top
View user's profile Send private message
Corroder
Master Cheater
Reputation: 8

Joined: 10 Apr 2015
Posts: 425

PostPosted: Tue Sep 05, 2017 3:26 am    Post subject: Reply with quote

Quote:
@Corroder
For first I had also used label but Its long and I don't want to type again and again :😮


I just follow what explained on the topic.
and not sure understand what is mean "...Its long and I don't want to type again and again.."

_________________
I can't do it now because I don't know yet and because You knew it before me. There is heaven above the sky.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

Joined: 07 Nov 2008
Posts: 4184
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Tue Sep 05, 2017 4:39 am    Post subject: Reply with quote

LOKEN 7 (Death GOD 7) wrote:
And also Can we copy the object from one form to another? Question

Yes we can. When you highlight object in first form just press CTRL+C (sometimes you have to press it twice, don't know why).

_________________
Back to top
View user's profile Send private message MSN Messenger
LOKEN 7 (Death GOD 7)
Advanced Cheater
Reputation: 0

Joined: 21 Jan 2017
Posts: 78
Location: Kathmandu,Nepal

PostPosted: Wed Sep 06, 2017 8:57 am    Post subject: Reply with quote

@Corroder
It is long compared to the tcheat option. Lol Very Happy 😅😵
Again one question master (s)
1.from tcheat there is check box option which only is checked when I activate teainer,so I want my cheats to enable when I check them
Any help

_________________
Don't think that I'm beginner because
EACH MASTER WAS ONCE BEGINNER
"If you are good at something,never do it for free"-The Joker
Dont Judge Me, Judge Yourself
I know you are looking at this post, Hitler
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

Joined: 07 Nov 2008
Posts: 4184
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Wed Sep 06, 2017 10:59 am    Post subject: Reply with quote

Unfortunately tcheat component doesn't work that way...
_________________
Back to top
View user's profile Send private message MSN Messenger
LOKEN 7 (Death GOD 7)
Advanced Cheater
Reputation: 0

Joined: 21 Jan 2017
Posts: 78
Location: Kathmandu,Nepal

PostPosted: Wed Sep 06, 2017 12:45 pm    Post subject: Reply with quote

And in custom check box how to activate cheat manually by just checking
_________________
Don't think that I'm beginner because
EACH MASTER WAS ONCE BEGINNER
"If you are good at something,never do it for free"-The Joker
Dont Judge Me, Judge Yourself
I know you are looking at this post, Hitler
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 148

Joined: 07 Nov 2008
Posts: 4184
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Wed Sep 06, 2017 2:42 pm    Post subject: Reply with quote

Add OnClick event to the checkbox (while in "Form Designer", look into "Object Inspector", "Events" tab). Then change it into this:
Code:
function CECheckbox1Click(sender)
  memrec0.Active = sender.Checked
end

_________________
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 Lua Scripting 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