egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

autorejoin script problem.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
darkwingduck
Voice


Joined: 16 Jun 2007
Posts: 5

PostPosted: Tue Jun 19, 2007 5:11 pm    Post subject: autorejoin script problem. Reply with quote

hello,
i use this script but the script works only with global flags for this option:
# do not ban users with this flag on the bot

i need global or channel flags.
I have test it with
set dontban "Z|Z"

but this dont work Sad

can everyone help me?

Code:

# This script bans users which joins a given channel within 5 seconds
# after getting kicked, for 5 minutes. Made for eggdrop v1.1
#
# V1.1c, written by Anders Nordby aka. nickerne (anders@fix.no)
#
# 1.0a: Small bugfix.
# 1.0b: Included flag-based exception from banning.
# 1.0c: Registering channel-bans was a stupid thing. Speeded things up a
#       little. Also made the flag-based ban-exception host specific (instead
#       of nick specific). And some other changes, like the nick/host flag.
# 1.1:  Several fixes:
#
#       * maximum one kick for autorejoining, if the ban fails.
#       * fixed bug with 10 characters in the username (ban failed)
#       * added multichannel option
#       * bans with the same hostname won't be cleared more than once
# 1.1b: Users with the dontban-flag on the bot got kicked if they had the
#       wrong nick. Fixed.
# 1.1c: Fixed problems with people using nicks having troublesome characters.

# delay before users can join the channel after a kick (in seconds)
set joindelay 5
# the bans will be removed after this delay (in minutes)
set bantime 3
# 0=work on one channel only, 1=multichannel (overrides channel-setting)
set multichannel 1
# the channel you wish this script to work on
set channel ""
# do not ban users with this flag on the bot
set dontban "Z"
# 1=nick&host-specific bans, 0=host-specific bans
set nickban 1

bind kick - * autorejoin_ban
# bind join - * autorejoin_ban
proc autorejoin_ban {nick uhost hand chan knick reason} {
    global joindelay channel multichannel

    if {![expr [lsearch -glob [utimers] "*nada $knick $chan*"] + 1]} {
       if {$multichannel} {
     utimer $joindelay [subst {kickban_when_autorejoined $knick $chan}]
       } else {
     if {$chan == $channel} {
        utimer $joindelay [subst {kickban_when_autorejoined {$knick} $chan}]
     }
       }
    }
}

proc kickban_when_autorejoined {nick chan} {
    global bantime dontban nickban joindelay



    if {[onchan $nick $chan]} {
   if {[matchattr [nick2hand $nick $chan] $dontban]} {
#   putserv "PRIVMSG $chan :$nick will not be banned, of course, as he has +$dontban."
   } else {

# hostmasking:
       append userhost $nick "!" [getchanhost $nick $chan]
       set hostmask [maskhost $userhost]
       if {[string first @ $hostmask]<12} {
      set hostmask "*!*[string range $hostmask 2 [string length $hostmask]]"
       }

# insert nick for nickban:
       if {$nickban} { set hostmask "*$nick$hostmask"}

# performance:
       putserv "MODE $chan +b $hostmask"
       utimer [expr 3 * $joindelay] [subst {nada $nick $chan}]
            putserv "KICK $chan $nick :You autorejoined after getting kicked. Not that smart indeed."

if {![expr [lsearch -glob [utimers] "*MODE $chan -b $hostmask*"] + 1]} {
    utimer [expr 60 * $bantime] [subst {putserv "MODE $chan -b $hostmask"}]
}

       putserv "notice $nick :Somebody kicked you, and you autorejoined. $bantime minutes in the corner! Turn off autorejoin!"
   }
    }
}

proc nada {nick chan} { }

putlog "NO! autorejoin v1.1c by nickerne"
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Wed Jun 20, 2007 9:35 am    Post subject: Reply with quote

Replace
Code:
if {[matchattr [nick2hand $nick $chan] $dontban]} {

with
Code:
if {[matchattr [nick2hand $nick $chan] $dontban $chan]} {

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber