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 


Cheat Engine Forum Index
PostGo back to topic
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52
Joined: 13 Sep 2011
Posts: 1578

PostPosted: Mon Feb 18, 2019 7:40 am    Post subject:

Oh I think I understood,
If for example we have a primary CE window open.
and then we open another (secondary) window, it should have green borders.
But if we close now primary CE window, and then re-open again CE, we'll have 2 windows with both green.

if we open third window, and close any of the first two, and re-open again, then the new window will have the very same color of the third...
Basically duplicate of colors.

Solution:
Replace this code:
Code:
local processList = createStringlist()
getProcesslist(processList)

local count=0
for i=0,processList.Count-1 do
  if (processList[i]:match('cheatengine%-i386.exe')) or
     (processList[i]:match('cheatengine%-x86_64.exe')) then
    count=count+1
  end
end

processList.destroy()


with this code:
(it uses application class, and getWindowList fetches the title of application class as a title, so we use that title as a tag).
Code:
local app,it,count = getApplication(),{},1; -- it is instanceTable, a temporary table where I store used ID's.
function inTable(t,V)
   for k,v in pairs(t or{})do
      if(v==V)then return true;end;
   end;return false;
end
for pid,uselessTab in pairs(getWindowlist()) do
   if (uselessTab[0]:match("(Cheat Engine [%d%.]+)")) then -- try to match Cheat Engine X.X.X....
      local isInstance = tonumber(uselessTab[0]:match("%*(%d+)$")); -- tryna fetch given id for that window
      if (isInstance) then
         table.insert(it,isInstance);
         while (inTable(it,count)) do
            count = count + 1;
         end
      end
   end
end
app.Title = table.concat({app.Title," - *", count},"") -- generates new application title, based on available id;

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
Post reviews:   Approve 1
Author Review
AylinCE
Review: Approve
Post reference:
ReviewPosted: Mon Feb 18, 2019 12:55 pm

Thanks Master.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display:  
Cheat Engine Forum Index


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites