mIRC Home    About    Download    Register    News    Help

Print Thread
Changing how mIRC logs, efficient banscipt? #148202 01/05/06 05:55 AM
Joined: May 2006
Posts: 22
S
schism Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: May 2006
Posts: 22
For my first question, I am looking to change the nicks logged to file to match the hostname, the IRCd I am on uses the registered nickname as the hostname, for example:
12:31:00AM * Ladicius|Away (Ladicius@Ladicius) has left #channelname

I am looking to make pisg use the hostname with stats, instead of the nicknames because people change nicks a lot and this would be much more accurate and would work well do to how this IRCd operates, however I do not know perl so I figured changing the logs would be a much easier way of doing it.

I would change the logging to use this as the nickname which would produce their registered nick no matter what their current nickname is: $remove($address($nick,2),*,!,@))

Basically I'm wondering if I use an ON TEXT/ACTION event and halt the default, will it prevent the default from being logged to the files? and what's the best way to specify the path to the logs via variable? (because sometimes logging directories get changed)


What is the most efficient way to create an autobanning script? I have one that reads from a text file everytime someone enters, but it tends to get laggy when there are a lot of bans.

Re: Changing how mIRC logs, efficient banscipt? #148203 01/05/06 06:08 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I use:

Code:
on @*:ban:#:{
  if ($banmask iswm $ial($me)) { ban $nick 2 }
}


-Andy

Re: Changing how mIRC logs, efficient banscipt? #148204 01/05/06 06:29 AM
Joined: May 2006
Posts: 22
S
schism Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: May 2006
Posts: 22
[quote]I use:

Code:
on @*:ban:#:{
  if ($banmask iswm $ial($me)) { ban $nick 2 }
}


I don't get how this script works, ial($me) just returns my hostname, where does the information contained in $banmask derived from?

Re: Changing how mIRC logs, efficient banscipt? #148205 01/05/06 06:39 AM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
My mistake I thought you wanted to ban someone when they attempted to ban you my mistake.

For the logging, if I was you I'd probably write all entries to a file from On Action/Text and have mIRC logging switched off. As you said writing to $+($gettok($address($nick,2),2,64),.log) or something similar.

-Andy

Re: Changing how mIRC logs, efficient banscipt? #148206 01/05/06 02:24 PM
Joined: Apr 2006
Posts: 14
O
oneline Offline
Pikka bird
Offline
Pikka bird
O
Joined: Apr 2006
Posts: 14
a hash table would probably be faster than reading each line from a file but i dont know how much of a difference it would make unless you have a whole lot of bans. other than that just keeping it as short as possible like..

Code:
ON *:JOIN:#blah:{
  var %tmp = $hget(banlist,0).items
  var %addr = $address($nick,5)
  while (%tmp) {
    if ($hget(banlist,%tmp).data iswm %addr) {
      ban # $nick 4 | kick # $nick banned
    }
    dec %tmp
  }
}
I didn't test that but it should work if you had a hash table where you saved entrys in numbered order like ' /hadd banlist 1 *!*@*.blah.com '