I am New So be gental with me please :D
Is there a script that gets a users ..IP.. B4 the bot kicks for ADVERTISING ?(
I thank you
well, post the script here and it will be easilt changeds
I hope this wot u mean like I said I am new to this THANKS
code:--------------------------------------------------------------------------------
-- sneaky anti advertising bot by plop
-- it replaces the url's users post for your own. lol
-- let them work for you, instead of against you
-- thx again for the hints from rabidwombat
WEBSITE = "http://www.dcvikings.com/~goldenangel/"
HUBADRESS ="goldenangel.no-ip.org"
OKSITES = { ["www.plop.nl"] = 1, ["www.dcvikings.com"] = 1 }
OKHUBS = { ["tga-darkstar.no-ip.com"] = 1, ["goldenangel.no-ip.org"] = 1, ["tga-norge.2waky.com"] = 1}
function DataArrival(user, data)
if user.iProfile == -1 or user.iProfile == 3 then
if (strsub(data, 1, 1) == "<") then
--if not(strsub(data, 1, 4) == "$To:") then
data = strsub(data, 1, (strlen(data)-1))
local s,e,msg,webadver,msg2 = strfind(data, "%b<>%s(.*)//http://([^%.]+%.[^%.]+%.%S+)(.*)$")
if webadver ~= nil then
local s,e,webby = strfind(webadver, "(%S+%.[^%.]+%.%a+)/.*")
if webby == nil then webby = webadver end
if OKSITES[webby] == nil then
SendToAll(user.sName, msg..WEBSITE..msg2)
return 1
end
else
local s,e,msg,webadver,msg2 = strfind(data, "%b<>%s(.*)(www+%.[^%.]+%.%S+)(.*)$")
if webadver ~= nil then
local s,e,webby = strfind(webadver, "(%S+%.[^%.]+%.%a+)/.*")
if webby == nil then webby = webadver end
if OKSITES[webby] == nil then
SendToAll(user.sName, msg..WEBSITE..msg2)
return 1
end
else
local s,e, adver = strfind(data, "%b<>%s(%S+%.[^%.]+%.[^%.]+)")
if adver ~= nil then
local s,e,hubby = strfind(adver, "(%S+%.[^%.]+%.%a+)/.*")
if hubby == nil then hubby = adver end
if OKHUBS[hubby] == nil then
SendToAll(user.sName, HUBADRESS)
return 1
end
else
local s,e,msg,adver,msg2 = strfind(data, "%b<>%s(.*)%s([^%.]+%.[^%.]+%.%S+)(.*)$")
if adver ~= nil then
local s,e,hubby = strfind(adver, "(%S+%.[^%.]+%.%a+)/.*")
if hubby == nil then hubby = adver end
if OKHUBS[hubby] == nil then
SendToAll(user.sName, msg.." "..HUBADRESS..msg2)
return 1
end
end
end
end
end
else
--local s,e,to,text = strfind(data, "%$To: (%S+) From: %S %$(.+)$")
local s,e,to,text = strfind(data, "%$To:%s(%S+)%sFrom:%s%S+%s$(.*)$")
if(to == nil) then return 0 end
to = GetItemByName(to)
if to.iProfile == -1 or to.iProfile == 3 then
text = strsub(text, 1, (strlen(text)-1))
local s,e,msg,webadver,msg2 = strfind(text, "%b<>%s(.*)//http://([^%.]+%.[^%.]+%.%S+)(.*)$")
if webadver ~= nil then
local s,e,webby = strfind(webadver, "(%S+%.[^%.]+%.%a+)/.*")
if webby == nil then webby = webadver end
if OKSITES[webby] == nil then
SendPmToNick(to.sName, user.sName, msg..WEBSITE..msg2)
return 1
end
else
local s,e,msg,webadver,msg2 = strfind(text, "%b<>%s(.*)(www+%.[^%.]+%.%S+)(.*)$")
if webadver ~= nil then
local s,e,webby = strfind(webadver, "(%S+%.[^%.]+%.%a+)/.*")
if webby == nil then webby = webadver end
if OKSITES[webby] == nil then
SendPmToNick(to.sName, user.sName, msg..WEBSITE..msg2)
return 1
end
else
local s,e, adver = strfind(text, "%b<>%s(%S+%.[^%.]+%.[^%.]+)")
if adver ~= nil then
local s,e,hubby = strfind(adver, "(%S+%.[^%.]+%.%a+)/.*")
if hubby == nil then hubby = adver end
if OKHUBS[hubby] == nil then
SendPmToNick(to.sName, user.sName, HUBADRESS)
return 1
end
else
local s,e,msg,adver,msg2 = strfind(text, "%b<>%s(.*)%s([^%.]+%.[^%.]+%.%S+)(.*)$")
if adver ~= nil then
local s,e,hubby = strfind(adver, "(%S+%.[^%.]+%.%a+)/.*")
if hubby == nil then hubby = adver end
if OKHUBS[hubby] == nil then
SendPmToNick(to.sName, user.sName, msg.." "..HUBADRESS..msg2)
return 1
end
end
end
end
end
end
end
end
end
OOOPS I THINK IT WAS THE WRONG ONE
I THINK IT IS THIS ONE U WERE ON ABOUT :)
-- T-Rage Kick/Ban Count/Log -Bot
-- Version: 3.4
-- By: NightLitch 2004
-- Made some fixes
-- Major update :-P
-- Counter added...
-- Made some fixes...
-- Added 3x kick = ban
-- Fixed a small error
-- Fixed some more errors...
-- NOTE: create a folder name ( log )
-- the files will be created there when first user is kicked/banned.
--
-- Available commands:
-- +kick [reason]
-- +ban [reason]
-- +getban
-- +getkick
---------------------------------------------
BotName = "T-Rage"
---------------------------------------------
BanLog = "log/banlog.txt"
KickLog = "log/kicklog.txt"
BanTable = {}
KickTable = {}
Count = {}
maxKicks = 3
usrKicks = { }
---------------------------------------------
Time = ""..date("%d").."/"..date("%m").."-"..date("%Y")..""
---------------------------------------------
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 not cmd then cmd = "0" end
cmd = strlower(cmd)
if (cmd == "+ban") and curUser.bOperator then
ComFunc(curUser,data,"!ban",BanLog,BanTable)
return 1
elseif (cmd == "+kick") and curUser.bOperator then
ComFunc(curUser,data,"!kick",KickLog,KickTable)
return 1
elseif (cmd == "+getban") and curUser.bOperator then
ShowLogs(curUser,data,"!getban","ban(s)",BanLog,BanTable)
return 1
elseif (cmd == "+getkick") and curUser.bOperator then
ShowLogs(curUser,data,"!getkick","kick(s)",KickLog,KickTable)
return 1
end
elseif strsub(data, 1, 5) == "$To: " then
RightKick2(curUser, data)
elseif strsub(data,1,6) == "$Kick " then
RightKick1(curUser, data)
return 1
end
end
---------------------------------------------
function ComFunc(curUser,data,command,file,table)
local s,e,nick,reason = strfind( data, "%b<>%s+%S+%s+(%S+)%s*(.*)" )
if nick == nil or nick == "" then
curUser:SendData(BotName,"*** Syntax error in command "..command.." [reason]: No parameter given.")
return 1
end
local vUser = GetItemByName(nick)
if not vUser then
curUser:SendData(BotName,nick.." is not online or wrong name...")
return 1
end
if (rule == nil or rule == "") then rule = "Not given"
else rule = ""..rule
end
if command == "+kick" then
sc = "kicked"
elseif command == "+ban" then
sc = "banned"
end
Msg = ""..vUser.sName.."$"..sc..","..curUser.sName..","..Time..","..reason
local handle = openfile(file, "a")
write(handle,Msg.."\r\n")
closefile(handle)
vUser:SendPM(BotName,"You are being "..sc.." by "..curUser.sName..", because: "..reason)
SendToAll(BotName,curUser.sName.." is "..sc.." "..nick..", reason: "..reason)
if sc == "kicked" then
usrKicks[nick] = usrKicks[nick] or 0
usrKicks[nick] = usrKicks[nick] + 1
if vUser and usrKicks[nick] >= maxKicks then
SendToOps("Hub-Security", "User "..nick.." has now been permbanned for repeated violations.")
vUser:SendData("*** Banned.")
Msg = ""..vUser.sName.."$banned,"..curUser.sName..","..Time..",Kicked "..maxKicks.." times"
local handle = openfile(BanLog, "a")
write(handle,Msg.."\r\n")
closefile(handle)
vUser:Ban()
else
vUser:TempBan()
end
elseif sc == "banned" then
vUser:Ban()
end
end
function ShowLogs(curUser,data,command,dora,file,table)
local s,e,nick = strfind( data, "%b<>%s+%S+%s+(%S+)" )
if nick == nil or nick == "" then
curUser:SendData(BotName,"*** Syntax error in command "..command.." : No parameter given.")
return 1
end
LoadTable(table,file)
local one = ""
for vNick,vInfo in table do
if strlower(nick) == strlower(vNick) then
local s,e,arg,operator,time,reason = strfind( vInfo, "(%S+),(%S+),(%S+),(.*)")
GetInfo = "User: "..nick.." is "..arg..", by "..operator.." becouse: "..reason..", at time "..time..""
GetCount(file,dora,nick)
curUser:SendData(BotName,GetInfo)
curUser:SendData(BotName,"Total "..CNT)
one = "1"
end
end
if one == "" then
curUser:SendData(BotName,"User not found...")
end
end
function LoadTable(table,file)
local handle = openfile(file, "r")
if (handle) then
local line = read(handle)
while line do
s,e,ind,val = strfind( line, "(.*)$(.*)")
table[ind]=val
line = read(handle)
end
closefile(handle)
end
end
function RightKick2(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 vUser~=nil then
Msg = ""..vUser.sName.."$kicked,"..curUser.sName..","..Time..","..reason
local handle = openfile(KickLog, "a")
write(handle,Msg.."\r\n")
closefile(handle)
end
end
end
end
function RightKick1(curUser, data)
data=strsub(data,1,strlen(data)-1)
local s,e,who = strfind(data,"$Kick%s+(.*)")
if GetItemByName(who) then
local vUser=GetItemByName(who)
usrKicks[who] = usrKicks[who] or 0
usrKicks[who] = usrKicks[who] + 1
if vUser and usrKicks[who] >= maxKicks then
SendToOps("Hub-Security", "User "..who.." has now been permbanned for repeated violations.")
vUser:SendData("*** Banned.")
Msg = ""..vUser.sName.."$banned,"..curUser.sName..","..Time..",Kicked "..maxKicks.." times"
local handle = openfile(BanLog, "a")
write(handle,Msg.."\r\n")
closefile(handle)
vUser:Ban()
else
vUser:TempBan()
end
end
end
function ShowCount(filename)
local file = openfile(filename, "r")
assert(file, "cant open "..filename)
local total, Count = 0, {}
local line = read(file, "*l")
while line do
total = total+1
local s, e, nick, arg, op, time, reason = strfind(line, "(%S-)$(%S-),(%S-),(%S-),(.*)")
assert(s, "bad format on line "..total)
Count[strlower(nick)] = (Count[strlower(nick)] or 0)+1
line = read(file, "*l")
end closefile(file)
return Count, total
end
function GetCount(file,dora,user)
local Count, total = ShowCount(file)
if Count[user] == nil then
CNT = dora..": 0"
return CNT
else
CNT = dora..": "..Count[user]
return CNT
end
end
-- By: NightLitch