1.

Solve : Looking Up Accounts.?

Answer»

Say I have a text file like so:
Code: [Select]acc1 password1 0
acc2 password2 1
acc3 password3 0
Where the acc# is the account name.
The password# is the accounts password.
And the following number is its status.
For instance 0 is a non-MEMBER and 1 is a member.

Say the player entered their username and password (correctly), how would i get the batch file to lookup their status and set %acc1%membership= 0 or 1.

But if their password was incorrect compared to the text file then nothing would happen just a message.

Also would i just do this to output their account info?
ECHO %accname% %accpassword% %membership% >Players.txt

Thanks in advance, sorry if it is hard to understand.Code: [Select]@echo off
set /p acc=enter account number:
set /p pwd=enter password:
for /f "tokens=3 delims= " %%A in ('type example.txt ^| find %acc%') do (
if not %pwd%==%%B (
echo Wrong password!
pause
goto EOF
)
)
set /p mbr=are they a member 1 or 0?
findstr /v %acc% c:\users\public\test\example.txt >example1.txt
echo. %acc% %pwd% %mbr% >>example1.txt
del example.txt & ren example1.txt example.txt
pause
replace example.txt with whatever your text file is called.

FBthank you.
i take it that it works?

FBnot REALLY, but i've scraped the project now ANYWAY.



Discussion

No Comment Found