Show all passes if you are master with -allpass
--/Password bot by Phatty
--/24aug03
Bot = "Allpasswordsbot"
Baduser = "is trying to access the passwords"
function Main()
end
function DataArrival(user,data)
if( strfind( strlower(data), strlower("-allpass")) ) then
if not (user.iProfile==GetProfileIdx("Master")) then SendToAll(Bot, "Someone is trying to get the paswords, so i am disconnecting him/her")
user:Disconnect()
else
if (user.iProfile==GetProfileIdx("Master")) then ISMAS=1
if (ISMAS==1) then
readfrom("../registeredusers.dat")
while 1 do
line = read()
if line == nil then break end
user:SendPM(Bot,line)
end
readfrom()
end
end
end
end
end
-phatty
better idea -- get Mean_Machine
It has that option... :)
Why use mean machine i have my own Gekko v4.06 ;)
will have a better one soon ;)
Ahh...sorry...good point....
Never tried it thou...
why use a bot when you can get the passes out the hubsoft?
it shows you all the passes in the ops and bans tab.
i cant see the use for such a bot.
but thnx anyway phatty for the effort to try to make such a bot.
i wasn,t trying to put you down with my comment so please dont take any offense to it.
QuoteOriginally posted by [NL]trucker
why use a bot when you can get the passes out the hubsoft?
it shows you all the passes in the ops and bans tab.
i cant see the use for such a bot.
but thnx anyway phatty for the effort to try to make such a bot.
i wasn,t trying to put you down with my comment so please dont take any offense to it.
becouse
.....you can have two masters(only one hubsoft) in the machine, so one of these masters may need access to the passwords
.....or the master has his hubsoft running in another location
......or its more convinient
.....or its just plain kewl
Somthing strange i just tryed this script
but
passes where showen in main and names in pm
only thing a changed is instaed off -allpass i made !allpas because i have all my commands so
TiM? ?(
I noticed that too.
However, if you change the following line from:
user:SendPM(Bot,line)
to:
user:SendData(Bot,line)
it sends it all in main chat.
If this is the wrong way to do it, please let me know, i'm only just learning LUA :)
Hmm yep my mistake, yep i think senddata will work ok, i think yep :o)
here a little better for now
--/Password bot by Phatty 0.2
--/29oct03
Bot = "Keiko"
Baduser = " is trying to access the passwords, so i am disconnecting him/her"
Command = "!allpass"
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == Command then
if (user.iProfile==GetProfileIdx("Master")) then
readfrom("../registeredusers.dat")
while 1 do
line = read()
if line == nil then break end
user:SendData(Bot,line)
end
readfrom()
end
else
SendToAll(Bot,user.sName..Baduser)
user:Disconnect()
end
end
end
l8rr,,
-phatty
Nice easy scipt but a little suggestion.
Agree on reason on why to have such a scipt but how about adding possibility for a SU to get the Passwords aswell as Master.
Would it be as easy as editing the following line >>
if (user.iProfile==GetProfileIdx("Master")) then
to >>
if (user.iProfile==GetProfileIdx("Master", "SU")) then
Appreciate all ur work..
Thanks.
There's nothing called SU...
it means SuperOperator....
The Master :S
yep kepp is right
understand your problem... And this is how your line should be:
if (user.iProfile==GetProfileIdx("Master") or user.iProfile==GetProfileIdx("SU")) then
/NL
Since this is for Password Bot...
This is my version:
Hope you don't mind pH?tt?... :-)
*UPDATED*
--=*=*=*=*=*=*=*=*=*=*=*=--
-- Password Bot 0.2 --
-- By NightLitch 2003 --
-- --
-- !getpass --
-- --
-- Bug Fix: --
-- Change some things --
-- So You can send msg --
-- in Main and not get --
-- ** You don't have the --
-- sufficient rights to --
-- run this command... --
--=*=*=*=*=*=*=*=*=*=*=*=--
BOTNAME = "-P-Bot-"
PREFIX = "*"
REGFILE = ("../RegisteredUsers.dat")
REGGEDUSERS = {}
function Main()
frmHub:RegBot(BOTNAME)
end
function DataArrival(curUser,data)
if( strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
local _,_,cmd = strfind( data, "%b<>%s+(%S+)" )
if (cmd == PREFIX.."getpass" ) then
if (curUser.iProfile==GetProfileIdx("Master")) then
ShowPasses(curUser,data)
return 1
else
curUser:SendData(BOTNAME,"*** You don't have the sufficient rights to run this command...")
return 1
end
end
end
end
function ShowPasses(curUser,data)
local _,_,cmd,nick = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
if (nick == nil or nick == "") then
curUser:SendData(BOTNAME,"Syntax: !getpass ")
return 1
end
if nick then
local ViewOne = ""
curUser:SendData(BOTNAME,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
LoadRegistredFile(REGGEDUSERS,REGFILE)
for sNICK,sPASS in REGGEDUSERS do
if strlower(nick) == strlower(sNICK) then
curUser:SendData(BOTNAME,"Nick:"..nick)
curUser:SendData(BOTNAME,"Password: "..sPASS)
ViewOne = 1
end
end
if ViewOne == "" then
curUser:SendData(BOTNAME,"Searching:\r\nNick:"..nick.."\r\nPassword: Not Found")
end
curUser:SendData(BOTNAME,"-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
end
end
function LoadRegistredFile(table,file)
local handle = openfile(file, "r")
if (handle) then
local line = read(handle)
while line do
s,e,nick,password,status = strfind( line, "(%S+)|(%S+)|(%S+)")
table[nick] = password
line = read(handle)
end
closefile(handle)
end
end
-- By: NightLitch
Enjoy / NL
Nope not at all NL
Very nice :)
First off Thanks for the addd on to the script , Appreciate it.
Second off, not to tick anyone off but there is a SU and SU+ in my world(They just have different rights) and ofcourse Master.
Su=SuperUser
Su+= explains itself
And lastly
Master= Best of em all but has to deal with more shit...
Tks again y'll
haha noo if you look at gekko i also have super user
but what we mean is, there is no getprofileidx(SU)
sort of thin
I have improved the first Script that looked very strange.
I have added a translation of the level numbers and a tablelike layout. Here is an example of the list, below is the code :D
[05:38]
Registered Users at the HUB
[05:38]
[05:38] ? Level ?? nick ?? password ?? Online or Offline ?
[05:38] ? Networkfounder ?? Cool ?? uiuiuiui ?? Offline ?
[05:38] ? Networkfounder ?? StrangeOtto ?? hehehe ?? Online ?
[05:38] ? Reg ?? test ?? test ?? Offline ?
[05:38] ? Newbie ?? Sushi ?? kkkkk ?? Offline ?
[05:38] ? Admin ?? Strength ?? wwwwww ?? Online ?
[05:38] ? User ?? test2 ?? test2 ?? Offline ?
[05:38]
Here the code
Quote--/Password bot by StrangeOtto
--/13jan04
botName = "Botname"
Baduser = " is trying to access the passwords, so i am disconnecting him/her"
Command = "!userlist"
function TexteLoad(file,array,text) array[0]="" local x=0
readfrom(file)
repeat if (text) then text=text..array- .."\r\n" end x=x+1 array
- =read() until (array
- ==nil)
readfrom() return text
end
function doAdmin(user)
user:SendData(botName,"Registered Users at the HUB")
user:SendData(botName,"|")
user:SendData(botName," ? Level ?? nick ?? password ?? Online or Offline ? |")
name,pass,level=nil,nil,nil
local temp={}
TexteLoad("../RegisteredUsers.dat",temp)
for x=1,getn(temp) do s,e,name,pass,level=strfind(temp showArray = { sName=name, sPass = pass, slevel = level}
if level=="7" then lvl="Networkfounder" end
if level=="6" then lvl="Admin" end
if level=="5" then lvl="Moderator" end
if level=="4" then lvl="Newbie" end
if level=="3" then lvl="Reg" end
if level=="2" then lvl="VIP" end
if level=="1" then lvl="Operator" end
if level=="0" then lvl="Master" end
if GetItemByName(name) then
user:SendData(botName," ? "..lvl.." ?? "..name.." ?? "..pass.." ?? Online ? |")
else
user:SendData(botName," ? "..lvl.." ?? "..name.." ?? "..pass.." ?? Offline ? |")
end
end
user:SendData(botName,"|")
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == Command then
if (user.iProfile==GetProfileIdx("NetWorkFounder") or user.iProfile==GetProfileIdx("Admin")) then
doAdmin(user)
end
else
user:SendData(botName,"You do not have the rights to run this command, you are being disconnected.")
user:Disconnect()
end
return 1
end
end
found a bug in the last IF expression, disconnection on every command except the PW command, haha. so this is the correct one, working :D
Quote--/Password bot by StrangeOtto
--/13jan04
botName = "Botname"
Baduser = " is trying to access the passwords, so i am disconnecting him/her"
Command = "!userlist"
function TexteLoad(file,array,text) array[0]="" local x=0
readfrom(file)
repeat if (text) then text=text..array- .."\r\n" end x=x+1 array
- =read() until (array
- ==nil)
readfrom() return text
end
function doAdmin(user)
user:SendData(botName,"Registered Users at the HUB")
user:SendData(botName,"|")
user:SendData(botName," ? Level ?? nick ?? password ?? Online or Offline ? |")
name,pass,level=nil,nil,nil
local temp={}
TexteLoad("../RegisteredUsers.dat",temp)
for x=1,getn(temp) do s,e,name,pass,level=strfind(temp showArray = { sName=name, sPass = pass, slevel = level}
if level=="7" then lvl="Networkfounder" end
if level=="6" then lvl="Admin" end
if level=="5" then lvl="Moderator" end
if level=="4" then lvl="Newbie" end
if level=="3" then lvl="Reg" end
if level=="2" then lvl="VIP" end
if level=="1" then lvl="Operator" end
if level=="0" then lvl="Master" end
if GetItemByName(name) then
user:SendData(botName," ? "..lvl.." ?? "..name.." ?? "..pass.." ?? Online ? |")
else
user:SendData(botName," ? "..lvl.." ?? "..name.." ?? "..pass.." ?? Offline ? |")
end
end
user:SendData(botName,"|")
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if cmd == Command then
if (user.iProfile==GetProfileIdx("NetWorkFounder") or user.iProfile==GetProfileIdx("Admin")) then
doAdmin(user)
else
user:SendData(botName,"You do not have the rights to run this command, you are being disconnected.")
user:Disconnect()
end
end
return 1
end
end
QuoteOriginally posted by (uk-kingdom)pH?tt?
haha noo if you look at gekko i also have super user
but what we mean is, there is no getprofileidx(SU)
sort of thin
Feel I need to argue a little bit about this Phatty.. :-)
Sure you could have SU:
(curUser.iProfile==GetProfileIdx("SU")) IF you have added it in PtokaX Profile Manager... or Am I wrong about that ???
So I fully stand on your side [G-T-E]Gate?. :-)
Note: This is not for causing mean faces... just some facts... Smile and be happy... :-D