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 


integrate a lua script in an existing cheat table

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Sanglante
Cheater
Reputation: 0

Joined: 27 Sep 2018
Posts: 43

PostPosted: Sun Apr 12, 2020 11:20 am    Post subject: integrate a lua script in an existing cheat table Reply with quote

Hi.
i have to work with mouse_event(MOUSEEVENTF_LEFTUP) working with a hotkey to activate my function

I have all of this working fine with a Form and a checkbox in it with my hot key activate it

but i don't know how to do that whithout a Form

Is there a way to use the checkbox of CheatEntry as checkbox of a form ?
With their ID ?

let's said ID 13:

checkbox13.Checked == true will work ?
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1532

PostPosted: Sun Apr 12, 2020 4:18 pm    Post subject: Reply with quote

In my last posts, I give examples with this code.
But it doesn't mind and it feels simple to edit. Smile

Example:

Code:
if f then f.destroy() f = nil end

f=createForm(true)
f.Position=poDesktopCenter
f.Width=220 f.Height=200

local cbx1=createCheckBox(f) cbx1.Left=50 cbx1.Top=25 cbx1.caption="OFF"
local cbx2=createCheckBox(f) cbx2.Left=50 cbx2.Top=50 cbx2.caption="OFF"
local cbx3=createCheckBox(f) cbx3.Left=50 cbx3.Top=75 cbx3.caption="OFF"

function onHack(item, id)
local name = "Hack"..id
if item.checked==false then
control_setCaption(item, "OFF")
item.checked=false
local memrec=addresslist_getMemoryRecordByDescription(getAddressList(), name)
memoryrecord_unfreeze(memrec)
else
item.checked=true
local memrec=addresslist_getMemoryRecordByDescription(getAddressList(), name)
memoryrecord_freeze(memrec)
control_setCaption(item, "ON")
end
end

cbx1.OnChange=function() onHack(cbx1, 1) end
cbx2.OnChange=function() onHack(cbx2, 2) end
cbx3.OnChange=function() onHack(cbx3, 3) end

--[[
--or UDF1 version

function CECheckBox1_OnChange(sender)
onHack(UDF1.CECheckBox1, 1)
end
]]

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