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 control

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

Joined: 26 Oct 2021
Posts: 53

PostPosted: Sun Apr 10, 2022 3:53 am    Post subject: cheat control Reply with quote

I have a coach and I need to do it.to check the version of the cheat engine, the type of operating system and the name of the computer (please explain what needs to be done, I don't understand much about it)

and I would also like to know how to do this so that if all the conditions were correct, the password was changed after a day (that is, a day passed and the password was changed to another one)
Back to top
View user's profile Send private message
HexaG0n
Advanced Cheater
Reputation: 0

Joined: 29 Mar 2021
Posts: 64

PostPosted: Sun Apr 10, 2022 4:08 am    Post subject: Reply with quote

getCEVersion = get cheat engines version
os.getenv('USERNAME') = get computer name
os.getenv('OS') = get the current operating system type
Back to top
View user's profile Send private message
Starter_But
Advanced Cheater
Reputation: 0

Joined: 26 Oct 2021
Posts: 53

PostPosted: Sun Apr 10, 2022 4:34 am    Post subject: Reply with quote

thanks
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1251

PostPosted: Sun Apr 10, 2022 4:36 am    Post subject: Reply with quote

( Some queries may differ depending on PC status. )

Code:
version = getCEVersion()
--print(version)

RequiredCEVersion=7.4
if (getCEVersion==nil) or (getCEVersion()<RequiredCEVersion) then
local answer = messageDialog("You are using an old version!\nWould you like to download the current version\nfrom the Cheat Engine site?", mtWarning, mbYes, mbNo)
if answer == mrYes then
shellExecute("https://www.cheatengine.org/")
  closeCE()
 return caFree()
else
  closeCE()
 return caFree()
end
end


--------------------------------------------
Code:
local usrID
function UserID()
local function all_trim(s)
  return s:match"^%s*(.*)":match"(.-)%s*$"
end

local fh = assert(io.popen'wmic csproduct get uuid')
result = fh:read'*a'
fh:close()
result = string.gsub(result,'UUID',"")
result = all_trim(result)
rst = result:gsub('%a',''):gsub('%p','')
return rst
end

usrID=UserID()
print(usrID)


------------------------------------------
Code:
function systemTarget()
local arch
local res=""
 if (os.getenv"os" or ""):match"^Windows" then
   res=res.."Windows"
   arch = os.getenv"PROCESSOR_ARCHITECTURE"
   else
   res=res.."Linux"
   arch = io.popen"uname -m":read"*a"
 end
 if (arch or ""):match"64" then
   res=res.." 64-bit"
   else
   res=res.." 32-bit"
 end
return res
end

sys=systemTarget()
print(sys)


Or check the link in my signature to test similar steps.

_________________
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
Starter_But
Advanced Cheater
Reputation: 0

Joined: 26 Oct 2021
Posts: 53

PostPosted: Sun Apr 10, 2022 4:43 am    Post subject: Reply with quote

AylinCE wrote:
( Some queries may differ depending on PC status. )

Code:
version = getCEVersion()
--print(version)

RequiredCEVersion=7.4
if (getCEVersion==nil) or (getCEVersion()<RequiredCEVersion) then
local answer = messageDialog("You are using an old version!\nWould you like to download the current version\nfrom the Cheat Engine site?", mtWarning, mbYes, mbNo)
if answer == mrYes then
shellExecute("https://www.cheatengine.org/")
  closeCE()
 return caFree()
else
  closeCE()
 return caFree()
end
end


--------------------------------------------
Code:
local usrID
function UserID()
local function all_trim(s)
  return s:match"^%s*(.*)":match"(.-)%s*$"
end

local fh = assert(io.popen'wmic csproduct get uuid')
result = fh:read'*a'
fh:close()
result = string.gsub(result,'UUID',"")
result = all_trim(result)
rst = result:gsub('%a',''):gsub('%p','')
return rst
end

usrID=UserID()
print(usrID)


------------------------------------------
Code:
function systemTarget()
local arch
local res=""
 if (os.getenv"os" or ""):match"^Windows" then
   res=res.."Windows"
   arch = os.getenv"PROCESSOR_ARCHITECTURE"
   else
   res=res.."Linux"
   arch = io.popen"uname -m":read"*a"
 end
 if (arch or ""):match"64" then
   res=res.." 64-bit"
   else
   res=res.." 32-bit"
 end
return res
end

sys=systemTarget()
print(sys)


Or check the link in my signature to test similar steps.





Thank you for the answer, but please explain what it means
--------------------------------------------
Code:
local usrID
function UserID()
local function all_trim(s)
  return s:match"^%s*(.*)":match"(.-)%s*$"
end

local fh = assert(io.popen'wmic csproduct get uuid')
result = fh:read'*a'
fh:close()
result = string.gsub(result,'UUID',"")
result = all_trim(result)
rst = result:gsub('%a',''):gsub('%p','')
return rst
end

usrID=UserID()
print(usrID)


------------------------------------------
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1251

PostPosted: Sun Apr 10, 2022 5:15 am    Post subject: Reply with quote

Starter_But wrote:

Thank you for the answer, but please explain what it means
--------------------------------------------
Code:
local usrID
function UserID()
local function all_trim(s)
  return s:match"^%s*(.*)":match"(.-)%s*$"
end

local fh = assert(io.popen'wmic csproduct get uuid')
result = fh:read'*a'
fh:close()
result = string.gsub(result,'UUID',"")
result = all_trim(result)
rst = result:gsub('%a',''):gsub('%p','')
return rst
end

usrID=UserID()
print(usrID)


------------------------------------------


AylinCE wrote:


Or check the link in my signature to test similar steps.

_________________
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
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Sun Apr 10, 2022 5:29 am    Post subject: Reply with quote

Code:

function UserID()
   -- Internal function to trim whitespace
   local function all_trim(s)
      return s:match"^%s*(.*)":match"(.-)%s*$"
   end

  -- Use powershell/terminal to find the UUID via the command
  -- wmic csproduct get
  local fh = assert(io.popen'wmic csproduct get uuid')
  -- Open the result handle as read with the flag *a which means all
  result = fh:read'*a'
  -- Close the file handle
  fh:close()

  -- Remove the text 'UUID' from the result
  result = string.gsub(result, 'UUID', "")
  -- Trim all whitespace from the result
  result = all_trim(result)
  -- Some other text manipulation
  rst = result:gsub('%a',''):gsub('%p','')
  return rst
end

print(UserID())


Just explains what Aylin's code does. Also removed some redundancies .
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