mIRC Homepage
Posted By: DuXxXieJ On Ban - 02/02/07 07:10 PM
Somebody knows what's wrong is with this?

Code:
 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):



Php Code:
 Ulanta was banned by Axeserv with the reason : No date chat!  


Posted By: Riamus2 Re: On Ban - 02/02/07 09:54 PM
$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.
Posted By: landonsandor Re: On Ban - 03/02/07 02:17 AM
$banmask is the address banned - dont forget that one smile
Posted By: Riamus2 Re: On Ban - 03/02/07 04:07 AM
True, but the example didn't show any need for that. smile
Posted By: landonsandor Re: On Ban - 03/02/07 07:53 AM
true that, but considering the original coding was wrong, I figured I'd offer that up since it is related to the event smile
Posted By: DuXxXieJ Re: On Ban - 03/02/07 10:57 AM
Aha, so you guys mean this? :

Code:
 On *:BAN:#:{
write bans.txt $bnick ( $banmask ) was banned by $nick with the reason : $+ $4 $+
}


??

But that $+ $4 $+ is good? ;o
Posted By: DuXxXieJ Re: On Ban - 03/02/07 10:59 AM
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
Posted By: DuXxXieJ Re: On Ban - 03/02/07 12:31 PM
I think i know now what the reason is :

Code:
 $chr(40) $+ $1- $+ ! $+ $chr(41)


but the $bnick still doesnt work
Posted By: DuXxXieJ Re: On Ban - 03/02/07 12:37 PM
No that doesn't work.

It shows :

with the reason (+b <address)

frown
Posted By: Riamus2 Re: On Ban - 03/02/07 01:38 PM
As I stated, you do NOT have a reason on a ban. Only on kicks.
Posted By: DuXxXieJ Re: On Ban - 03/02/07 01:44 PM
I know, but it's for my bot, and i just like it

xD
Posted By: DuXxXieJ Re: On Ban - 03/02/07 01:44 PM
Cause if peoples are gonna ask why they are banned, i can show it!
Posted By: RoCk Re: On Ban - 03/02/07 02:39 PM
$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-)
}
Posted By: Riamus2 Re: On Ban - 03/02/07 08:26 PM
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.
Posted By: blues Re: On Ban - 15/02/07 01:35 AM
Originally Posted By: RoCk

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?
Posted By: drc4 Re: On Ban - 15/02/07 09:41 AM
adding the date is as easy as adding either $date or $fulldate into the line that you're writing. For example you could change
Quote:
write kbans.txt $nick banned $banmask $iif($bnick,$+($chr(40),$bnick,$chr(41))) on #
to
Quote:
write kbans.txt $nick banned $banmask $iif($bnick,$+($chr(40),$bnick,$chr(41))) on # (Date: $fulldate $+ )
Posted By: blues Re: On Ban - 17/02/07 05:24 AM
Thanks much, drc4 smile
© mIRC Discussion Forums