hai all
i really want/need a bot that can log all this.
kick with reason
tempban with reason
ban with reason
this with who kicked and time and date.
this all because i get a lot of users asking me why they kicked and i have not any kind of log of that.
i would prefer something like this:
xxxx has kicked/tempbanned/banned [user] at 21-10 at 14.00 hours
reason: wrong files.
and saved in a txt file so no need for commands like showkicklog or something like that..
so if anyon feels up to this challenge......
would be very gratefull.
tia peter.
ChannelBot supports this.....
I also use it & no probs here :D
Greez Event_Horizon
Event_Horizon
i know that channelbot has this feature built in but i,m quitte happy with my hubsoft .
that is why i wanted this one to be stand-alone
greetz trucker.
c,mon folks is someone looking into this?
i wouold hate to see this threat blead to dead
chilla's logger bot ????????
i could say the same again as i did on a couple other requests from you. lol
don't wanne give optimus 2 much work.
my bot so far all but 1 of your requests. lol
plop
QuoteOriginally posted by [NL]trucker
c,mon folks is someone looking into this?
i wouold hate to see this threat blead to dead
Why dont try to take that part out of CB and try make ur own script??
If u dont know how to script just ask how to do it =))
I dont know jack ( I think altleast:] ) but i could give it a shoot if u like to??
plop
chilla,s bot logs a lot and i like it but it doesnt log who kicked who and why.
besides this bot would be a little bit more expanded.
and probably not so expanded as chilla,s bot if you get my drift.
snoris
be my guest m8
even though i have been on lua forum for a while now i,m still further away from scripting then a noob.
Tried some codes but didnt get it to work...Since I have my own hub and Network aswell I cant finish the thing...But hey....I gave it a shoot atleast =]
I hope u get it to work by your self or if someone else might be helpful =))
Well duno but here is a Simple start for making the script... It's just a Example to make more
-- Quick logger by Optimus
-- and tested quickly
Bot = "-MMmmm-"
Prefix = "!"
file = "logs.txt"
function Main()
frmHub:RegBot(Bot)
end
function DataArrival(user,data)
if( strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
local _,_,cmd = strfind( data, "%b<>%s+(%S+)" )
if user.bOperator then
if (cmd == Prefix.."kick" ) then
doKick(user, data, cmd)
return 1
elseif (cmd == Prefix.."ban" ) then
doBan(user, data, cmd)
return 1
end
end
end
end
function doKick(user, data, cmd)
s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )
if reason == nil then
rsn = "No reason given!"
s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
rsn = reason
end
victim = GetItemByName(Name)
if victim ~= nil then
victim:SendData(Bot,"You are being KICKED by "..user.sName.." - Reason: "..reason)
SendToAll(Bot,"User "..victim.sName.." has been KICKED by "..user.sName.." - Reason: "..reason)
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") kicked by "..user.sName.." - Reason: "..reason)
victim:Disconnect()
return 1
end
end
function doBan(user, data,cmd)
s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )
if reason == nil then
rsn = "No reason given!"
s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
rsn = reason
end
victim = GetItemByName(Name)
if victim ~= nil then
victim:SendData(Bot,"You are being BANNED by "..user.sName.." - Reason: "..reason)
SendToAll(Bot,"User "..victim.sName.." has been BANNED by "..user.sName.." - Reason: "..reason)
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") banned by "..user.sName.." - Reason: "..reason)
victim:Ban()
return 1
end
end
function Writetolog(what)
appendto(file)
write(what.."\n")
writeto()
end
Optimus
thnx m8
i,m gonna try this as soon as i have my comp back.
a liitle idear from a noob
i heard that with elseif a script can be optimized
so i was thinking something like this:
function doKick(user, data, cmd)
elseif
function doBan(user, data, cmd)
s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )
this just beeing an idear would it function?
and is it possible to make the mesages show in main only to OPs and above?
i dont like the idear of the chat flooded by kickmessages
it intterupts the chat to much i think.
Yups, no prob Trucker will make ya a new 1
Except for this >>>
function doKick(user, data, cmd)
elseif
function doBan(user, data, cmd)
That's not cool
Quotedon't wanne give optimus 2 much work.
Mmmm,
New 1, Notification ToOps and Above...
Bot = "-MMmmm-"
Prefix = "!"
file = "logs.txt"
function Main()
frmHub:RegBot(Bot)
end
function DataArrival(user,data)
if( strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
local _,_,cmd = strfind( data, "%b<>%s+(%S+)" )
if user.bOperator then
if (cmd == Prefix.."kick" ) then
doKick(user, data, cmd)
return 1
elseif (cmd == Prefix.."ban" ) then
doBan(user, data, cmd)
return 1
end
end
end
end
function doKick(user, data, cmd)
s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )
if reason == nil then
rsn = "No reason given!"
s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
rsn = reason
end
victim = GetItemByName(Name)
if victim ~= nil then
victim:SendData(Bot,"You are being KICKED by "..user.sName.." - Reason: "..reason)
SendToOps(Bot,"User "..victim.sName.." has been KICKED by "..user.sName.." - Reason: "..reason)
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") kicked by "..user.sName.." - Reason: "..reason)
victim:Disconnect()
return 1
end
end
function doBan(user, data,cmd)
s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )
if reason == nil then
rsn = "No reason given!"
s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
rsn = reason
end
victim = GetItemByName(Name)
if victim ~= nil then
victim:SendData(Bot,"You are being BANNED by "..user.sName.." - Reason: "..reason)
SendToOps(Bot,"User "..victim.sName.." has been BANNED by "..user.sName.." - Reason: "..reason)
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") banned by "..user.sName.." - Reason: "..reason)
victim:Ban()
return 1
end
end
function Writetolog(what)
appendto(file)
write(what.."\n")
writeto()
end
Thanks Optimus
function doKick(user, data, cmd)
elseif
function doBan(user, data, cmd)
this was just an idear to optimize it all but i guess it was wrong thinking from my site.
cause now you have a separate thing for kick and ban and have two routines for it
also with the
if reason == nil then
rsn = "No reason given!"
s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
rsn = reason
end
it is twice in the script i thought it would be an idear to reduce that to one with the command {elseif }
but i gues i still have a lot to learn .
anyway thanks for the script and the effort you made with it.
- UPDATE -
Bot = "-MMmmm-"
Prefix = "!"
file = "logs.txt"
function Main()
frmHub:RegBot(Bot)
end
function DataArrival(user,data)
if( strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
local _,_,cmd = strfind( data, "%b<>%s+(%S+)" )
if user.bOperator then
if (cmd == Prefix.."kick" ) then
doKick(user, data, cmd)
return 1
elseif (cmd == Prefix.."ban" ) then
doBan(user, data, cmd)
return 1
end
end
end
end
function doName_Reason(user, data)
s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )
if reason == nil then
rsn = "No reason given!"
s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
rsn = reason
end
end
function doKick(user, data, cmd)
doName_Reason(user, data)
victim = GetItemByName(Name)
if victim ~= nil then
victim:SendData(Bot,"You are being KICKED by "..user.sName.." - Reason: "..rsn)
SendToOps(Bot,"User "..victim.sName.." has been KICKED by "..user.sName.." - Reason: "..rsn)
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") kicked by "..user.sName.." - Reason: "..rsn)
victim:Disconnect()
return 1
end
end
function doBan(user, data,cmd)
doName_Reason(user, data)
victim = GetItemByName(Name)
if victim ~= nil then
victim:SendData(Bot,"You are being BANNED by "..user.sName.." - Reason: "..rsn)
SendToOps(Bot,"User "..victim.sName.." has been BANNED by "..user.sName.." - Reason: "..rsn)
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") banned by "..user.sName.." - Reason: "..rsn)
victim:Ban()
return 1
end
end
function Writetolog(what)
appendto(file)
write(what.."\n")
writeto()
end
thanks optimus
i will test this one soon. :-))
optimus
where to put the logs.txt?
i have it now in the same dir as the script but it wont log.
so do i need a special dir for it?
Yes in scripts folder, that's all...
It's working here, please check again
08/12-2003 23:35:07 Test (192.168.1.1) kicked by [SU]Optimus - Reason: No reason given!
[NL]trucker do you mean something like the old kick-log bot like piglja released last year!
If so contact me and i'll send it to you!
It contains it all!
-Troubadour-
troubadour
yep something like that m8 i really would love to have it.
if you can give me a addy where to download it it would be perfect as my hub is hosted now for a few.
otherwise you could send it to my mail addy
pfokkink@hotmail.com
thanx m8
trie this one:
code:
Bot = "bot_name"
Prefix = "!"
file = "logs.txt"
function Main()
frmHub:RegBot(Bot)
end
function DataArrival(user,data)
if( strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
local _,_,cmd = strfind( data, "%b<>%s+(%S+)" )
if user.bOperator then
if (cmd == Prefix.."kick" ) then
doKick(user, data, cmd)
return 1
elseif (cmd == Prefix.."ban" ) then
doBan(user, data, cmd)
return 1
end
end
end
end
function doName_Reason(user, data)
s,e,cmd,Name,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )
if reason == nil then
rsn = "No reason given!"
s,e,cmd,Name = strfind( data, "%b<>%s+(%S+)%s+(%S+)" )
else
rsn = reason
end
end
function doKick(user, data, cmd)
doName_Reason(user, data)
victim = GetItemByName(Name)
if victim ~= nil then
victim:SendData(Bot,"You are being KICKED by "..user.sName.." - Reason: "..rsn)
SendToOps(Bot,"User "..victim.sName.." has been KICKED by "..user.sName.." - Reason: "..rsn)
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") kicked by "..user.sName.." - Reason: "..rsn)
victim:Disconnect()
return 1
end
end
function doBan(user, data,cmd)
doName_Reason(user, data)
victim = GetItemByName(Name)
if victim ~= nil then
victim:SendData(Bot,"You are being BANNED by "..user.sName.." - Reason: "..rsn)
SendToOps(Bot,"User "..victim.sName.." has been BANNED by "..user.sName.." - Reason: "..rsn)
Writetolog(date("%d").."/"..date("%m").."-"..date("%Y").." "..date("%T").." "..victim.sName.." ("..victim.sIP..") banned by "..user.sName.." - Reason: "..rsn)
victim:Ban()
return 1
end
end
function Writetolog(what)
appendto(file)
write(what.."\n")
writeto()
end
Spyro
thnx i will tr this one out soon and post any comment back to you.