mIRC Home    About    Download    Register    News    Help

Print Thread
#141451 09/02/06 11:12 PM
Joined: Jan 2005
Posts: 25
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Jan 2005
Posts: 25
What I am trying to do is set up some sort of script that checks a person who joins, and if they are in a certain channel, gets rid of them

#141452 09/02/06 11:33 PM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Try this:
Code:
on @*:JOIN:#yourchan:{
  .enable #whoisscan
  whois $nick
}
#whoisscan off
raw 319:*:if (($2 ison #yourchan) && (#badchan isin $3-)) ban -ku300 #yourchan $2 1 You are banned
raw 311:*:haltdef
raw 307:*:haltdef
raw 312:*:haltdef
raw 313:*:haltdef
raw 310:*:haltdef
raw 320:*:haltdef
raw 318:*:{ .disable #whoisscan | haltdef }
#whoisscan end


Change all instances of #yourchan to the name of your channel, and change #badchan to the channel that the person isn't allowed to be on.

If a person is on #badchan and they join #yourchan, they will be kickbanned for 5 mins. You/your bot must be op'd on #yourchan for this to work.

-genius_at_work

#141453 10/02/06 01:54 AM
Joined: Jan 2005
Posts: 25
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Jan 2005
Posts: 25
Code:
on @*:JOIN:#yourchan:{
  .enable #whoisscan
  whois $nick
}
#whoisscan off
raw 319:*:if (($2 ison #yourchan) && (#badchan isin $3-) && ($nick !isop #yourchan)) ban -ku300 #yourchan $2 1 You are banned
raw 311:*:haltdef
raw 307:*:haltdef
raw 312:*:haltdef
raw 313:*:haltdef
raw 310:*:haltdef
raw 320:*:haltdef
raw 318:*:{ .disable #whoisscan | haltdef }
#whoisscan end  


Would that be an appropriate change to prevent ops from being kicked?

Also, what would be the best method for creating a 'bad channel' list as it were, simply just use a variable instead of a specific channel?

e.g. %bad.chan instead of #badchan ?

#141454 10/02/06 02:32 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Preventing ops from being kicked would probably require a timer. Immediately after any user joins your channel, they are NOT an op. The reply from the /whois will probably be so quick that the person still won't be op'd by chanserv or another op.

To have multiple channels in a "bad list" there would have to be a loop to check a variable/file/etc.

Try this:
Code:
; Bad Channel list: comma separated list of channels
alias -l badchans return #badchan1,#badchan2,#badchan3
;
alias isonbadchan {
  var %c = 0, %cc = $numtok($badchans,44)
  while (%c < %cc) {
    inc %c
    if ($wildtok($1-,* $+ $gettok($badchans,%c,44),0,32)) return 1
  }
  return 0
}
alias -l badchankick if ($1 !isop #yourchan) ban -ku300 #yourchan $2 1 You are banned
on @*:JOIN:#yourchan:{
  .enable #whoisscan
  whois $nick
}
#whoisscan off
raw 319:*:if (($2 ison #yourchan) && ($isonbadchan($3-))) .timer 1 5 badchankick $2
raw 311:*:haltdef
raw 307:*:haltdef
raw 312:*:haltdef
raw 313:*:haltdef
raw 310:*:haltdef
raw 320:*:haltdef
raw 318:*:{ .disable #whoisscan | haltdef }
#whoisscan end


*Note: code is untested

Change the #yourchan 's to the name of your channel. On the second line of the script, you add the bad channels to the list as shown, separated by a comma. The bad channels list is tested using a *wildcard, so if you put "badchan" into the list, it will match #badchan #thisisabadchan #iamonabadchan, etc..

-genius_at_work

#141455 12/02/06 09:10 PM
Joined: Jan 2005
Posts: 25
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Jan 2005
Posts: 25
hmmmm...the list one didn't work

you think an $hfind would work better? Also, how would I do it if I wanted to display the dissallowed channel said person is in in the kick message?


Link Copied to Clipboard