heeya all,
im makin my own script like you have read by
(making a script like robocop)
but i have a kind of problem/question...
on the moment i have this part..
-- created by johan at 13th of march 2k4
-- script is called Guard.lua
-- version 0.0.0.1 alpha
-- totally restarted at : 18th march
botname = "guard" --botname
function Main()
frmHub:RegBot(botname)
end
-- user reggen
function DataArrival(curUser,s)
local s,e, cmd,arg,arg2 = strfind(s,"%s+(%S+)%s+(%S+)%s+(.+)|")
if cmd == "!add" and curUser.bOperator then
AddRegUser(arg,arg2,3)
SendToAll(botname,"deze persoon heeft u reg status gegeven: "..curUser.sName.." hopelijk bent u blij met deze status en komt u vaker terug; "..arg)
return 1
elseif cmd == "!addop" and curUser.bOperator then
AddRegUser(arg,arg2,1)
SendToAll(botname,"Deze persoon heeft u opstatus gegeven "..curUser.sName.." u kunt nu ook mensen reggen "..arg.." maar overleg eerst met de MASTER!")
return 1
elseif cmd == "!addmaster" and curUser.sName == "Johan" then
AddRegUser(arg,arg2,0)
SendToAll(bot,"Deze person "..curUser.sName.." heeft "..arg.." medeowner gemaakt")
return 1
-- elesif cmd == "!delreg" and curUser.bOperator then
-- DelRegUser(arg,arg2,3)
-- Send:UserPM(bot,"deze persoon"..curUser.sName.." heeft "..arg.."verwijdert van zijn status")
-- return 1
end
end
by the part below i have put -- sign's so if you copy and use this script... don't remove them there is a error in that part... so in that part there comes my question how can i delete a registered person (and i want this only by done by Me or an master...)
(i now the messages a pers get are in dutch but i didn't want to translate it because its a dutch script...)
and another problem i need a script in wich you will see wich persons are regged and with wich passwords
Don't say use robocop ore something like that because i wan't to make a better thing then robocop..
Greetings,
Johan
thnx for all help i will get already.
:P
lol
hihi,
then you have a long, very long way to go m8
good luck :D
hmm.. very funny,
i do have a long way to go to replace robocop i now..
but i thought this was request fore scripts not a part of the forum where you can demolish new idea's ...
but if you thuoght this is the only part of my script.. its not.. its the begiinig part of my script wich i used before i started all over.. bt i still need help with deleting a reg and seeing wich users are regd..
greetings,
Johan :P
QuoteOriginally posted by b_w_johan and another problem i need a script in wich you will see wich persons are regged and with wich passwords
this can cause a big securety leak, if the password of 1 of your op's leak out it has the result that all passwords can leak out.
not a wise thing 2 add.
and indeed you got some more lines 2 code before you can reach the level of robocop.
but i would be the last 2 stop you from trying, good luck and many happy coding hours/month's.
plop
ok and is there not an option to ad an aditional password before you could use this command??
and What would you suggest i have to add in this script ??
greetings,
Johan (who will be scripting on thisa thing many years from now =-)) )
here some part you may want:
--=*=*=*=*=*=*=*=*=*=*=--
-- Password Bot 0.1 --
-- By NightLitch 2003 --
-- --
-- !getpass --
-- --
--=*=*=*=*=*=*=*=*=*=*=--
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 (curUser.iProfile==GetProfileIdx("SU+")) then
if (cmd == PREFIX.."getpass" ) then
ShowPasses(curUser,data)
return 1
end
else
curUser:SendData(BOTNAME,"*** You don't have the sufficient rights to run this command...")
return 1
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
/NL
and your delreg's:
hope you manage to get this working:
-------------------------------------------------------------------------------------------------------------
function doGetReguserLevel(username)
if not username then username = "" end
local allprofiles = GetProfiles()
local index, profile, index2, user
for index, profile in allprofiles do
local users = GetUsersByProfile(profile)
for index2, user in users do
if strlower(user) == strlower(username) then
return GetProfileIdx(profile)
end
end
end
return -1
end -- Thanks to Skrollster for this part :)
-------------------------------------------------------------------------------------------------------------
-- Delete Registrered User --
function dodeluser(curUser,data)
s,e,arg = strfind( data, "%b<>%s+%S+%s+(.+)" )
if arg == nil or arg == "" then
curUser:SendTo(BotName,CmdErrorMsg.." "..Prefix.."deluser :"..CmdErrorPar)
return 1
end
usr = 0
go = 0
user = GetItemByName(arg)
iUserLevel = doGetReguserLevel(arg)
if iUserLevel then
usr = 1
-- MSR --
if iUserLevel == 0 and (curUser.iProfile) == MSR.Lvl and (curUser.sName) == HubOwner or (curUser.sName) == Scripter then
go = 99
-- OPR --
elseif iUserLevel == 1 and (curUser.iProfile) == MSR.Lvl or (curUser.iProfile) == MOD.Lvl then
go = 1
-- VIP --
elseif (curUser.iProfile) == MSR.Lvl or (curUser.iProfile) == MOD.Lvl or (curUser.iProfile) == OPR.Lvl and iUserLevel == 2 then
go = 2
-- REG --
elseif (curUser.iProfile) == MSR.Lvl or (curUser.iProfile) == MOD.Lvl or (curUser.iProfile) == OPR.Lvl and iUserLevel == 3 then
go = 3
-- MOD --
elseif iUserLevel == 4 and (curUser.iProfile) == MSR.Lvl then
go = 4
elseif iUserLevel == 5 and (curUser.iProfile) == MSR.Lvl and (curUser.sName) == HubOwner or (curUser.sName) == Scripter then
go = 5
end
end
if usr == 1 and go == 99 then
DelRegUser(arg)
lang = "Revoked "..MSR.Name.." status for:"
curUser:SendTo(BotName, " "..lang.." "..arg)
lang = "just revoked "..MSR.Name.." status from:"
lang2 = "(OP's eyes only!!!)"
SendToOps(BotName, curUser.sName.." "..lang.." "..arg.." "..lang2)
if user ~= nil then
lang = "You have just lost all your privileges!!!"
user:SendPM(BotName, " "..lang)
end
elseif usr == 1 and go == 1 then
DelRegUser(arg)
lang = "Revoked "..OPR.Name.." status for:"
curUser:SendTo(BotName, " "..lang.." "..arg)
lang = "just revoked "..OPR.Name.." status from:"
lang2 = "(OP's eyes only!!!)"
SendToOps(BotName, curUser.sName.." "..lang.." "..arg.." "..lang2)
if user ~= nil then
lang = "You have just lost all your privileges!!!"
user:SendPM(BotName, " "..lang)
end
elseif usr == 1 and go == 2 then
DelRegUser(arg)
lang = "Revoked "..VIP.Name.." status for:"
curUser:SendTo(BotName, " "..lang.." "..arg)
lang = "just revoked "..VIP.Name.." status from:"
lang2 = "(OP's eyes only!!!)"
SendToOps(BotName, curUser.sName.." "..lang.." "..arg.." "..lang2)
if user ~= nil then
lang = "You have just lost all your privileges!!!"
user:SendPM(BotName, " "..lang)
end
elseif usr == 1 and go == 3 then
DelRegUser(arg)
lang = "Revoked "..REG.Name.." status for:"
curUser:SendTo(BotName, " "..lang.." "..arg)
lang = "just revoked "..REG.Name.." status from:"
lang2 = "(OP's eyes only!!!)"
SendToOps(BotName, curUser.sName.." "..lang.." "..arg.." "..lang2)
if user ~= nil then
lang = "You have just lost all your privileges!!!"
user:SendPM(BotName, " "..lang)
end
elseif usr == 1 and go == 4 then
DelRegUser(arg)
lang = "Revoked "..MOD.Name.." status for:"
curUser:SendTo(BotName, " "..lang.." "..arg)
lang = "just revoked "..MOD.Name.." status from:"
lang2 = "(OP's eyes only!!!)"
SendToOps(BotName, curUser.sName.." "..lang.." "..arg.." "..lang2)
if user ~= nil then
lang = "You have just lost all your privileges!!!"
user:SendPM(BotName, " "..lang)
end
elseif usr == 1 and go == 5 then
DelRegUser(arg)
lang = "Revoked "..BT.Name.." status for:"
curUser:SendTo(BotName, " "..lang.." "..arg)
lang = "just revoked "..BT.Name.." status from:"
lang2 = "(OP's eyes only!!!)"
SendToOps(BotName, curUser.sName.." "..lang.." "..arg.." "..lang2)
if user ~= nil then
lang = "You have just lost all your privileges!!!"
user:SendPM(BotName, " "..lang)
end
elseif usr == 0 then
lang = "You can't delete a user that does not exist. The nick you entered is NOT registered."
SendPmToNick(curUser.sName, BotName, lang)
elseif usr == 1 and go == 0 then
lang = "You can NOT delete a user who has the same rank as you or higher."
curUser:SendTo(BotName, " "..lang)
end
end
/NL
QuoteOriginally posted by b_w_johan
ok and is there not an option to ad an aditional password before you could use this command??
greetings,
Johan (who will be scripting on thisa thing many years from now =-)) )
well i vote securety above all, the hub owner can look it up on the console if needed.
if i get a question like that from a user telling me he forgot/lost his password i check his ip, and if they match i delete the account.
simple and safe.
for things 2 add 2 your script, just check the options other scripts have.
i do the same (well mostly it's odin who comes up with the new idea's), just i only use the idea not the code. lol
plop