PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: Smulf on 11 January, 2004, 20:09:21

Title: Can't kick OPs
Post by: Smulf on 11 January, 2004, 20:09:21
Can u get a script that makes a Master capable to  kick an OP and not the other way around. And if so, I would like to ad a profile "Owner", the Owner should kick the Master, and not the other way around...
Title:
Post by: AlwaysConnected on 11 January, 2004, 20:11:45
use Robocop :) its all in there  :D
Title:
Post by: raz on 11 January, 2004, 20:31:22
Ac i think he wants a script not a bot.lol  :D
Title:
Post by: Smulf on 11 January, 2004, 20:49:01
I'm aware that U like Robo bot alot, but i realy don't need it...:)
Title:
Post by: NightLitch on 11 January, 2004, 21:06:32
here you go:

--// Opwar protection ----------------------------------------------------
-- by: gg3k
-- file: OpKicks.lua
-- credits: originally based on a function by chiller.

--// Configuration

BotName = "Hub-Security"
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 = {
["Master"] = 0,  
["Operator"] = 2,
["VIP"] = 3,
}

-- 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

But if you look in the script section you will find a bunch of these scripts too...
Title:
Post by: plop on 12 January, 2004, 00:39:37
QuoteOriginally posted by Smulf
I'm aware that U like Robo bot alot, but i realy don't need it...:)
he says that because he hasn't tryed a.i. bot yet. lol

plop
Title:
Post by: Smulf on 12 January, 2004, 18:17:17
NightLitch thanks alot, U realy helped me there!
Title:
Post by: pHaTTy on 11 March, 2004, 23:36:02
QuoteOriginally posted by plop
QuoteOriginally posted by Smulf
I'm aware that U like Robo bot alot, but i realy don't need it...:)
he says that because he hasn't tryed a.i. bot yet. lol

plop

haha advertising plop :p, yep not tried new gekko neither :p
Title:
Post by: plop on 12 March, 2004, 00:46:03
QuoteOriginally posted by (uk-kingdom)pH?tt?
QuoteOriginally posted by plop
QuoteOriginally posted by Smulf
I'm aware that U like Robo bot alot, but i realy don't need it...:)
he says that because he hasn't tryed a.i. bot yet. lol

plop

haha advertising plop :p, yep not tried new gekko neither :p
not my opinion, but from the hub owners who run it. lol
and your right, haven't tryed the new gekko yet.

plop