old script cant find with search
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

old script cant find with search

Started by dvxjunkie, 12 March, 2004, 06:03:38

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dvxjunkie

I looking for a stand alone script that will not allow ops of any profile to to kick any op of any profile. no ops kicking ops period. I thought there was a script but I cant seem to find it and the newer ones all have Master allowed to kick ops.  

TiMeTrAVelleR

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

SMF spam blocked by CleanTalk