report to vip's
 

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

report to vip's

Started by jiten, 18 August, 2004, 19:48:22

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jiten

how can i send the advertising reports to VIP's in this antipub? it only sends it to operators.

here's the code:

-- from NighLitch's NXS-3

BotName = "robot"

HubAddress = "hub.no-ip.com"

-- Set On/Off if user should be kicked for advertising / 1:on/0:off
ADKICK = 0

OKHUBS = {
}

ADVER = {
["serveftp"]=1 }

SITES = { "www.","http://","ftp://","irc.","cs." }

tabAdvert = {}
PMCount = {}
MainCount = {}
awayArray = {}
RegTable = {}
UserInfo = {}
TabTimers = {n=0}
KickTable = {}
BanTable = {}
WarnTable = {}
Online = {}
Counter = {}
TopKickers = {}

CmdErrorMsg = "*** Syntax error in command"
CmdErrorPar = " No parameter given."

function Main()

--REG BOTS--------------------------------------------------------------------------------------------------
   frmHub:RegBot(BotName)

function SMPM(curUser)
   if (MPM==1)  then
      curUser.SD = function(this,from,text)
            this:SendPM(from,text)
         end
   else
      curUser.SD = function(this,from,text)
            this:SendData(from,text)
         end
   end
   return curUser
end

function DataArrival(curUser, data)
   SMPM(curUser)
      if ( strsub(data, 1, 1) == "<" ) then
      local _, _, msg = strfind(data, "^%b<>%s+(.*)|")
      if not curUser.bOperator then
         if SiteCheck(msg)==1 then
            return 0
         else
            if Verify(curUser.sName, msg) then
               local Lines = Verify(curUser.sName, msg)
               tabAdvert = nil
               tabAdvert = {}
               local s,e, adver = strfind(Lines, "[^#]#(%S+)$")
               if (FindAdver(adver) == "K") then
               return 0
               else
                  SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in main: "..msg)
                  if ADKICK==1 then
                     SendPmToOps (BotName,"User has been kicked for Advertising.")
                     curUser:SendPM(BotName,"You were kicked for Advertising.")
                     curUser:TempBan()
                  else
                     curUser:SendPM(BotName,"Advertising Censored. Sorry.")
                  end
                  return 1
               end
            end
         end
         spam = 0
         if( strfind( strlower(data), "no",1,1) ) and ( strfind( strlower(data), "ip",1,1) ) then
            if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then
         spam=spam+1; end; end;
         if( strfind( strlower(data), "my",1,1) ) and ( strfind( strlower(data), "ftp",1,1) ) then
            if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then
         spam=spam+1; end; end;
         if( strfind( strlower(data), "dns",1,1) ) and ( strfind( strlower(data), "2",1,1) ) and ( strfind( strlower(data), "go",1,1) ) then
         spam=spam+1; end
         if( strfind( strlower(data), "dy",1,1) ) and ( strfind( strlower(data), "nu",1,1) ) then
            if( strfind( strlower(data), ".net",1,1) ) or ( strfind( strlower(data), ".com",1,1) ) then
         spam=spam+1;end; end
         if( strfind( strlower(data), "d n s a",1,1) ) or ( strfind( strlower(data), "d n s .",1,1) ) or ( strfind( strlower(data), "d n s 2",1,1) ) or ( strfind( strlower(data), "o d s .",1,1) ) or ( strfind( strlower(data), "d y n",1,1) ) then
         spam=spam+1;end
         if spam>0 then
            s,e,msg = strfind(data, "%b<> (.*)")
            SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in main: "..msg)
            if ADKICK==1 then
               SendPmToOps (BotName,"User has been kicked for Advertising.")
               curUser:SendPM(BotName,"You were kicked for Advertising!")
               curUser:TempBan()
            else
               curUser:SendPM(BotName,"Advertising Censored. Sorry.")
            end
            return 1
         end
      end
      return MainCom(curUser,data)
   elseif strsub(data, 1, 4) == "$To: " then
      ToKickMsg(curUser, data)
      local s,e,to,from,text = strfind(data,    "%$To:%s(%S+)%sFrom:%s(%S+)%s$(.*)$")
      if to == BotName then
         return BotCom(curUser, data)
      else
         to = GetItemByName(to)
         if not curUser.bOperator then
            local _, _, msg = strfind(text, "^%b<>%s+(.*)|")
            if SiteCheck(msg)==1 then
               return 0
            else
               if Verify(curUser.sName, msg) then
                  local Lines = Verify(curUser.sName, msg)
                  tabAdvert = nil
                  tabAdvert = {}
                  local s,e, adver = strfind(Lines, "[^#]#(%S+)$")
                  if (FindAdver(adver) == "K") then
                  return 0
                  else
                     SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in PVT: "..msg)
                     if ADKICK==1 then
                        SendPmToOps (BotName,"User has been kicked for advertising.")
                        curUser:SendPM(BotName,"You were kicked for Advertising!")
                        curUser:TempBan()
                     else
                        curUser:SendPM(BotName,"Advertising Censored. Sorry.")
                     end
                     return 1
                  end
               end
            end
         end
         spam = 0
         if( strfind( strlower(data), "no",1,1) ) and ( strfind( strlower(data), "ip",1,1) ) then
            if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then
         spam=spam+1; end; end;
         if( strfind( strlower(data), "my",1,1) ) and ( strfind( strlower(data), "ftp",1,1) ) then
            if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then
         spam=spam+1; end; end;
         if( strfind( strlower(data), "dns",1,1) ) and ( strfind( strlower(data), "2",1,1) ) and ( strfind( strlower(data), "go",1,1) ) then
         spam=spam+1; end
         if( strfind( strlower(data), "dy",1,1) ) and ( strfind( strlower(data), "nu",1,1) ) then
            if( strfind( strlower(data), ".net",1,1) ) or ( strfind( strlower(data), ".com",1,1) ) then
         spam=spam+1;end; end
         if( strfind( strlower(data), "d n s a",1,1) ) or ( strfind( strlower(data), "d n s .",1,1) ) or ( strfind( strlower(data), "d n s 2",1,1) ) or ( strfind( strlower(data), "o d s .",1,1) ) or ( strfind( strlower(data), "d y n",1,1) ) then
         spam=spam+1;end
         if spam>0 then
            s,e,msg = strfind(data, "%b<> (.*)")
            SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in PVT: "..msg)
            if ADKICK==1 then
               SendPmToOps (BotName,"User has been  kicked for advertising.")
               curUser:SendPM(BotName,"You were kicked for Advertising!")
               curUser:TempBan()
            else
               curUser:SendPM(BotName,"Advertising Censored. Sorry.")
            end
            return 1
         end
      end

   end
end


function MainCom(curUser,data)
   data=strsub(data,1,strlen(data)-1)
   local _,_,cmd = strfind(data, "%b<>%s+(%S+)")
   if not cmd then cmd = "0" end
   if (strsub(cmd, 1, 1) ~= Prefix1 and strsub(cmd, 1, 1) ~= Prefix2) then
      return 0
   else
      cmd = strlower(cmd)
      if strlen(cmd) > 1 then
         cmd=strsub(cmd,2,strlen(cmd))
         local SendCom = (Com(curUser,data,cmd))
         if not SendCom then
            return 1
         else
            return SendCom
         end
      end
   end
end

function BotCom(curUser, data)
   data=strsub(data,1,strlen(data)-1)
   _,_,cmd = strfind(data,"$%b<>%s+(%S+)")
   if not cmd then cmd = "0" end
   if (strsub(cmd, 1, 1) ~= Prefix1 and strsub(cmd, 1, 1) ~= Prefix2) then
      return 0
   else
      cmd = strlower(cmd)
      cmd=strsub(cmd,2,strlen(cmd))
      local SendCom = (Com(curUser,data,cmd))
      if not SendCom then
         return 1
      else
         return SendCom
      end
   end
end

function SiteCheck(msg)
   for value,index in SITES do
      if strfind(msg,index) then
         return 1
      end
   end
end

function FindAdver(adver)
   for v2,i2 in OKHUBS do
      if strfind(adver,v2) then
         return "K"
      end
   end
end


function Verify(userdata, msg)
   if not msg then return end
   tmp =""
   gsub(strlower(msg), "([a-?0-9.:%-])", function(x) tmp = tmp..x end)
   if not tabAdvert[userdata] then
      tabAdvert[userdata] = { iClock = clock(), l1 = "", l2 = "", l3 = "", l4= "", l5= "",l6= "",l7= "",l8= "",l9 = tmp}
   else
      tabAdvert[userdata].iClock = clock()
      tabAdvert[userdata].l1 = tabAdvert[userdata].l2
      tabAdvert[userdata].l2 = tabAdvert[userdata].l3
      tabAdvert[userdata].l3 = tabAdvert[userdata].l4
      tabAdvert[userdata].l4 = tabAdvert[userdata].l5
      tabAdvert[userdata].l5 = tabAdvert[userdata].l6
      tabAdvert[userdata].l6 = tabAdvert[userdata].l7
      tabAdvert[userdata].l7 = tabAdvert[userdata].l8
      tabAdvert[userdata].l8 = tabAdvert[userdata].l9
      tabAdvert[userdata].l9 = tmp
   end
   local Lines = tabAdvert[userdata].l1.."#"..tabAdvert[userdata].l2.."#"..tabAdvert[userdata].l3.."#"..tabAdvert[userdata].l4.."#"..tabAdvert[userdata].l5.."#"..tabAdvert[userdata].l6.."#"..tabAdvert[userdata].l7.."#"..tabAdvert[userdata].l8.."#"..tabAdvert[userdata].l9
   for value, key in ADVER do
      if (strfind(Lines, strlower(value), 1, 1)) then
         return Lines
      end
   end
end

function ToKickMsg(curUser, data)
   if strfind(data,"You are being kicked because:") then
      local _,_, Name,Op,Reason = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$<%S+> You are being kicked because:%s+(.*)|")
      OpCheck = GetItemByName(Op)
      if OpCheck~=nil and OpCheck.bOperator then
         vUser = GetItemByName(Name)
         if KicksRegVipOp(vUser,curUser)==0 then
            return 1
         end
         if vUser~=nil then
            SaveKickBanInfo(curUser.sName,vUser.sName,Reason,KickTable,KickFile, "KickTable")
         end
      end
   end
end

end

nErBoS

Hi,

Done...

BotName = "robot" 

HubAddress = "hub.no-ip.com" 

-- Set On/Off if user should be kicked for advertising / 1:on/0:off 
ADKICK = 0 

OKHUBS = { 
} 

ADVER = { 
["serveftp"]=1 } 

SITES = { "www.","http://","ftp://","irc.","cs." } 

tabAdvert = {} 
PMCount = {} 
MainCount = {} 
awayArray = {} 
RegTable = {} 
UserInfo = {} 
TabTimers = {n=0} 
KickTable = {} 
BanTable = {} 
WarnTable = {} 
Online = {} 
Counter = {} 
TopKickers = {} 

CmdErrorMsg = "*** Syntax error in command" 
CmdErrorPar = " No parameter given." 

function Main() 

--REG BOTS-------------------------------------------------------------------------------------------------- 
frmHub:RegBot(BotName) 

function SMPM(curUser) 
if (MPM==1) then 
curUser.SD = function(this,from,text) 
this:SendPM(from,text) 
end 
else 
curUser.SD = function(this,from,text) 
this:SendData(from,text) 
end 
end 
return curUser 
end 

function DataArrival(curUser, data) 
SMPM(curUser) 
if ( strsub(data, 1, 1) == "<" ) then 
local _, _, msg = strfind(data, "^%b<>%s+(.*)|") 
if not curUser.bOperator then 
if SiteCheck(msg)==1 then 
return 0 
else 
if Verify(curUser.sName, msg) then 
local Lines = Verify(curUser.sName, msg) 
tabAdvert = nil 
tabAdvert = {} 
local s,e, adver = strfind(Lines, "[^#]#(%S+)$") 
if (FindAdver(adver) == "K") then 
return 0 
else 
SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in main: "..msg)
SendToVips("Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in main: "..msg) 
if ADKICK==1 then 
SendPmToOps (BotName,"User has been kicked for Advertising.")
SendToVips("User has been kicked for Advertising.") 
curUser:SendPM(BotName,"You were kicked for Advertising.") 
curUser:TempBan() 
else 
curUser:SendPM(BotName,"Advertising Censored. Sorry.") 
end 
return 1 
end 
end 
end 
spam = 0 
if( strfind( strlower(data), "no",1,1) ) and ( strfind( strlower(data), "ip",1,1) ) then 
if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then 
spam=spam+1; end; end; 
if( strfind( strlower(data), "my",1,1) ) and ( strfind( strlower(data), "ftp",1,1) ) then 
if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then 
spam=spam+1; end; end; 
if( strfind( strlower(data), "dns",1,1) ) and ( strfind( strlower(data), "2",1,1) ) and ( strfind( strlower(data), "go",1,1) ) then 
spam=spam+1; end 
if( strfind( strlower(data), "dy",1,1) ) and ( strfind( strlower(data), "nu",1,1) ) then 
if( strfind( strlower(data), ".net",1,1) ) or ( strfind( strlower(data), ".com",1,1) ) then 
spam=spam+1;end; end 
if( strfind( strlower(data), "d n s a",1,1) ) or ( strfind( strlower(data), "d n s .",1,1) ) or ( strfind( strlower(data), "d n s 2",1,1) ) or ( strfind( strlower(data), "o d s .",1,1) ) or ( strfind( strlower(data), "d y n",1,1) ) then 
spam=spam+1;end 
if spam>0 then 
s,e,msg = strfind(data, "%b<> (.*)") 
SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in main: "..msg)
SendToVips("Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in main: "..msg)
if ADKICK==1 then 
SendPmToOps (BotName,"User has been kicked for Advertising.")
SendToVips("User has been kicked for Advertising.")
curUser:SendPM(BotName,"You were kicked for Advertising!") 
curUser:TempBan() 
else 
curUser:SendPM(BotName,"Advertising Censored. Sorry.") 
end 
return 1 
end 
end 
return MainCom(curUser,data) 
elseif strsub(data, 1, 4) == "$To: " then 
ToKickMsg(curUser, data) 
local s,e,to,from,text = strfind(data, "%$To:%s(%S+)%sFrom:%s(%S+)%s$(.*)$") 
if to == BotName then 
return BotCom(curUser, data) 
else 
to = GetItemByName(to) 
if not curUser.bOperator then 
local _, _, msg = strfind(text, "^%b<>%s+(.*)|") 
if SiteCheck(msg)==1 then 
return 0 
else 
if Verify(curUser.sName, msg) then 
local Lines = Verify(curUser.sName, msg) 
tabAdvert = nil 
tabAdvert = {} 
local s,e, adver = strfind(Lines, "[^#]#(%S+)$") 
if (FindAdver(adver) == "K") then 
return 0 
else 
SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in PVT: "..msg)
SendToVips("Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in PVT: "..msg) 
if ADKICK==1 then 
SendPmToOps (BotName,"User has been kicked for advertising.") 
SendToVips("User has been kicked for advertising.") 
curUser:SendPM(BotName,"You were kicked for Advertising!") 
curUser:TempBan() 
else 
curUser:SendPM(BotName,"Advertising Censored. Sorry.") 
end 
return 1 
end 
end 
end 
end 
spam = 0 
if( strfind( strlower(data), "no",1,1) ) and ( strfind( strlower(data), "ip",1,1) ) then 
if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then 
spam=spam+1; end; end; 
if( strfind( strlower(data), "my",1,1) ) and ( strfind( strlower(data), "ftp",1,1) ) then 
if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then 
spam=spam+1; end; end; 
if( strfind( strlower(data), "dns",1,1) ) and ( strfind( strlower(data), "2",1,1) ) and ( strfind( strlower(data), "go",1,1) ) then 
spam=spam+1; end 
if( strfind( strlower(data), "dy",1,1) ) and ( strfind( strlower(data), "nu",1,1) ) then 
if( strfind( strlower(data), ".net",1,1) ) or ( strfind( strlower(data), ".com",1,1) ) then 
spam=spam+1;end; end 
if( strfind( strlower(data), "d n s a",1,1) ) or ( strfind( strlower(data), "d n s .",1,1) ) or ( strfind( strlower(data), "d n s 2",1,1) ) or ( strfind( strlower(data), "o d s .",1,1) ) or ( strfind( strlower(data), "d y n",1,1) ) then 
spam=spam+1;end 
if spam>0 then 
s,e,msg = strfind(data, "%b<> (.*)") 
SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in PVT: "..msg)
SendToVips("Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in PVT: "..msg) 
if ADKICK==1 then 
SendPmToOps (BotName,"User has been kicked for advertising.")
SendToVips("User has been kicked for advertising.")
curUser:SendPM(BotName,"You were kicked for Advertising!") 
curUser:TempBan() 
else 
curUser:SendPM(BotName,"Advertising Censored. Sorry.") 
end 
return 1 
end 
end 

end 
end 


function MainCom(curUser,data) 
data=strsub(data,1,strlen(data)-1) 
local _,_,cmd = strfind(data, "%b<>%s+(%S+)") 
if not cmd then cmd = "0" end 
if (strsub(cmd, 1, 1) ~= Prefix1 and strsub(cmd, 1, 1) ~= Prefix2) then 
return 0 
else 
cmd = strlower(cmd) 
if strlen(cmd) > 1 then 
cmd=strsub(cmd,2,strlen(cmd)) 
local SendCom = (Com(curUser,data,cmd)) 
if not SendCom then 
return 1 
else 
return SendCom 
end 
end 
end 
end 

function BotCom(curUser, data) 
data=strsub(data,1,strlen(data)-1) 
_,_,cmd = strfind(data,"$%b<>%s+(%S+)") 
if not cmd then cmd = "0" end 
if (strsub(cmd, 1, 1) ~= Prefix1 and strsub(cmd, 1, 1) ~= Prefix2) then 
return 0 
else 
cmd = strlower(cmd) 
cmd=strsub(cmd,2,strlen(cmd)) 
local SendCom = (Com(curUser,data,cmd)) 
if not SendCom then 
return 1 
else 
return SendCom 
end 
end 
end 

function SiteCheck(msg) 
for value,index in SITES do 
if strfind(msg,index) then 
return 1 
end 
end 
end 

function FindAdver(adver) 
for v2,i2 in OKHUBS do 
if strfind(adver,v2) then 
return "K" 
end 
end 
end 


function Verify(userdata, msg) 
if not msg then return end 
tmp ="" 
gsub(strlower(msg), "([a-?0-9.:%-])", function(x) tmp = tmp..x end) 
if not tabAdvert[userdata] then 
tabAdvert[userdata] = { iClock = clock(), l1 = "", l2 = "", l3 = "", l4= "", l5= "",l6= "",l7= "",l8= "",l9 = tmp} 
else 
tabAdvert[userdata].iClock = clock() 
tabAdvert[userdata].l1 = tabAdvert[userdata].l2 
tabAdvert[userdata].l2 = tabAdvert[userdata].l3 
tabAdvert[userdata].l3 = tabAdvert[userdata].l4 
tabAdvert[userdata].l4 = tabAdvert[userdata].l5 
tabAdvert[userdata].l5 = tabAdvert[userdata].l6 
tabAdvert[userdata].l6 = tabAdvert[userdata].l7 
tabAdvert[userdata].l7 = tabAdvert[userdata].l8 
tabAdvert[userdata].l8 = tabAdvert[userdata].l9 
tabAdvert[userdata].l9 = tmp 
end 
local Lines = tabAdvert[userdata].l1.."#"..tabAdvert[userdata].l2.."#"..tabAdvert[userdata].l3.."#"..tabAdvert[userdata].l4.."#"..tabAdvert[userdata].l5.."#"..tabAdvert[userdata].l6.."#"..tabAdvert[userdata].l7.."#"..tabAdvert[userdata].l8.."#"..tabAdvert[userdata].l9 
for value, key in ADVER do 
if (strfind(Lines, strlower(value), 1, 1)) then 
return Lines 
end 
end 
end 

function ToKickMsg(curUser, data) 
if strfind(data,"You are being kicked because:") then 
local _,_, Name,Op,Reason = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$<%S+> You are being kicked because:%s+(.*)|") 
OpCheck = GetItemByName(Op) 
if OpCheck~=nil and OpCheck.bOperator then 
vUser = GetItemByName(Name) 
if KicksRegVipOp(vUser,curUser)==0 then 
return 1 
end 
if vUser~=nil then 
SaveKickBanInfo(curUser.sName,vUser.sName,Reason,KickTable,KickFile, "KickTable") 
end 
end 
end 
end 

end 

function SendToVips(msg)
	local usr,aux
	for aux, usr in GetUsersByProfile("VIP") do
		if (GetItemByName(usr) ~= nil) then
			GetItemByName(usr):SendPM(BotName, msg)
		end
	end
end

Best regards, nErBoS
--## nErBoS Spot ##--

jiten

thanks Nerbos! it is working well.
well, i have a new request too:

i wanted to combine this antipub with the Seiya's KVIP (the one where you can choose the VIP's that are able to kick). so, the pub report would be sent only to those VIP's that are in the file /logs/svip.txt and not to all of them.

the svip.txt looks like this:

supervip = {["Etler"]=1,}

nErBoS

#3
Hi,

Ok, try out this then...

BotName = "robot" 

HubAddress = "hub.no-ip.com" 

-- Set On/Off if user should be kicked for advertising / 1:on/0:off 
ADKICK = 0 

OKHUBS = { 
} 

ADVER = { 
["serveftp"]=1 } 

SITES = { "www.","http://","ftp://","irc.","cs." } 

tabAdvert = {} 
PMCount = {} 
MainCount = {} 
awayArray = {} 
RegTable = {} 
UserInfo = {} 
TabTimers = {n=0} 
KickTable = {} 
BanTable = {} 
WarnTable = {} 
Online = {} 
Counter = {} 
TopKickers = {}
supervip = {}
fSuperVip = "logs/svip.txt"	-- Path of file that contains SuperVips

CmdErrorMsg = "*** Syntax error in command" 
CmdErrorPar = " No parameter given." 

function Main() 

--REG BOTS-------------------------------------------------------------------------------------------------- 
frmHub:RegBot(BotName) 

function SMPM(curUser) 
LoadFromFile(fSuperVip)
if (MPM==1) then 
curUser.SD = function(this,from,text) 
this:SendPM(from,text) 
end 
else 
curUser.SD = function(this,from,text) 
this:SendData(from,text) 
end 
end 
return curUser 
end 

function DataArrival(curUser, data) 
SMPM(curUser) 
if ( strsub(data, 1, 1) == "<" ) then 
local _, _, msg = strfind(data, "^%b<>%s+(.*)|") 
if not curUser.bOperator then 
if SiteCheck(msg)==1 then 
return 0 
else 
if Verify(curUser.sName, msg) then 
local Lines = Verify(curUser.sName, msg) 
tabAdvert = nil 
tabAdvert = {} 
local s,e, adver = strfind(Lines, "[^#]#(%S+)$") 
if (FindAdver(adver) == "K") then 
return 0 
else 
SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in main: "..msg)
SendToVips("Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in main: "..msg) 
if ADKICK==1 then 
SendPmToOps (BotName,"User has been kicked for Advertising.")
SendToVips("User has been kicked for Advertising.") 
curUser:SendPM(BotName,"You were kicked for Advertising.") 
curUser:TempBan() 
else 
curUser:SendPM(BotName,"Advertising Censored. Sorry.") 
end 
return 1 
end 
end 
end 
spam = 0 
if( strfind( strlower(data), "no",1,1) ) and ( strfind( strlower(data), "ip",1,1) ) then 
if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then 
spam=spam+1; end; end; 
if( strfind( strlower(data), "my",1,1) ) and ( strfind( strlower(data), "ftp",1,1) ) then 
if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then 
spam=spam+1; end; end; 
if( strfind( strlower(data), "dns",1,1) ) and ( strfind( strlower(data), "2",1,1) ) and ( strfind( strlower(data), "go",1,1) ) then 
spam=spam+1; end 
if( strfind( strlower(data), "dy",1,1) ) and ( strfind( strlower(data), "nu",1,1) ) then 
if( strfind( strlower(data), ".net",1,1) ) or ( strfind( strlower(data), ".com",1,1) ) then 
spam=spam+1;end; end 
if( strfind( strlower(data), "d n s a",1,1) ) or ( strfind( strlower(data), "d n s .",1,1) ) or ( strfind( strlower(data), "d n s 2",1,1) ) or ( strfind( strlower(data), "o d s .",1,1) ) or ( strfind( strlower(data), "d y n",1,1) ) then 
spam=spam+1;end 
if spam>0 then 
s,e,msg = strfind(data, "%b<> (.*)") 
SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in main: "..msg)
SendToVips("Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in main: "..msg)
if ADKICK==1 then 
SendPmToOps (BotName,"User has been kicked for Advertising.")
SendToVips("User has been kicked for Advertising.")
curUser:SendPM(BotName,"You were kicked for Advertising!") 
curUser:TempBan() 
else 
curUser:SendPM(BotName,"Advertising Censored. Sorry.") 
end 
return 1 
end 
end 
return MainCom(curUser,data) 
elseif strsub(data, 1, 4) == "$To: " then 
ToKickMsg(curUser, data) 
local s,e,to,from,text = strfind(data, "%$To:%s(%S+)%sFrom:%s(%S+)%s$(.*)$") 
if to == BotName then 
return BotCom(curUser, data) 
else 
to = GetItemByName(to) 
if not curUser.bOperator then 
local _, _, msg = strfind(text, "^%b<>%s+(.*)|") 
if SiteCheck(msg)==1 then 
return 0 
else 
if Verify(curUser.sName, msg) then 
local Lines = Verify(curUser.sName, msg) 
tabAdvert = nil 
tabAdvert = {} 
local s,e, adver = strfind(Lines, "[^#]#(%S+)$") 
if (FindAdver(adver) == "K") then 
return 0 
else 
SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in PVT: "..msg)
SendToVips("Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in PVT: "..msg) 
if ADKICK==1 then 
SendPmToOps (BotName,"User has been kicked for advertising.") 
SendToVips("User has been kicked for advertising.") 
curUser:SendPM(BotName,"You were kicked for Advertising!") 
curUser:TempBan() 
else 
curUser:SendPM(BotName,"Advertising Censored. Sorry.") 
end 
return 1 
end 
end 
end 
end 
spam = 0 
if( strfind( strlower(data), "no",1,1) ) and ( strfind( strlower(data), "ip",1,1) ) then 
if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then 
spam=spam+1; end; end; 
if( strfind( strlower(data), "my",1,1) ) and ( strfind( strlower(data), "ftp",1,1) ) then 
if ( strfind( strlower(data), "com",1,1) ) or ( strfind( strlower(data), "org",1,1) ) or ( strfind( strlower(data), "info",1,1) ) then 
spam=spam+1; end; end; 
if( strfind( strlower(data), "dns",1,1) ) and ( strfind( strlower(data), "2",1,1) ) and ( strfind( strlower(data), "go",1,1) ) then 
spam=spam+1; end 
if( strfind( strlower(data), "dy",1,1) ) and ( strfind( strlower(data), "nu",1,1) ) then 
if( strfind( strlower(data), ".net",1,1) ) or ( strfind( strlower(data), ".com",1,1) ) then 
spam=spam+1;end; end 
if( strfind( strlower(data), "d n s a",1,1) ) or ( strfind( strlower(data), "d n s .",1,1) ) or ( strfind( strlower(data), "d n s 2",1,1) ) or ( strfind( strlower(data), "o d s .",1,1) ) or ( strfind( strlower(data), "d y n",1,1) ) then 
spam=spam+1;end 
if spam>0 then 
s,e,msg = strfind(data, "%b<> (.*)") 
SendPmToOps (BotName,"Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in PVT: "..msg)
SendToVips("Report: <"..curUser.sName.."> ("..curUser.sIP..") is advertising in PVT: "..msg) 
if ADKICK==1 then 
SendPmToOps (BotName,"User has been kicked for advertising.")
SendToVips("User has been kicked for advertising.")
curUser:SendPM(BotName,"You were kicked for Advertising!") 
curUser:TempBan() 
else 
curUser:SendPM(BotName,"Advertising Censored. Sorry.") 
end 
return 1 
end 
end 

end 
end 


function MainCom(curUser,data) 
data=strsub(data,1,strlen(data)-1) 
local _,_,cmd = strfind(data, "%b<>%s+(%S+)") 
if not cmd then cmd = "0" end 
if (strsub(cmd, 1, 1) ~= Prefix1 and strsub(cmd, 1, 1) ~= Prefix2) then 
return 0 
else 
cmd = strlower(cmd) 
if strlen(cmd) > 1 then 
cmd=strsub(cmd,2,strlen(cmd)) 
local SendCom = (Com(curUser,data,cmd)) 
if not SendCom then 
return 1 
else 
return SendCom 
end 
end 
end 
end 

function BotCom(curUser, data) 
data=strsub(data,1,strlen(data)-1) 
_,_,cmd = strfind(data,"$%b<>%s+(%S+)") 
if not cmd then cmd = "0" end 
if (strsub(cmd, 1, 1) ~= Prefix1 and strsub(cmd, 1, 1) ~= Prefix2) then 
return 0 
else 
cmd = strlower(cmd) 
cmd=strsub(cmd,2,strlen(cmd)) 
local SendCom = (Com(curUser,data,cmd)) 
if not SendCom then 
return 1 
else 
return SendCom 
end 
end 
end 

function SiteCheck(msg) 
for value,index in SITES do 
if strfind(msg,index) then 
return 1 
end 
end 
end 

function FindAdver(adver) 
for v2,i2 in OKHUBS do 
if strfind(adver,v2) then 
return "K" 
end 
end 
end 


function Verify(userdata, msg) 
if not msg then return end 
tmp ="" 
gsub(strlower(msg), "([a-?0-9.:%-])", function(x) tmp = tmp..x end) 
if not tabAdvert[userdata] then 
tabAdvert[userdata] = { iClock = clock(), l1 = "", l2 = "", l3 = "", l4= "", l5= "",l6= "",l7= "",l8= "",l9 = tmp} 
else 
tabAdvert[userdata].iClock = clock() 
tabAdvert[userdata].l1 = tabAdvert[userdata].l2 
tabAdvert[userdata].l2 = tabAdvert[userdata].l3 
tabAdvert[userdata].l3 = tabAdvert[userdata].l4 
tabAdvert[userdata].l4 = tabAdvert[userdata].l5 
tabAdvert[userdata].l5 = tabAdvert[userdata].l6 
tabAdvert[userdata].l6 = tabAdvert[userdata].l7 
tabAdvert[userdata].l7 = tabAdvert[userdata].l8 
tabAdvert[userdata].l8 = tabAdvert[userdata].l9 
tabAdvert[userdata].l9 = tmp 
end 
local Lines = tabAdvert[userdata].l1.."#"..tabAdvert[userdata].l2.."#"..tabAdvert[userdata].l3.."#"..tabAdvert[userdata].l4.."#"..tabAdvert[userdata].l5.."#"..tabAdvert[userdata].l6.."#"..tabAdvert[userdata].l7.."#"..tabAdvert[userdata].l8.."#"..tabAdvert[userdata].l9 
for value, key in ADVER do 
if (strfind(Lines, strlower(value), 1, 1)) then 
return Lines 
end 
end 
end 

function ToKickMsg(curUser, data) 
if strfind(data,"You are being kicked because:") then 
local _,_, Name,Op,Reason = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$<%S+> You are being kicked because:%s+(.*)|") 
OpCheck = GetItemByName(Op) 
if OpCheck~=nil and OpCheck.bOperator then 
vUser = GetItemByName(Name) 
if KicksRegVipOp(vUser,curUser)==0 then 
return 1 
end 
if vUser~=nil then 
SaveKickBanInfo(curUser.sName,vUser.sName,Reason,KickTable,KickFile, "KickTable") 
end 
end 
end 
end 

end

function LoadFromFile(file)
	if (readfrom(file) ~= nil) then
		readfrom(file)
		dostring(read("*all"))
		readfrom()
	end
end 

function SendToVips(msg)
	local usr,aux
	for usr, aux in supervip do
		if (GetItemByName(usr) ~= nil) then
			GetItemByName(usr):SendPM(BotName, msg)
		end
	end
end

Best regards, nErBoS
--## nErBoS Spot ##--

jiten

hi there.
the last request about reports to specific vips doesn't work. it doesn't even send it to all vips like the first one does.
can you check it again nerbos?
thanks for the help man.

nErBoS

Hi,

Little bug in the path name, i have fixed the script above.

Best regards, nErBoS
--## nErBoS Spot ##--

jiten

now it works 100%.
thanks! you're the man!

jiten

#7
Hi there.
Well, I've two requests for this script.

1. That after x kicks the user would be banned;
2. That all the VIP kicks would be logged in txt/kick.log in the Robocop 9b pattern. Example:

KickLog = {
   ["Mario"] = "10/22/2004 10:49:19 User Mario (127.0.0.1) kicked 1 time(s) by VIP Paulo - Reason: No reason given!",
}

Thanks in advance,

jiten

jiten


nErBoS

Hi,

The first request can be made, but about the second one i don't see any commad to the VIP user kick, or you want to log the kicks made by this script ???

Best regards, nErBoS
--## nErBoS Spot ##--

jiten

Hi there.
Yes, I wanted to log all the kicks made by this script in the Robocop 9b pattern. In fact, all the disconnects made by the K-VIP's to the users with lower profile.
Thanks in advance.

Regards,

jiten

NightLitch

I don't want so sound mean but, Almost every line on your script Jiten is from NXS-3, I would appriciate my name being mentioned in the -- Comment Info.

No hard feelings / NightLitch
//NL

nErBoS

Hi,

When i said to log the kicks of the script, i ment that the kick is made by the BOT not by a VIP. About the NL post i am 100% accord.

Best regards, nErBoS
--## nErBoS Spot ##--

jiten

My bad, NL. I forgot to comment. Sorry about that. It's done now.

About this script, well, the kicks are done by the BOT.

Regards,

jiten

nErBoS

Hi,

OK then, so it doesn't matter to save in the kick log with the BOTNAME as kicker ??

Best regards, nErBoS
--## nErBoS Spot ##--

jiten

#15
Well, i'm going to try to explain it again.
I wanted to log all the disconnects done by the K-Vips through this script, so that when using the !showkicklog command of Robocop 9b, I'd get them shown there. Just like an addition.

The log would have to show who was disconnected by whom (not the BOTNAME). The log file should look like this:

KickLog = {
["fluke1"] = "10/25/2004 20:29:51 User fluke1 (196.46.10.82) kicked 1 time(s) by K-VIP [_Method_K!d_] - Reason: Muda A Description",

}

Regards,

jiten

nErBoS

#16
Hi,

So we get back to the same, the script doesn't have any command, all disconnects and kicks of this script is made by the BOT, not by an user.

Best regards, nErBoS
--## nErBoS Spot ##--

jiten

#17
I made a mistake in the thread to post.
In fact, those 2 requests were for Seiya's K-VIP script --> here

That's why it didn't make sense. Sorry about that.

Regards,

jiten

nErBoS

#18
Hi,

I have been taking a look at the script and remenber that i can't work with the kicklog of RoboCop, because every time RoboCop saves the info, will overwrite the info added by the KVip, so i can only make the ban thing, ok ??

Best regards, nErBoS
--## nErBoS Spot ##--

jiten

Well, if that isn't possible, can the kicks be logged in a different file like logs/vkick.log and and accessed by a command like !vkicklog?

Thanks in advance.

Regards,

jiten

nErBoS

Hi,

I see different scripts in the topic, you want me to modifiy the plop script or seya script ??

Best regards, nErBoS
--## nErBoS Spot ##--

jiten

I would like you to modify Seiya's one.

Best regards,

jiten

nErBoS

#22
Hi,

Try out this one then...

-- K-VIP by Seiya
-- Version 1.0
-- add kick to the VIP you want
-- without creating a new profile
-- Added by request a kick log and its command !vkicklog (made by nErBoS)
-- Added by request a Ban to a x amout of Kicks (made by nErBoS)

sBot = "@Dohko"

savevipkick = "logs/svip.txt" -- you have to create a svip.txt file ine the ptokax\scripts\logs directory
fVipLog = "viplog.dat"
arrVipLog = {}
iBan = 4 -- Times of Kick equal to a ban
supervip = {}

function Main()
	LoadFromFile(fVipLog)
end

function dosavesupervip(user,data)
	writeto(savevipkick) ; 
	write("supervip = {"); 
	for a,b in supervip do
		if b then 
			write(format("[%q]=",a)..b..",");
		end 
	end 
	write("}" ); 
	writeto(); 
end

function DataArrival (user,data)
if strsub(data, 1, 1) == "<" then
	data=strsub(data,1,strlen(data)-1)
	s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
	victim = GetItemByName(Name)
	if cmd == "!vipkick" then
		if victim.iProfile == 2 then
			if supervip[victim.sName] == nil then
				supervip[victim.sName] = 1
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to"..victim.sName)
				victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just have a look at your right click for kick command")
			else 
				supervip[victim.sName] = supervip[victim.sName] + 1
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to"..victim.sName)
				victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just have a look at your right click for kick command")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a VIP yet. It can't be upgrated to K-VIP")	
		end
	return 1
	elseif cmd == "!vipunkick" then
		if victim.iProfile == 2 then
			if supervip[victim.sName] ~= 0 then
				supervip[victim.sName] = 0
				dosavesupervip()
				SendPmToOps(sBot,"The Op "..user.sName.." has just revoked "..victim.sName.." from k-VIP")
				victim:SendPM(sBot,"You've been revoked from K-VIP")
			end
		else
			user:SendData(sBot,"The user "..victim.sName.." isn't a K-VIP.")
		end
	return 1
	end
	s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" )
	victim = GetItemByName(Name)
	if cmd == "!kik" then
		if supervip[user.sName] ~= 0 then
			if victim.iProfile == -1 or victim.iProfile == 3 then
			SendToAll(sBot,"The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason)
			victim:SendPM(Sbot,"You've been kicked by the K-VIP "..user.sName.." - reason : "..reason)
			if (arrVipLog[victim.sName] == nil) then
				arrVipLog[victim.sName] = {}
				arrVipLog[victim.sName]["KICK"] = "The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason
				arrVipLog[victim.sName]["TIMES"] = 1
			else
				arrVipLog[victim.sName]["TIMES"] = arrVipLog[victim.sName][TIMES] + 1
				arrVipLog[victim.sName]["KICK"] = "The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason
			end
			if (arrVipLog[victim.sName]["TIMES"] > iBan) then
				victim:SendPM(Sbot,"You have been kicked "..iBan.." times. You are being banned.")
				victim:Ban()
			else
				victim:TempBan()
				victim:Disconnect()
			end
			SaveToFile(fVipLog , arrVipLog , "arrVipLog")
			else
			user:SendData(sBot,"You can't kick an OP or VIP")
			end
		else
			user:SendData(sBot,"You're not allowed to use this command")
		end
	return 1
	end
	s,e,cmd = strfind( data, "%b<>%s+(%S+)")
	if (cmd == "!vkicklog" and user.bOperator) then
		local sTmp,victim,table = "The Kicks Log made by Vips:\r\n\r\n"
		for victim, table in arrVipLog do
			sTmp = sTmp.."Victim: "..victim.." ## Kick: "..table["KICK"].." ## Kicked: "..table["TIMES"].."\r\n"
		end
		user:SendPM(sBot, sTmp)
		return 1
	end
end
end


function NewUserConnected(user,data)
if supervip[user.sName] ~= 0 then
	user:SendData("$UserCommand 1 2 K-VIP\\Kick$<%[mynick]> !kik %[nick] %[line:Motif du kick]||")
end
end

function OpConnected(user,data)
if user.iProfile == 0 or user.iProfile == 4 then
	user:SendData("$UserCommand 1 2 Master commandes\\K-VIP\\Add K-VIP$<%[mynick]> !vipkick %[nick]||")
	user:SendData("$UserCommand 1 2 Master commandes\\K-VIP\\Del K-VIP$<%[mynick]> !vipunkick %[nick]||")
end
end

function Serialize(tTable, sTableName, sTab)
	assert(tTable, "tTable equals nil");
	assert(sTableName, "sTableName equals nil");

	assert(type(tTable) == "table", "tTable must be a table!");
	assert(type(sTableName) == "string", "sTableName must be a string!");

	sTab = sTab or "";
	sTmp = ""

	sTmp = sTmp..sTab..sTableName.." = {\n"

	for key, value in tTable do
		local sKey = (type(key) == "string") and format("[%q]",key) or format("[%d]",key);

		if(type(value) == "table") then
			sTmp = sTmp..Serialize(value, sKey, sTab.."\t");
		else
			local sValue = (type(value) == "string") and format("%q",value) or tostring(value);
			sTmp = sTmp..sTab.."\t"..sKey.." = "..sValue
		end

		sTmp = sTmp..",\n"
	end

	sTmp = sTmp..sTab.."}"
	return sTmp
end

function SaveToFile(file , table , tablename)
	writeto(file)
	write(Serialize(table, tablename))
	writeto()
end

function LoadFromFile(file)
	if (readfrom(file) ~= nil) then
		readfrom(file)
		dostring(read("*all"))
		readfrom()
	end
end

If it works OK post it in the KVip topic please.

Best regards, nErBoS
--## nErBoS Spot ##--

jiten

#23
Well, when I try to kick for the 2nd time i get this error:

Syntax error: table index is nil
stack traceback:
   1:  function `DataArrival' at line 79 [file `...Desktop\robo9b\scripts\seiya.lua']


By the way, the script that I would like you to modify was the latest KVIP from Seiya's, version 1.6. This one is the first one, with some bugs.

Thanks in advance.

jiten

nErBoS

#24
Hi,

Changed to the version wanted...

-- K-VIP by Seiya 
-- Version 1.6 
-- add kick to the VIP you want 
-- without creating a new profile 
-- fix bug : all vip have the command 
-- fix bug : Kvip which is degrated can't use anymore the kik command 
-- fix bug : load (don't laugh) the svip.txt file when starting the script 
-- fix bug : VIP can't add/revoke VIP to/from K-VIP anymore 
-- add the userinfo command 
-- Added by request a kick log and its command !vkicklog (made by nErBoS)
-- Added by request a Ban to a x amout of Kicks (made by nErBoS)


sBot = "@Dohko" 

savevipkick = "logs/svip.txt" -- you have to create a svip.txt file ine the ptokax\scripts\logs directory 
supervip = {} 
fVipLog = "viplog.dat"
arrVipLog = {}
iBan = 4 -- Times of Kick equal to a ban

function Main() 
loadfile(savevipkick) 
LoadFromFile(fVipLog)
end 

function dosavesupervip(user,data) 
writeto(savevipkick) ; 
write("supervip = {"); 
for a,b in supervip do 
if b then 
write(format("[%q]=",a)..b..","); 
end 
end 
write("}" ); 
writeto(); 
end 


function DataArrival (user,data) 
	if strsub(data, 1, 1) == "<" then 
		data=strsub(data,1,strlen(data)-1) 
		s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" ) 
		victim = GetItemByName(Name) 
		if cmd == "!vipkick" and ((user.iProfile == 0) or (user.iProfile == 4)) then 
			if victim.iProfile == 2 then 
				if supervip[victim.sName] == nil then 
					supervip[victim.sName] = 1 
					dosavesupervip() 
					SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to"..victim.sName) 
					victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just have a look at your right click for kick command") 
				else 
					supervip[victim.sName] = supervip[victim.sName] + 1 
					dosavesupervip() 
					SendPmToOps(sBot,"The Op "..user.sName.." give the K-VIP status to "..victim.sName) 
					victim:SendPM(sBot,"congratulations, You've been upgrated to K-VIP. Just reconnect to have the kick command in your right click") 
				end 
			else 
				user:SendData(sBot,"The user "..victim.sName.." isn't a VIP yet. It can't be upgrated to K-VIP") 
			end 
			return 1 
		elseif cmd == "!vipunkick" and ((user.iProfile == 0) or (user.iProfile == 4)) then 
			if victim.iProfile == 2 then 
				if supervip[victim.sName] ~= 0 then 
					supervip[victim.sName] = 0 
					dosavesupervip() 
					SendPmToOps(sBot,"The Op "..user.sName.." has just revoked "..victim.sName.." from k-VIP") 
					victim:SendPM(sBot,"You've been revoked from K-VIP") 
				end 
			else 
				user:SendData(sBot,"The user "..victim.sName.." isn't a K-VIP.") 
			end 
			return 1 
		elseif cmd == "!inf" then 
			if ((user.iProfile == 2) and (supervip[user.sName] == 1)) or (user.iProfile == 0) or (user.iProfile == 4) then 
				UserInfo(user,data) 
			else 
				user:SendData(sBot,"You're not allowed to use this command") 
			end 
			return 1 
		end 
		s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s*(.*)" ) 
		victim = GetItemByName(Name) 
		if cmd == "!kik" then 
			if (supervip[user.sName] == 1) and (user.iProfile == 2) then 
				if victim.iProfile == -1 or victim.iProfile == 3 then 
					SendToAll(sBot,"The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason) 
					victim:SendPM(Sbot,"You've been kicked by the K-VIP "..user.sName.." - reason : "..reason) 
					if (arrVipLog[victim.sName] == nil) then
						arrVipLog[victim.sName] = {}
						arrVipLog[victim.sName]["KICK"] = "The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason
						arrVipLog[victim.sName]["TIMES"] = 1
					else
						arrVipLog[victim.sName]["TIMES"] = arrVipLog[victim.sName]["TIMES"] + 1
						arrVipLog[victim.sName]["KICK"] = "The K-VIP "..user.sName.." kick "..victim.sName.." - reason : "..reason
					end
					if (arrVipLog[victim.sName]["TIMES"] > iBan) then
						victim:SendPM(Sbot,"You have been kicked "..iBan.." times. You are being banned.")
						arrVipLog[victim.sName]["TIMES"] = 0
						victim:Ban()
					else
						victim:TempBan()
						victim:Disconnect()
					end
					SaveToFile(fVipLog , arrVipLog , "arrVipLog")
				else
					user:SendData(sBot,"You can't kick an OP or VIP")
				end
			else 
				user:SendData(sBot,"You're not allowed to use this command") 
			end 
			return 1 
		end
		s,e,cmd = strfind( data, "%b<>%s+(%S+)")
		if (cmd == "!vkicklog" and user.bOperator) then
			local sTmp,victim,table = "The Kicks Log made by Vips:\r\n\r\n"
			for victim, table in arrVipLog do
				sTmp = sTmp.."Victim: "..victim.." ## Kick: "..table["KICK"].." ## Kicked: "..table["TIMES"].."\r\n"
			end
			user:SendPM(sBot, sTmp)
			return 1
		end
	end 
end 

function NewUserConnected(user,data) 
if (supervip[user.sName] == 0) or (supervip[user.sName] == nil) then 
else 
if user.iProfile == 2 then 
user:SendData("$UserCommand 1 2 K-VIP\\Kick$<%[mynick]> !kik %[nick] %[line:Motif du kick]||") 
user:SendData("$UserCommand 1 2 K-VIP\\UserInfo$<%[mynick]> !inf %[nick]||") 
end 
end 
end 

function OpConnected(user,data) 
if user.iProfile == 0 or user.iProfile == 4 then 
user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\Add K-VIP$<%[mynick]> !vipkick %[nick]||") 
user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\Del K-VIP$<%[mynick]> !vipunkick %[nick]||") 
user:SendData("$UserCommand 1 2 Master commands\\K-VIP\\UserInfo$<%[mynick]> !inf %[nick]||") 
end 
end 

function loadfile (savevipkick) 
assert(readfrom(savevipkick)) 
dostring(read("*all")) 
readfrom() 
end 

function UserInfo(user, data) 
s,e,cmd,who = strfind(data, "%b<>%s+(%S+)%s+(%S+)%s*") 
local usr = GetItemByName(who) 
if usr == nil then 
return 1 
end 
if usr.iProfile == 4 then 
profile = "Admin" 
elseif usr.iProfile == -1 then 
profile = "User" 
elseif usr.iProfile == 0 then 
profile = "Master" 
elseif usr.iProfile == 1 then 
profile = "Operator" 
elseif usr.iProfile == 2 and supervip[usr.sName] == 0 then 
profile = "VIP" 
elseif usr.iProfile == 2 and supervip[usr.sName] == 1 then 
profile = "K-VIP" 
elseif usr.iProfile == 3 then 
profile = "Reg" 
else 
profile = "Unknown" 
end 


user:SendPM(sBot, "? Name: "..who.." |") 
user:SendPM(sBot, "? Profile: "..profile.." |") 
user:SendPM(sBot, "? IP: "..usr.sIP.." |") 

_,b, dcver = strfind(usr.sMyInfoString,"V:(%x+.%x+)") 
if (strfind(usr.sMyInfoString,"

Best regards, nErBoS
--## nErBoS Spot ##--

SMF spam blocked by CleanTalk