PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: night_hawk on 21 March, 2004, 07:02:21

Title: need a password bot
Post by: night_hawk on 21 March, 2004, 07:02:21
i need a script so that my op and masters besides me can get any user password when they need it....Let me know if there is such a thing ty
Title:
Post by: Typhoon on 21 March, 2004, 10:55:22
there is such thing....


-- simple standalone get-password-by-nick-bot by bonki 09/06/03

sBotName         = "PasswdBot";
sGetPasswdPhrase = "!getpasswd";
sPasswdFile      = "../RegisteredUsers.dat";

function DataArrival(curUser, sData)
  local _, _, cmd, args = strfind(sData, "%b<>%s+(%S+)%s*([^%|]*)%|$");

  if(cmd == nil) then
    return 0; end

  cmd = strlower(cmd);

  if (cmd == sGetPasswdPhrase) then
    curUser:SendData(sData);

    if (curUser.bOperator) then
      if (strlen(args) > 0) then
        local sPasswd = GetPassword(args);
        if (sPasswd) then
          curUser:SendData(sBotName, args.."'s password is: '"..sPasswd.."'");
        else
          curUser:SendData(sBotName, "User "..args.." doesn't exist!");
        end
      else
        curUser:SendData(sBotName, "Syntax: "..sGetPasswdPhrase.." ");
      end
    else
      curUser:SendData(sBotName, "You don't have sufficient rights to run that command!");
    end
    return 1;
  end

  return 0;
end

function GetPassword(sFrom)
  local flPasswdFile = openfile(sPasswdFile, "r");
  local line         = "";

  sFrom = strlower(sFrom);

  if (flPasswdFile) then
    line = read(flPasswdFile);
    while (line) do
      _, _, sNick, sPasswd = strfind(line, "^(%S+)|(%S+)|");
      if (strlower(sNick) == sFrom) then
        return sPasswd;
      end
      line = read(flPasswdFile);
    end
    closefile(flPasswdFile);
  end

  return nil;
end

Title: Nice
Post by: Snoris on 21 March, 2004, 13:16:34
Now I'm very lazy here..Sorry about that...
But is there anyone who can make a change in the script??Or tell me if its already avalible...
Can the Masters/Hubowners check other users pwd in this script??
If not can anyone make it possible??
Title:
Post by: night_hawk on 21 March, 2004, 17:49:31
thank yu very much for the program it works great ty