This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Ban every one that has noidentd tcl help

Help for those learning Tcl or writing their own scripts.
Post Reply
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Ban every one that has noidentd tcl help

Post by sdays »

This dose nothing i want it to ban every one that has no ident, can some one help thx.

Code: Select all

set yourchan "#channel"
bind join - * badident

proc badident {nick uhost hand chan} {
  if {![isbotnick $nick] && [botisop $chan]} {
    if {"$uhost" == "*!*~*@*"} { 
      putserv "MODE $yourchan +b $uhost"
      putserv "KICK $yourchan $nick :Sorry but you have no identd. Ident must be enabled to join, try opening port 113 on your router to your PC and reconnect to a server!"
    }
  }
}
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

use string match instead.

Code: Select all

if {[string match ~*@* $uhost]} {
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Post by sdays »

Ok that worked, Hmm when some one joins another channel it bans them in the channel i have the script on.

Code: Select all

set yourchan "#channel"
set noflagban "fmo|omf"
setudef int banid
set tempban 10
bind join - $yourchan* badident

proc badident {nick uhost hand chan} {
  global yourchan noflagban tempban
  if {([botisop $chan]) && (![isop $nick $chan]) && (![isvoice $nick $chan]) && (![matchattr $hand $noflagban $chan]) && ([onchan $nick $chan])} {
    set count "[expr [channel get $chan banid] + 1]"
    channel set $chan banid "$count"
    if {[string match ~*@* $uhost]} {
      putserv "MODE $yourchan +b $uhost"
      putserv "KICK $yourchan $nick :Put kick msg here $count"
      timer $tempban [putserv {MODE $yourchan -b $uhost}]
    }
  }
}
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Try this:
Usage:
To enable: type .chanset #yourchan +noidentd in the partyline
To disable: type .chanset #yourchan -noidentd in the partyline

Code: Select all

set noidentd(excempt) "fmo|omf"
set noidentd(bantime) "30"; # Bantime in seconds
set noidentd(kickmsg) "You need identd enabled to join this channel - Count: :count:"
setudef flag noidentd
setudef int noidentd_id

bind join -|- {*} noidentd:join

proc noidentd:join {nick host hand chan} {
  global noidentd
  if {![channel get $chan noidentd]} { return }
  if {![botisop $chan] && [matchattr $hand $noidentd(excempt) $chan] && [isop $nick $chan] && [isvoice $nick $chan]} { return }
  channel set $chan noidentd_id "[set count [expr [channel get $chan noidentd_id] + 1]]"
  regsub -all :count: $noidentd(kickmsg) $count reason
  putserv "MODE $chan +b $host"
  putserv "KICK $chan $nick :$reason"
  utimer $noidentd(bantime) [list pushmode $chan -b $host]
}
r0t3n @ #r0t3n @ Quakenet
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Looks like tosser still doesn't exactly know what he's doing.

Code: Select all

set noident(exempt)  "fmo|omf"
set noident(bantime) 10; # Ban time in minutes. (I see no reason to ban for mere seconds)
set noident(kickmsg) "You need identd enabled to join this channel."
# I don't see the point in some lame counter so let's not include it.

setudef flag noident

bind join -|- * noident:join

proc noident:join {nick host hand chan} {
  global noident
  if {![botisop $chan] || ![channel get $channel noident] || [matchattr $hand $noident($exempt) $chan] || ![string match ~*@* $host]} { return 0 }
  putserv "MODE $chan +b [set host *![string map [list "~" "*"] $host]]"
  putserv "KICK $chan $nick :$noident(kickmsg)"
  timer $noidentd(bantime) [list pushmode $chan -b $host]
}
Also, You would find that tossers code would not have worked very well as he doesn't even check the ident.

Enable it with .chanset #channel +noident.

It should work exactly as wanted :)
s
sdays
Halfop
Posts: 98
Joined: Sat Oct 21, 2006 4:46 am

Post by sdays »

hmm i tryed editing the bot bans the ops friends etc none of them codes works...
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

You need to restart the bot.
Post Reply