kick-tempban -ban logger bot????
 

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

kick-tempban -ban logger bot????

Started by [NL]trucker, 03 December, 2003, 17:52:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[NL]trucker

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.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


Event_Horizon

ChannelBot supports this.....

I also use it & no probs here :D

Greez Event_Horizon
Greez ????_H???z??
??????????????????

??/v\\ \'?\' ?@?? ???? is Secured by RoboCop? Created by Optimus?

[NL]trucker

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.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

c,mon folks is someone looking into this?

i wouold hate to see this threat blead to dead
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Snoris

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

[NL]trucker

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.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


Snoris

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

Optimus

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

[NL]trucker

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.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


Optimus

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

Optimus

Quotedon't wanne give optimus 2 much work.
Mmmm,

Optimus

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

[NL]trucker

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.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


Optimus

- 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


[NL]trucker

thanks optimus

i will test this one soon. :-))
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


[NL]trucker

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?
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


Optimus

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!

Troubadour

[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-
Regards,

Troubadour

** Guardian Forum **

hubaddy:   nederfun.no-ip.com

[NL]trucker

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
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


Spyro

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
-------------------------
[Iceland]Spyro

icelandic hubowners forum
-----------------------------

[NL]trucker

Spyro


thnx i will tr this one out soon and post any comment back to you.
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


SMF spam blocked by CleanTalk