AylinCE Grandmaster Cheater Supreme Reputation: 34
Joined: 16 Feb 2017 Posts: 1433
|
Posted: Thu Dec 08, 2022 3:44 pm Post subject: Creating unique VIP password! |
|
|
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.
_________________
|
|