mIRC Homepage
Posted By: christiansen autovoice and autokick? - 23/04/03 12:42 PM
Hey,

are there any autovoice-scripts or information available where I can get one and how they work?

And I also need sth like a autokick-script, however you call it smile

e.g.
Someone whos on a "forbidden channel" (Gay, Teen ect.) should be kicked automatically if he attempts
to enter my channel, best with a kick-msg like "Your stay at #XXX is not tolerated here" or something like that...

I would be delighted to if someone could help me...thanks!

greets
Thomas Christiansen

Posted By: theRat Re: autovoice and autokick? - 23/04/03 12:57 PM
1) /help autovoice-list

2) For the autokick thing you'd have to whois every user joining your channel, to get the list of the channels they're on(/help on join), then capture the raw event and look for not wanted channels(/help raw events), but if many ppl joins your channel you get flooded off.
Posted By: FunChatter Re: autovoice and autokick? - 23/04/03 04:29 PM
1)For an autovoice script you can either do what theRat told
you either make one yourself...

You will need:
/help on join
/help levels
you must know how to set a mode...right? mode # +v $nick

2) For the Ban channels kicker you asked check out this...

Hope you found what you needed. smile
Posted By: Jesper Re: autovoice and autokick? - 23/04/03 06:01 PM
Auto voice is easy, use search next time wink

Code:
on 1:JOIN:#:{
  if ($me isop #) {
    if (%Voice.Count == $null) { inc %Voice.Count 1 | mode # +v $nick }
    if (%Voice.Count < 5) { inc %Voice.Count 1 | mode # +v $nick }
    set -u5 %Voice.Count %Voice.Count
  }
} 
Tested and works!Replace "if ($me isop #) {" with " if ($me isop #your channel) {"

Autokick: first you need to create an badnicks.ini file, like this:
filename=badnicks.ini
line 1 = [kicknick]
line 2 = whore
line3 = gayman
line4 = etc etc
(this will only work this way)
Code:
on 1:JOIN:#:{
  if ($me isop #) {
    if ($nick isin $readini(badnicks.ini,kicknick) { ban #channel $nick | kick #channel $nick [reason] }
  } 
} 
should work, if $nick event works here.
Combined:
Code:
on 1:JOIN:#:{
  if ($me isop #) {
    if (%Voice.Count == $null) { inc %Voice.Count 1 | mode # +v $nick }
    if (%Voice.Count < 5) { inc %Voice.Count 1 | mode # +v $nick }
    set -u5 %Voice.Count %Voice.Count
    if ($nick isin $readini(badnicks,kicknick) { ban #channel $nick | kick #channel $nick [reason]  }
  }
}
Posted By: _D3m0n_ Re: autovoice and autokick? - 23/04/03 07:07 PM
no reason to set it up where u have to replace all the # with the real channel name ..... just change them all to $chan as the events they trigger under recognize $chan as #channame
Posted By: Nimue Re: autovoice and autokick? - 23/04/03 07:17 PM
No need to do that either, # works the same as $chan. smile
Posted By: KingTomato Re: autovoice and autokick? - 23/04/03 07:18 PM
aaaand @<level>:<event> works the same as if ($me isop $chan) { >:D
Posted By: Nimue Re: autovoice and autokick? - 23/04/03 07:24 PM
Yes I am aware of that. crazy
Posted By: _D3m0n_ Re: autovoice and autokick? - 23/04/03 07:26 PM
true on both accounts ..... just had me wondering tho why someone would instruct someone to change something that really doesnt need changing ..... maybe they would tell someone this with adding the fact the if u only want it to work in one specific channel change # to that channel name..... just hoping that was thier intent and they didnt want to confuse an admitted newbie to scripting
Posted By: gerdigos Re: autovoice and autokick? - 23/04/03 09:03 PM
Jesper, your code won't work, as you don't have the right format for $readini. Here is a bad channel scanner:
Code:
 
on *:JOIN:#: { 
  if ($me isop #) { 
    var %a = 1
    while ($nick ison $readini(badchans.ini,chans,%a)) { 
      mode # +b $address($nick,2)
      kick # $nick $readini(badchans.ini,chans,kickmsg)
      if (!$readini(badchans.ini,chans,%a)) { return } 
      inc %a
    }
  }
}

Alternate the .ini and kickmsg accordingly. The blacklisted chans sould be added in numbers:
e.g.: (This is correct)
5=#blah
6=#blahblah
7=#blahblahblah
(This is wrong)
5=#blah
125=#blahblah
694345674632456=#blahblahblah

Hope i helped you out. Nice idea btw, although it might seem kind of including racism. smirk
Posted By: Nimue Re: autovoice and autokick? - 23/04/03 09:37 PM
Well, as you say, that is a BAD channel scanner, though not in the way you meant bad. :tongue:

1. That would require you to be on every channel listed as bad, or you won't know "if ($nick ison <it>)". ("while" is an "if" statement)

2. It also will attempt to ban & kick $nick once for every "bad" channel they are on. Kicking a user more than once will cause errors.

3. $readini is slow, suppose after a netsplit, when 20 users re-join, and there were 10 channels listed as "bad". The script does $readini() 10 times for each nick, 20 x 10 = 200 $readini's. Even worse, it also checks the next channel before returning to the while condition. That makes a total of 20 x 20 x $readini frown

+++++++++
Personal opinion: If you don't like seeing that other users are on certain channels, don't look at the channels they are on. It isn't like you have to avoid this info, it is NOT shown to you by default, you have to actually seek it out.
Posted By: christiansen Re: autovoice and autokick? - 23/04/03 10:26 PM
Thanks for your help, guys!!

Most appreciated! smile

greets!

Posted By: Nimue Re: autovoice and autokick? - 25/04/03 02:27 AM
Looking back on this post, it could be taken as an outright putdown of your scripting, but it wasn't meant that way. I was originally going to offer some ways around the things I pointed out, but then I decided that would be hypocritical considering my views on "bad channel kicks", so I left them out. Without them the post looks a bit nasty, please take it as pointing out where you might have done better, rather than however it may look. smile
© mIRC Discussion Forums