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 


Creating unique VIP password!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 33

Joined: 16 Feb 2017
Posts: 1329

PostPosted: Thu Dec 08, 2022 3:44 pm    Post subject: Creating unique VIP password! Reply with quote

What you use this code for is up to you.

The single topic has been expanded with 3 codes.

It is related to the topic in the link I shared below.

Sample;
You can create a user password for your VIP members. And you can hide this password where it can't find it and check it.

See this topic:

https://forum.cheatengine.org/viewtopic.php?t=613418

1) Create unique password:

Code:
function generator(length,episode)
  local capital_letters = {"A", "E", "I", "U", "W", "Q", "X"}
  local low_letters = {"B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "V", "Y", "Z"}
  local numbers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
  math.randomseed(os.time())
  local pass = ""
  local choice = 0
  local nextPass = ""

local function epsd()
  for _ = 1, length do
    choice = math.random(3)

    if choice == 1 then
      pass = pass .. capital_letters[math.random(#capital_letters)]
    elseif choice == 2 then
      pass = pass .. low_letters[math.random(#low_letters)]
    else
      pass = pass .. numbers[math.random(#numbers)]
    end
  end
  return pass
end

 if episode>1 then
  for i = 1, episode do
   pass = ""
   nextPass = nextPass .. "-" .. epsd()
  end
 else
  nextPass = epsd()
 end
 return nextPass
end


Use:
Code:
loadKey1 = generator(10,1)
print("loadKey1: "..loadKey1)

-- loadKey1: 3Q8N8N7388
-- loadKey1: E4X26JP6T3
Code:
loadKey1 = generator(5,5)
print("loadKey1: "..loadKey1)

-- loadKey1: -KA3Y4-JQZXF-UCEX2-KU41Q-IEJUI
-- loadKey1: -TU31E-MY5S3-J20VX-U663M-21XE7

2) Save, restore and read this:

Code:
loadKey1 = ""
settingsKey1=getSettings('key1')

function SaveKey(nextKey)
settingsKey1.Value['keys1'] = nextKey
--print(nextKey)
end

function LoadKey()
loadKey1 = settingsKey1.Value['keys1']
  if loadKey1=="" then
   loadKey1 = generator(10,1)
   SaveKey(loadKey1)
  end
end

LoadKey()
print("loadKey1: "..loadKey1)


3) Get unique id from user:

Windows 10 and 11 will probably not have a UUID. This will restrict the intended use of "wmic".
Here is another unique id; This id will not change even if Windows is refreshed.

Code:
MyId = [[reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SQMClient /v MachineId]]

function all_trim(s)
  return s:match("{(.*)}"):gsub("%a",""):gsub("-","")
end

local UserID = ""

function usrids()
local fh = assert(io.popen(MyId))
result = fh:read'*a'
fh:close()
result = all_trim(result)
return result
end

UserId = usrids()
print("UserId: "..UserId)


If you are in doubt about this id similarity, try combining the codes:

Code:
VipCode = loadKey1 .. "-" .. UserId
print("Vip code: " .. VipCode)


And the end of the topic.
I assume that you will interpret and use this code correctly.
Otherwise, do not turn to results that will damage your reputation.

Note: Cheat Engine is not responsible for these shares. The subject is purely "Lua" coding teaching. Otherwise; By using this code, you will have taken the responsibility.

See you on another interesting topic.
Don't forget to leave a reputation if it works for you. Wink

_________________
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 Tutorials -> LUA Tutorials 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 cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites