Somebody knows what's wrong is with this?
On *:BAN:#:{
write bans.txt $nick was banned by $$1- with the reason : $+ $4 $+
}
It needs to write a txt in my mIRC map and needs to write (like this):
Ulanta was banned by Axeserv with the reason : No date chat!
$nick = Person who did the banning
$bnick = Person who was banned
Bans have no reasons. Only kicks do. And I don't know why you have a $+ at the end of the line as it will not do anything like that.
$banmask is the address banned - dont forget that one
True, but the example didn't show any need for that.
true that, but considering the original coding was wrong, I figured I'd offer that up since it is related to the event
Aha, so you guys mean this? :
On *:BAN:#:{
write bans.txt $bnick ( $banmask ) was banned by $nick with the reason : $+ $4 $+
}
??
But that $+ $4 $+ is good? ;o
erm..
it works
but i get :
( *!*@axe-6B2E39AA.retail.telecomitalia.it ) was banned by Gamingbot with the reason :
( *!*@axe-E015E75A.adsl.alicedsl.de ) was banned by Boyy_18__ with the reason :
( *!*@axe-69A4ED39.cable.quicknet.nl ) was banned by Duck_Power with the reason :
it doesnt say the reason, and the $bnick
I think i know now what the reason is :
$chr(40) $+ $1- $+ ! $+ $chr(41)
but the $bnick still doesnt work
No that doesn't work.
It shows :
with the reason (+b <address)
As I stated, you do NOT have a reason on a ban. Only on kicks.
I know, but it's for my bot, and i just like it
xD
Cause if peoples are gonna ask why they are banned, i can show it!
$bnick is only filled if the nick is in the ban mask, otherwise $bnick is $null.
* Robert sets mode: +b [color:red]Nick!*@axe-6B2E39AA.retail.telecomitalia.it[/color]
on *:BAN:#: {
write bans.txt $bnick ( $banmask ) was banned by $nick
}
In this case, $bnick = Nick & $nick = Robert
You'd be better off logging bans & kicks...
on *:BAN:#: {
write kbans.txt $nick banned $banmask $iif($bnick,$+($chr(40),$bnick,$chr(41))) on #
}
on *:KICK:#: {
write kbans.txt $knick as kicked from # by $nick $iif($1 != $null,with the reason: $1-)
}
As RoCk said, you need to get the reason from the kick event. Just because you want to get a reason from the ban doesn't mean you can. When you ban someone, you do not give a reason. Only the kick has a reason.
You'd be better off logging bans & kicks...
on *:BAN:#: {
write kbans.txt $nick banned $banmask $iif($bnick,$+($chr(40),$bnick,$chr(41))) on #
}
on *:KICK:#: {
write kbans.txt $knick as kicked from # by $nick $iif($1 != $null,with the reason: $1-)
}
Nice script. Is there a way to have it also record the date in that log?
adding the date is as easy as adding either $date or $fulldate into the line that you're writing. For example you could change
write kbans.txt $nick banned $banmask $iif($bnick,$+($chr(40),$bnick,$chr(41))) on #
to
write kbans.txt $nick banned $banmask $iif($bnick,$+($chr(40),$bnick,$chr(41))) on # (Date: $fulldate $+ )