Its me again :P
Just wondering if anyone had a script that dont allow master users to be kicked.
Thanks Adam
QuoteOriginally posted by AdamLC
Its me again :P
Just wondering if anyone had a script that dont allow master users to be kicked.
Thanks Adam
Dont you thrust your Operators ?
Many script has the options build in, so i dont know any stand alone script
My ops are very good. But they can sometimes get bored :P .
If anyone has a standalone script i would be greatful
Here you are,
-choose your bot name
-set the user levels that the users can have
bye,
[NL]MrBuitenhuizen
--------------------------------------------------------------------------------
--// Opwar protection ----------------------------------------------------
-- by: gg3k
-- file: OpKicks.lua
-- credits: originally based on a function by chiller.
--// Configuration
BotName = "[NL]Lymfocyt"
sLogFile = "opkicks.log"
-- Ops may only kick users that belong to a kicklevel below their own.
-- An op at level Master may kick ops of level Operator and below.
-- 0 is the highest level.
AllowLevels = {
["SU+"] = 0,
["SU"] = 1,
["Operator"] = 2,
["PRAO"] = 3,
["VIP"] = 4,
}
-- Configuration end.. -- Do NOT modify below here.
OpIPs = { }
Protected = { }
--// This function is fired at the serving start
function Main()
setlocale("swe")
end
--// This function is fired when a new data arrives
function DataArrival(curUser, sData)
sData=strsub(sData,1,strlen(sData)-1)
if strsub(sData,1,6) == "$Kick " then
_,_,whoTo = strfind(sData,"$Kick%s+(.*)")
name=GetItemByName(whoTo)
if AllowLevels[GetProfileName(curUser.iProfile)] >= AllowLevels[GetProfileName(name.iProfile)] then
curUser:SendData("<"..BotName.."> "..name.sName.." is of higher or equal level. Do NOT kick other ops!!")
writelog("OpKick: "..curUser.sName.." Target: "..name.sName)
return 1
end
elseif strsub(sData,1,1) == "<" then
_,_,cmd = strfind(sData, "%b<>%s+(%S+)")
if strlower(cmd) == "!ban" then
_,_,whoTo = strfind(sData,"%b<>%s+%S+%s+(%S+)")
name=GetItemByName(whoTo)
if AllowLevels[GetProfileName(curUser.iProfile)] >= AllowLevels[GetProfileName(name.iProfile)] then
curUser:SendData("<"..BotName.."> "..name.sName.." is of higher or equal level. Do NOT ban other ops!!")
writelog("OpBan: "..curUser.sName.." Target: "..name.sName)
return 1
end
elseif strlower(cmd) == "!drop" then
_,_,whoTo = strfind(sData,"%b<>%s+%S+%s+(%S+)")
name=GetItemByName(whoTo)
if AllowLevels[GetProfileName(curUser.iProfile)] >= AllowLevels[GetProfileName(name.iProfile)] then
curUser:SendData("<"..BotName.."> "..name.sName.." is of higher or equal level. Do NOT kick other ops!!")
writelog("OpKick: "..curUser.sName.." Target: "..name.sName)
return 1
end
elseif strlower(cmd) == "!nickban" then
_,_,whoTo = strfind(sData,"%b<>%s+%S+%s+(%S+)")
name=GetItemByName(whoTo)
if AllowLevels[GetProfileName(curUser.iProfile)] >= AllowLevels[GetProfileName(name.iProfile)] then
curUser:SendData("<"..BotName.."> "..name.sName.." is of higher or equal level. Do NOT ban other ops!!")
writelog("OpBan: "..curUser.sName.." Target: "..name.sName)
return 1
end
elseif strlower(cmd) == "!banip" then
_,_,whoTo = strfind(sData,"%b<>%s+%S+%s+(%S+)")
name=GetItemByName(OpIPs[whoTo])
if AllowLevels[GetProfileName(curUser.iProfile)] >= AllowLevels[GetProfileName(name.iProfile)] then
curUser:SendData("<"..BotName.."> "..name.sName.." is of higher or equal level. Do NOT ban other ops!!")
writelog("OpBanIP: "..curUser.sName.." Target: "..name.sName)
return 1
end
end
end
end
--// This function is fired when an operator enters the hub
function OpConnected(curUser)
OpIPs[curUser.sIP] = curUser.sName
end
--// This function is fired when an operator disconnects
function OpDisconnected(curUser)
OpIPs[curUser.sIP] = nil
end
--// Help functions ----------------------------------------------------
function writelog(message)
appendto(sLogFile)
write(date().."-> "..message.."\n")
writeto()
end
--------------------------------------------------------------------------------
or you can use
if victim.bOperator then
-- More of your codes
-- Request from AdamLC
-- Script Author Kepp
-- Commands:
-- +/? ban
-- +/? bannick
-- +/? kick
-- +/? tban -- Temp Ban
-- +/? timeban
--
-- Enjoy
BotName = "Your_Bot_Name_Here"
function DataArrival(user, data)
if strsub(data,1,1) == "<" or strsub(data,1,4) == "$To:" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if user.iProfile == 1 or user.iProfile == 0 then
if (cmd=="+ban") or (cmd=="?ban") then
s,e,cmd,Name,reason = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s*(.*)")
victim = GetItemByName(Name)
rsn = reason
if victim ~= nil then
if victim.bOperator then
user:SendData("You can't Ban an OP nor SU")
victim:SendData("*** User "..user.sName.." has tried to ban you!!!") return 1
else
SendToAll(BotName, user.sName.." banned "..victim.sName..", Reason: "..rsn)
victim:SendPM(BotName, "You are banned by: "..user.sName..", Reason: "..rsn)
victim:Ban() return 1 end
else
user:SendData("*** User is not in the list.") return 1
end
elseif (cmd=="+bannick") or (cmd=="?bannick") then
s,e,cmd,Name,reason = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s*(.*)")
victim = GetItemByName(Name)
rsn = reason
if victim ~= nil then
if victim.bOperator then
user:SendData("You can't ban an OP nor SU")
user:SendData("*** "..user.sName.." Tried to ban you") return 1
else
SendToAll(BotName, user.sName.." banned "..victim.sName..", Reason: "..rsn) -- 60
victim:SendPM(BotName, "You are banned by: "..user.sName..", Reason: "..rsn)
victim:NickBan() return 1 end
else
user:SendData("*** User is not in the list.") return 1 end
elseif (cmd=="+kick") or (cmd=="?kick") then
s,e,cmd,Name,reason = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s*(.*)")
victim = GetItemByName(Name)
rsn = reason
if victim ~= nil then
if victim.bOperator then
user:SendData("You can't kick an OP nor SU")
victim:SendData("*** "..user.sName.." Tried to kick you") return 1
else
SendToAll(BotName, user.sName.." kicked "..victim.sName..", Reason: "..rsn)
victim:SendPM(BotName, "You got kicked by: "..user.sName..", Reason: "..rsn)
victim:Disconnect() return 1 end
else
user:SendData("*** User is not in the list.") return 1 end
elseif (cmd=="+tban") or (cmd=="?tban") then
s,e,cmd,Name,reason = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s*(.*)")
victim = GetItemByName(Name)
rsn = reason
if victim ~= nil then
if victim.bOperator then
user:SendData("You can't kick an OP nor SU")
victim:SendData("*** "..user.sName.." Tried to kick you") return 1
else
SendToAll(BotName, user.sName.." Banned "..victim.sName..", Reason: "..rsn)
victim:SendPM(BotName, "You have been Banned by: "..user.sName..", Reason: "..rsn)
victim:TempBan() return 1 end
else
user:SendData("*** User is not in the list.") return 1 end
elseif (cmd=="+timeban") or (cmd=="?timeban") then
s,e,cmd,Name,reason,time = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s*(.+)%s+(.*).*")
victim = GetItemByName(Name)
rsn = reason
timer = time
if victim ~= nil then
if victim.bOperator then
user:SendData("You can't kick an OP nor SU")
victim:SendData("*** "..user.sName.." Tried to kick you") return 1
else
SendToAll(BotName, user.sName.." Banned "..victim.sName..", Reason: "..rsn.." For: "..timer.." Minutes")
victim:SendPM(BotName, "You have been Banned by: "..user.sName..", Reason: "..rsn.." For: "..timer.." Minutes")
victim:TimeBan(timer) return 1 end
else
user:SendData("*** User is not in the list.") return 1 end
I have not tested it, but it should work!
;)
Thanks Guys :P