Hello.. I request this script with 5 command:
--## +mypass - Show The User Password
--## +passwordlist - Will Show Password For Level REG's/ViP's/OP's/Moderator's/Master's/All
--## +repass - Change User PassWord
--## +changepass - Master Can Change user Password
--## +getpass - Get The User Password
+mypass for all registered user and other 4 commands only for master
thanks a lot bye bye
Here you go..
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
------
------ Made by ME ( Kepp )
------ Request by : 6Marilyn6Manson6
------ Date : 2004 - 12 - 21 ( Tuesday )
------
-----------------------------------------------------------------------------------
-----------------------------------------------------------------------------------
-- Set a Bot Name
sBot = "Password"
-- Prefix to use
sPrefix = "+"
-- Commands
sCOM1 = "mypass"
sCOM2 = "repass"
sCOM3 = "changepass"
sCOM4 = "getpass"
sCOM5 = "passwordlist"
-----------------------------------------------------------------------------------
tPassword = {};
tProfiles = {};
-----------------------------------------------------------------------------------
function Main()
readfrom("../RegisteredUsers.dat")
while 1 do
line = read()
if line == nil then break end
local s,e,sName,sPassword,sProfile = strfind(line,"(.+)|(.+)|(.+)")
tPassword[sName] = {Profile = sProfile,Password = sPassword}
end
readfrom()
readfrom("../Profiles.dat")
while 1 do
line = read()
if line == nil then break end
local s,e,sProfile,sName = strfind(line,"(%d+)|(%S+)|%d+")
tProfiles[sName] = tonumber(sProfile)
end
readfrom()
end
-----------------------------------------------------------------------------------
function DataArrival(user,sData)
if ( strsub( sData,1,1 ) == "<" ) then
sData = strsub( sData,1,-2 )
local s,e,sCmd = strfind(sData,"^%b<>%s+(%S+)")
if ( strsub( sCmd,1,1 ) == sPrefix ) then
sCmd = strsub( sCmd,2,-1 )
sCmd = strlower(sCmd)
if ( sCmd == sCOM1 ) then
if (user.iProfile ~= -1) then
if (tPassword[user.sName]) then
user:SendData(sBot,"Your password is : \""..tPassword[user.sName].Password.."\", Keep it in a safe place!")
return 1
else
user:SendData(sBot,"For some reason you could not be found!")
return 1
end
end
elseif ( sCmd == sCOM2 ) then
if (user.iProfile ~= -1) then
local s,e,sPass = strfind(sData,"^%b<>%s+%S+%s+(%S+)")
if sPass and strlen(sPass) >= 4 then
AddRegUser(user.sName,sPass,3)
user:SendData(sBot,"Sucessfully changed your password!")
return 1
else
user:SendData(sBot,"Either you didn't enter a password or it was too short, Password must be atleast 4 characters!")
return 1
end
else
user:SendData(sBot,"You are not registered!")
return 1
end
elseif ( sCmd == sCOM3 ) then
if (user.iProfile == 0) then
local s,e,Name,Pass = strfind(sData,"^%b<>%s+%S+%s+(%S+)%s*(%S+)")
if Name then
if Pass and strlen(Pass) >= 4 then
if tPassword[Name] then
Profile = tonumber(tPassword[Name].Profile)
AddRegUser(Name,Pass,Profile)
user:SendData(sBot,"You have sucessfully changed password of "..Name.." to \""..Pass.."\"")
return 1
else
user:SendData(sBot,"\""..Name.."\" is not registered on this hub!")
return 1
end
else
user:SendData(sBot,"Either you didn't enter a password or it was too short, Password must be atleast 4 characters!")
return 1
end
else
user:SendData(sBot,"Please enter a name that you will change password for!")
return 1
end
end
elseif ( sCmd == sCOM4 ) then
if (user.iProfile == 0) then
local s,e,Name = strfind(sData,"^%b<>%s+%S+%s+(%S+)")
if Name then
if (tPassword[Name]) then
user:SendData(sBot,"\""..Name.."\"'s Password is : \""..tPassword[Name].Password.."\"")
return 1
else
user:SendData(sBot,"\""..Name.."\" is not registered in this hub!")
return 1
end
else
user:SendData(sBot,"Please enter a name to get his / hers password!")
return 1
end
end
elseif ( sCmd == sCOM5 ) then
if (user.iProfile == 0) then
local s,e,sPro = strfind(sData,"^%b<>%s+%S+%s+(%S+)")
if sPro then
if (tProfiles[sPro]) then
Idx = GetProfileIdx(sPro)
Profiles = GetUsersByProfile(sPro)
sMsg = ""
for i,v in Profiles do
sMsg = sMsg.."( "..v.." )\r\nPassword : "..tPassword[v].Password.."\r\n\r\n"
end
user:SendData(sBot,"\r\n\r\n"..sMsg)
return 1
else
user:SendData(sBot,"\""..sPro.."\" is not a valid profile name!")
return 1
end
else
user:SendData(sBot,"Please enter a profile name, etc : "..sPrefix..sCOM5.." VIP")
return 1
end
end
end
end
end
end
Thanks a lot ^__^