|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Wed Nov 18, 2015 8:16 pm Post subject: Testing login form in a local computer |
|
|
Hi, cheat engine forum members
I try to make a login form for a local computer using CE Lua.
It work, but some part does not go as desired.
e,q : after check user detail (registered or not), script still running to show next messages. I think i made wrong put "if ..end" logic statement.
Please, someone give help to fix it.
Next, if everything work properly, is it possible store the text file as database file into CE stream file, so when the script running, it should be read and write file from/to a CE stream file.
Code: |
function checkUserLogin()
local a = control_getCaption(UDF1.CEEdit1)
a = tostring(a)
if a == "" or b == "" then
showMessage("You must input an email and password")
else
fh = io.open("test.txt") ---- path to test.txt
while true do
line = fh:read()
if line == nil then break end
-- print (line)
if string.find(line,a) then
showMessage("Login accepted !")
break
else
showMessage("You must register first!")
break
end
end
fh:close()
end
end
function getUserDetail()
local a = control_getCaption(UDF1.CEEdit1)
local b = control_getCaption(UDF1.CEedit2)
a = tostring(a)
b = tostring(b)
if a == "" or b == "" then
showMessage("Please input your email and password")
else
fh = io.open("test.txt") --- path to test.txt
while true do
line = fh:read()
if line == nil then break end
-- print (line) --- to test result
if string.find(line,a) then
showMessage("You already registered")
control_setCaption(UDF1.CEEdit1,"")
control_setCaption(UDF1.CEEdit2,"")
break
end
end
local file = io.open("test.txt", "a") -- path to test.txt
file:write(a.."/"..b, "\n")
file:close()
showMessage("Registering Complete !")
beep()
showMessage("Please login with your email and password")
control_setCaption(UDF1.CEEdit1,"")
control_setCaption(UDF1.CEEdit2,"")
end
end
--
function CEButton1Click(sender)
checkUserLogin()
end
--
function CEButton2Click(sender)
getUserDetail()
end
--
function CEButton3Click(sender)
closeCE();
return caFree
end
|
Thank you in advance and regards
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Nov 18, 2015 8:31 pm Post subject: |
|
|
Sounds like you just want to delete
Code: | showMessage("Please login with your email and password")
control_setCaption(UDF1.CEEdit1,"")
control_setCaption(UDF1.CEEdit2,"") |
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Thu Nov 19, 2015 8:36 am Post subject: |
|
|
Thanks Zanzer,
Now all work properly, just need to find how to put the database (text file) as stream file in CE if possible.
regards
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Nov 19, 2015 3:06 pm Post subject: |
|
|
I doubt you'll be able to write the file directly. There may be some function call to mimic the "Table > Add file" functionality.
|
|
Back to top |
|
|
|
|
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
|
|