mIRC Homepage
Posted By: schism Changing how mIRC logs, efficient banscipt? - 01/05/06 05:55 AM
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.
I use:

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


-Andy
[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?
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
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 '
© mIRC Discussion Forums