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 


Add label and option to CE?

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

Joined: 17 Jan 2018
Posts: 202

PostPosted: Sun May 19, 2019 8:18 am    Post subject: Add label and option to CE? Reply with quote

1) How to add label, that shows current quantity of memory records near "Table Extras" in the bottom of CE general window (purple rectangle on the screenshot)? I constantly miss this function, when I use Cheat Engine.

2) CE has an option, when we right click with the mouse on the memory record, there is an option: Group config -> Hide children when deactivated.
How to add an option there: Hide children when activated?



111.JPG
 Description:
 Filesize:  73.65 KB
 Viewed:  2908 Time(s)

111.JPG


Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun May 19, 2019 11:40 am    Post subject: Reply with quote

1, To count the sum of address list items.

Code:
addlist = getAddressList()
count = addlist.count
print(count)


And to add Label (caption change by that function above) then:

Code:
Main = getMainForm()
ThePanel = Main.Panel4

NewLabel = createLabel(ThePanel)       
NewLabel.caption = 'Address List Count : '..count


But I am not sure what is the component name on CE Main form with 'Table Extras Button' there. I think it should be Panel 4. Also, I am not sure about placing the label as you wish, since all components on Panel 4 set to their client width and height. Maybe adding a new panel is the better solution.

2. Hide children menu will show when doing the right click, of course, if the address list contains parent and children and that can be set via group config.

Here some functions for group config.

Code:
function miHideChildrenClick(mr)
   if mr.Options:match("moHideChildren") == nil then
      mr.Options = mr.Options.."moHideChildren"
   else
      mr.Options = mr.Options:gsub("moHideChildren","")
   end
end

function miBindActivationClick(mr)
   if mr.Options:match("moActivateChildrenAsWell") == nil then
      mr.Options = mr.Options.."moActivateChildrenAsWell"
   else
      mr.Options = mr.Options:gsub("moActivateChildrenAsWell","")
   end
end

function miBindDeactivationClick(mr)
   if mr.Options:match("moDeactivateChildrenAsWell") == nil then
      mr.Options = mr.Options.."moDeactivateChildrenAsWell"
   else
      mr.Options = mr.Options:gsub("moDeactivateChildrenAsWell","")
   end
end

function miRecursiveSetValueClick(mr)
   if mr.Options:match("moRecursiveSetValue") == nil then
      mr.Options = mr.Options.."moRecursiveSetValue"
   else
      mr.Options = mr.Options:gsub("moRecursiveSetValue","")
   end
end

function miAllowCollapseClick(mr)
   if mr.Options:match("moAllowManualCollapseAndExpand") == nil then
      mr.Options = mr.Options.."moAllowManualCollapseAndExpand"
   else
      mr.Options = mr.Options:gsub("moAllowManualCollapseAndExpand","")
   end
end

function miManualExpandCollapseClick(mr)
   if mr.Options:match("moManualExpandCollapse") == nil then
      mr.Options = mr.Options.."moManualExpandCollapse"
   else
      mr.Options = mr.Options:gsub("moManualExpandCollapse","")
   end
end

function optionWrapper(sender)
   local sr = al.getSelectedRecords()
   for i in pairs(sr) do
      if al[i-1].Count > 0 then
         if sender.Name == "miHideChildren" then miHideChildrenClick(al[i-1])
         elseif sender.Name == "miBindActivation" then miBindActivationClick(al[i-1])
         elseif sender.Name == "miBindDeactivation" then miBindDeactivationClick(al[i-1])
         elseif sender.Name == "miRecursiveSetValue" then miRecursiveSetValueClick(al[i-1])
         elseif sender.Name == "miAllowCollapse" then miAllowCollapseClick(al[i-1])
         elseif sender.Name == "miManualExpandCollapse" then miManualExpandCollapseClick(al[i-1])
         end
      end
   end
end

--Events-------------------------------------------------------------------------------------------
mf.miHideChildren.onClick = optionWrapper
mf.miBindActivation.onClick = optionWrapper
mf.miBindDeactivation.onClick = optionWrapper
mf.miRecursiveSetValue.onClick = optionWrapper
mf.miAllowCollapse.onClick = optionWrapper
mf.miManualExpandCollapse.onClick = optionWrapper

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Razi
Expert Cheater
Reputation: 1

Joined: 17 Jan 2018
Posts: 202

PostPosted: Sun May 19, 2019 6:09 pm    Post subject: Reply with quote

I can create a label on the place where was needed with following code:
Code:
Main = getMainForm()
addlist = getAddressList()
ThePanel = Main.Panel4

NewLabel = createLabel(ThePanel)
NewLabel.Left = 405
NewLabel.caption = 'records : '..addlist.count

But, on what events memory records value should change in the label? Main.OnMouseMove = function() or Main.OnKeyPress = function()? I want to change value when quantity of memory records are changed and when opening a .CT file, without creating a timer. But can't find a solution.

I saw Group Config lua extension before created topic. But, didn't understand how to do what was needed. Don't know what needs to be changed in the following code to achieve what I wanted.
Code:
function miHideChildrenClick(mr)
   if mr.Options:match("moHideChildren") == nil then
      mr.Options = mr.Options.."moHideChildren"
   else
      mr.Options = mr.Options:gsub("moHideChildren","")
   end
end
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun May 19, 2019 9:51 pm    Post subject: This post has 1 review(s) Reply with quote

I use this, save as Lua file and put on CE autorun folder.

Code:
function listChange(sender)
 List = getAddressList()
 x = List.Count
 Label1.Caption = 'Records : '..x
end

Main = getMainForm()

MPanel = createPanel(Main)
MPanel.width,MPanel.height,MPanel.top,MPanel.left = 10,15,0,50
MPanel.Align = alBottom
MPanel.Caption = ''
MPanel.height = 23

Label1 = createLabel(MPanel)
Label1.Left = 5
Label1.Top = 5
Label1.Caption = 'Records : 0'


List = getAddressList()
Label1.onMouseEnter = listChange


Since I don't know what is the component name for address list part on CE main form default. If you know it then you can use [address list component name].onChange event.

For group config see video here :

https://mega.nz/#!z1d0zKSS!hKW_VEAlf441QUE-1bo2-9_Il-yh8-ikXnhBas2xbEY

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