mIRC Home    About    Download    Register    News    Help

Topic Options
#131483 - 30/09/05 12:45 PM on quit text ban
McFish Offline
Pikka bird

Registered: 09/04/04
Posts: 18
I need script to ban texts on Quits please

something like :

on 1:text:quit:balbla:*:{
/ban .......

Top
#131484 - 30/09/05 02:40 PM Re: on quit text ban
Om3n Offline
Fjord artisan

Registered: 06/07/03
Posts: 655
on *:QUIT: {
if (*spam spam* iswm $1-) {
;do stuff here
}
}

This will perform the commands you put in the 'do stuff here' section if the quit msg matches against the *spam spam*. Obviously edit the *spam spam* to suit your needs, and add your desires code under the ';do stuff here' line.

I dont see why you would want to ban somebody on quit, since they have already left. In the case of some sort of join/part/quit flood, no custom quit message will be seen as most servers refuse to display a custom quit message unless the user has been connected for a certain amount of time. Also, the $chan identifier can not be used in an on quit event, because quits are a network thing and in no way related specifically to any channel.
_________________________
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby

Top
#131485 - 30/09/05 03:50 PM Re: on quit text ban
Brax Offline
Vogon poet

Registered: 26/01/05
Posts: 186
Quote:
Also, the $chan identifier can not be used in an on quit event, because quits are a network thing and in no way related specifically to any channel.


$comchan will still work though.

Code:
on *:QUIT:{
  if (*spam quit text* iswm $1-) {
    var %i = 1
    while ($comchan($nick, %i)) {
      if ($me isop $v1) {
        mode $v1 +b $address($nick,2)
      }
      inc %i
    }
  }
}


That should ban the users address in all channels you both were in (and where you are opped).
Here is still possible to match one certain channel as well by adding some more if statements.. eg
if ($v1 == #Mychannel) { do something }
if ($v1 == #yourchannel) { do some other thing }
etc...

(Untested but should work)
_________________________
echo -a $signature

Top
#131486 - 30/09/05 06:16 PM Re: on quit text ban
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Just one reason why you might want to do that... Sometimes people put some really bad stuff in their quit messages, or they use them for advertising purposes. Depending on the channel you run, you may want to prevent such a user from coming back. As an example, if your channel is meant for chatting among children and you're moderating it to prevent others from causing problems, you might ban a quit message that includes a porn link.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#131487 - 30/09/05 06:30 PM Re: on quit text ban
MikeChat Offline
Hoopy frood

Registered: 12/12/02
Posts: 1245
Loc: California, doooood
ok, shy of banning the address, how can you stop the text when the person quits (before a ban is set)

on ^*:Quit:{
echo 3 -a *** $nick just Quit
haltdef
}

maybe

Top
#131488 - 30/09/05 07:07 PM Re: on quit text ban
Brax Offline
Vogon poet

Registered: 26/01/05
Posts: 186
Quote:
ok, shy of banning the address, how can you stop the text when the person quits (before a ban is set)

on ^*:Quit:{
echo 3 -a *** $nick just Quit
haltdef
}

maybe


echo 3 -a will echo the message only to active channel.
Maybe that person is even not in this channel.

Code:
on ^*:QUIT:{
  var %i = 1
  while ($comchan($nick, %i)) {
    echo $color(Quit text) -bfrt $v1 *** Quit) $nick ( Quit )
    inc %i
  }
  haltdef
}


Maybe
_________________________
echo -a $signature

Top
#131489 - 30/09/05 08:55 PM Re: on quit text ban
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
MikeChat, that might work if you change it to echo $target. I'm not sure without being able to test it, but it may be necessary to put haltdef at the top so if there is lag in the script or something it doesn't prevent that from displaying. I'm not sure if that would have any affect or not, but thought I'd mention it.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#131490 - 30/09/05 09:18 PM Re: on quit text ban
MikeChat Offline
Hoopy frood

Registered: 12/12/02
Posts: 1245
Loc: California, doooood
I tested what I posted, it worked fine, I did not test what brax posted.
If you aren't sure it will work maybe you could test it and let us know what you found needed changing.

Top
#131491 - 30/09/05 10:39 PM Re: on quit text ban
Brax Offline
Vogon poet

Registered: 26/01/05
Posts: 186
Quote:
MikeChat, that might work if you change it to echo $target.


$target for Quit is Quit:

on *:text:*:#: { echo Target is $target } returns Target is #channel

on *:JOIN:#: { echo Target is $target } returns Target is #channel

on *:nick: { echo Target is $target } returns Target is NewNickname ($newnick)

on *:Quit: { echo Target is $target } returns Target is Quit:

------

While I dont say that "My way is the only way" its just the only way i found to get the result. smile

With echo -a it will echo it to just one channel (the active one)

But if you are in 5 channels and you have 3 channels common with person who quits i assume that you would like to see the quit event in all those three channels and not in one of those two channels where that person was not in. smile


Just for records code I have in my themes is:
Code:
on ^*:QUIT:{
  var %i = 1
  while ($comchan($nick, %i)) {
    echo -bfrt $v1 %p [ $+ $color(Info2) $+ Quit] $+ $color(quit) $nick ( $+ $gettok($address($nick,0),2,33) $+ ) ( $+ $1- $+ )
    inc %i
  }
  haltdef
}


Cheers.
_________________________
echo -a $signature

Top
#131492 - 03/10/05 02:26 PM Re: on quit text ban
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Hm... $target returns Quit? That's a weird thing for it to return. If you wanted the event, $event would give it to you, so why would $target give Quit as the output instead of the channel they quit from? I'm not saying it doesn't... I'm just wondering WHY it would.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#131493 - 03/10/05 03:03 PM Re: on quit text ban
Sigh Offline
Fjord artisan

Registered: 28/08/03
Posts: 314
$target returns the parameter after the command part in a rawmsg for most events:

<- :user!ident@host QUIT :Quit:

Top