mIRC Home    About    Download    Register    News    Help

Print Thread
#131483 30/09/05 11:45 AM
Joined: Apr 2004
Posts: 18
M
McFish Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Apr 2004
Posts: 18
I need script to ban texts on Quits please

something like :

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

#131484 30/09/05 01:40 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
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
#131485 30/09/05 02:50 PM
Joined: Jan 2005
Posts: 192
Vogon poet
Offline
Vogon poet
Joined: Jan 2005
Posts: 192
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
#131486 30/09/05 05:16 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
#131487 30/09/05 05:30 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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

#131488 30/09/05 06:07 PM
Joined: Jan 2005
Posts: 192
Vogon poet
Offline
Vogon poet
Joined: Jan 2005
Posts: 192
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
#131489 30/09/05 07:55 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
#131490 30/09/05 08:18 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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.

#131491 30/09/05 09:39 PM
Joined: Jan 2005
Posts: 192
Vogon poet
Offline
Vogon poet
Joined: Jan 2005
Posts: 192
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
#131492 03/10/05 01:26 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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
#131493 03/10/05 02:03 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
$target returns the parameter after the command part in a rawmsg for most events:

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


Link Copied to Clipboard