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 

Store host of nicks that quit IRC for a short period
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
simo
Owner


Joined: 22 Mar 2015
Posts: 649

PostPosted: Sun Apr 04, 2021 10:55 am    Post subject: Store host of nicks that quit IRC for a short period Reply with quote

Greetingz gentz,

i noticed when abusers join and abuse and quit IRC instant after that and our chanops try to use !kb nick it obviously sets ban on nick nick!*@* rather than on their host *!*@host since chanserv cant get their host after they left IRC
i wonder if there is a way to store that in eggdrop for a short period of time like 2 min or so to use for chanops to still be able to set a ban on the abusers host
i wonder if anyone has such a code or similar already written

thanks in advance.
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 649

PostPosted: Sun Apr 04, 2021 11:10 am    Post subject: Reply with quote

i would think it starts with something like this:

Code:

bind sign - "*" store:hosts

proc store:hosts {nick host hand chan text} {
 # store $nick $host here for short period
}




bind pub -|- !kb  gethost:kickban
 
proc gethost:kickban {nick host hand chan text} {
# get the host that goes with the stored nick that quit IRC
  putserv "mode $chan +b $storedhost"
}
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 649

PostPosted: Sun Apr 04, 2021 11:46 am    Post subject: Reply with quote

this comes close:

http://forum.egghelp.org/viewtopic.php?t=20852&start=15

except instead of setting ban we like to jjust store the host for like 1 or 2 min to be used by chanops to set bans with !kb nick
and to have it search for the stored host that fits the nick and set ban on it
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 672
Location: Tennessee, USA

PostPosted: Sun Apr 04, 2021 9:38 pm    Post subject: Reply with quote

Still very crude and untested....
Code:

bind part - * store:hosts
bind sign - * store:hosts

proc store:hosts {nk uh hn ch msg} {
  set aname [string tolower $nk@$ch]
  set ::storehosts($aname) [list $uh [expr {[unixtime]+120}]]
}

bind time - * expire:hosts

proc expire:hosts {mn hr da mo yr} {
  global storehosts
  set ut [unixtime]

  foreach {aname avalue} [array get storehosts] {
    if {$ut >= [lindex $avalue 1]} { unset storehosts($aname) }
  }
}

bind pub o|o !kb pub:kickban

proc pub:kickban {nk uh hn ch tx} {
  global storehosts
  set target [lindex [split [string tolower $tx]] 0]
  set aname [string tolower $target@$ch]

  if {[onchan $target $ch]} {

    #kick and/or ban the person using info from the channel#

  } elseif {[info exists storehosts($aname)]} {
    set host [lindex [split [lindex $storehosts($aname) 0] @] 1]

    putquick "MODE $ch +b *!*@$host"

  }

}


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 649

PostPosted: Mon Apr 05, 2021 8:05 am    Post subject: Reply with quote

excellent that seems to work well SpiKe^^
i tried to use it with mass nicks for example if u like to do the same for multiple nicks in one command

i tried using it this way bit that didnt seem to do well :

Code:

proc pub:kickban {nick host hand chan text} {
  global storehosts
  set target [lindex [split [string tolower $text]] 0]
  set aname [string tolower $target@$chan]

  set users [list]
  set umasks [list]
  set reason [join [lrange [split $text "."] 1 end] "."]
  set text  [lindex [split $text "."] 0]

  if {$reason eq ""} { set reason "Please change your behaviour thank you." }

  foreach user [split [string trim $text]] {
    if {![onchan $user $chan] && ![info exists storehosts($aname)]} {
      putserv "NOTICE $nick $user :is not on channel $chan"
    } elseif  {![onchan $user $chan]  && [info exists storehosts($aname)]} {
      lappend umasks [lindex [split [lindex $storehosts($aname) 0] @] 1]
    } else {
      set chost [getchanhost $user $chan]
      lappend umasks [maskhost "$user!$chost" 2]
      if {![isatleasthalfop2017ewa $user $chan]} {  lappend users $user   }
    }
  }

  if {[info exists umasks]} { stackBans3z $chan $umasks }
  if {[info exists users]} { stackKicks $chan $users $reason }
}

Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 649

PostPosted: Mon Apr 05, 2021 8:11 am    Post subject: Reply with quote

to combine multiple kick/ban to be able to use !kb nick nick nick nick nick

for this function as well
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 649

PostPosted: Mon Apr 05, 2021 8:47 am    Post subject: Reply with quote

this is how i use my current kickban proc wich seems to work well i was hoping to integrate it to have 1 proc for kickban

Code:

proc pub:kbanx1kxZ777 {nick host hand chan text} {
  if {![isatleasthalfop2017ewa $nick $chan]} { return 0 }
   set users [list]
   set umasks [list]
                set reason [join [lrange [split $text "."] 1 end] "."]
                set text  [lindex [split $text "."] 0]
   if {$reason eq ""} { set reason "Please change your behaviour thank you." }
  foreach user [split [string trim $text]] {
            if {![onchan $user $chan]} {
         putserv "NOTICE $nick $user is not on channel $chan"
      } else {

            set chost [getchanhost $user $chan]
            if {![isatleasthalfop2017ewa $user $chan]} { lappend umasks [maskhost "$user!$chost" 2]  ; lappend users $user   }
  }
}
    if {[info exists umasks]} { stackBans3z $chan $umasks }
     if {[info exists users]} { stackKicks $chan $users $reason }
}
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 672
Location: Tennessee, USA

PostPosted: Tue Apr 06, 2021 5:50 pm    Post subject: Reply with quote

Try this out, includes !kb !k !b...
Code:

# max number of bans to stack in one mode command (1 or more) #
set pkb(maxban) 6

# max number of kicks to stack in one kick command (1 or more) #
set pkb(maxkick) 3

##############


bind pub -|- !k pub:kick
proc pub:kick {nk uh hn ch tx} {  pub:kickban $nk $uh $hn $ch $tx k  }

bind pub -|- !b pub:ban
proc pub:ban {nk uh hn ch tx} {  pub:kickban $nk $uh $hn $ch $tx b  }

bind pub -|- !kb pub:kickban
proc pub:kickban {nk uh hn ch tx {do kb} } {
  global pkb storehosts
  if {![isop $nk $ch] && ![ishalfop $nk $ch]} {  return 0  }

  set reason [join [lrange [split $tx "."] 1 end] "."]
  if {$reason eq ""} { set reason "Please change your behaviour thank you." }

  set nickls [split [string trim [string tolower [lindex [split $tx "."] 0]]]]
  set chan [string tolower $ch]

  foreach nick $nickls {
    set aname "$nick@$chan"

    if {[onchan $nick $ch]} {
      if {[string match *b* $do]} {
        set chost [getchanhost $nick $ch]
        lappend bmasks [maskhost "$nick!$chost" 2]
      }
      if {[string match *k* $do]} {
        lappend knicks $nick
      }
    } elseif {[info exists storehosts($aname)]} {
      if {[string match *b* $do]} {
        set chost [lindex [split [lindex $storehosts($aname) 0] @] 1]
        lappend bmasks [maskhost "$nick!$chost" 2]
      }
    } else {
      putserv "NOTICE $nk: $nick :is not on channel $ch"
    }
  }

  if {[info exists bmasks]} {
    while {[set len [llength $bmasks]] > 0} {
      if {$len > $pkb(maxban)} {
        set mode [string repeat "b" $pkb(maxban)]
        set masks [join [lrange $bmasks 0 [expr {$pkb(maxban) - 1}]]]
        set bmasks [lrange $bmasks $pkb(maxban) end]
      } else {
        set mode [string repeat "b" $len]
        set masks [join $bmasks]
        set bmasks ""
      }
      putquick "MODE $ch +$mode $masks"
    }
  }
  if {[info exists knicks]} {
    while {[set len [llength $knicks]] > 0} {
      if {$len > $pkb(maxkick)} {
        set nicks [join [lrange $knicks 0 [expr {$pkb(maxkick) - 1}]] ","]
        set knicks [lrange $knicks $pkb(maxkick) end]
      } else {
        set nicks [join $knicks ","]
        set knicks ""
      }
      putserv "KICK $ch $nicks :$reason"
    }
  }
}


####

bind part - * store:hosts
bind sign - * store:hosts

proc store:hosts {nk uh hn ch msg} {
  set aname [string tolower $nk@$ch]
  set ::storehosts($aname) [list $uh [expr {[unixtime]+120}]]
}

bind time - * expire:hosts

proc expire:hosts {mn hr da mo yr} {
  global storehosts
  set ut [unixtime]

  foreach {aname avalue} [array get storehosts] {
    if {$ut >= [lindex $avalue 1]} { unset storehosts($aname) }
  }
}


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 649

PostPosted: Wed Apr 07, 2021 7:04 am    Post subject: Reply with quote

ive tested your last posted code SpiKe^^
it all works except when testing the quited nicks it returns this:

Quote:

*!*@allard!All4Masti-v89.77r.138.369.IP *!*@applegate!All4Masti-29b.e9z.478.285.IP *!*@asher!All4Masti-o68.c4a.967.882.IP *!*@duarte!All4Masti-140.wso.660.492.IP *!*@gant!All4Masti-6f6.c0z.650.472.IP *!*@hollingsworth!All4Masti-f8q.t2j.564.470.IP *!*@huskey!All4Masti-3x4.6zk.328.421.IP *!*@kohn!All4Masti-bx2.t0y.861.064.IP *!*@laughlin!All4Masti-4eg.8f1.962.486.IP *!*@leslie!All4Masti-v6p.8d0.174.673.IP
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 649

PostPosted: Wed Apr 07, 2021 7:14 am    Post subject: Reply with quote

also when using !b it helps to also devoice user else the ban is not effiecient
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 649

PostPosted: Wed Apr 07, 2021 7:17 am    Post subject: Reply with quote

i noticed if the stored nicks expired and u try to call it again it sends error:

Quote:

Tcl error [pub:kickban]: can't read "nick": no such variable


instead of the :
Quote:
nick is not on channel
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 672
Location: Tennessee, USA

PostPosted: Wed Apr 07, 2021 10:58 am    Post subject: !kb !k !b script with drive-by helper Reply with quote

Try this fixed version of the script, hope it clears your issues...
Code:

# max number of bans to stack in one mode command (1 or more) #
set pkb(maxban) 6

# max number of kicks to stack in one kick command (1 or more) #
set pkb(maxkick) 3

##############


bind pub o|o !k pub:kick
proc pub:kick {nk uh hn ch tx} {  pub:kickban $nk $uh $hn $ch $tx k  }

bind pub o|o !b pub:ban
proc pub:ban {nk uh hn ch tx} {  pub:kickban $nk $uh $hn $ch $tx b  }

bind pub o|o !kb pub:kickban
proc pub:kickban {nk uh hn ch tx {do kb} } {
  global pkb storehosts
  if {![isop $nk $ch] && ![ishalfop $nk $ch]} {  return 0  }

  set reason [join [lrange [split $tx "."] 1 end] "."]
  if {$reason eq ""} { set reason "Please change your behaviour thank you." }

  set nickls [split [string trim [string tolower [lindex [split $tx "."] 0]]]]
  set chan [string tolower $ch]

  foreach nick $nickls {
    set aname "$nick@$chan"

    if {[onchan $nick $ch]} {
      if {[string match *b* $do]} {
        set chost [getchanhost $nick $ch]
        lappend bmasks [maskhost "$nick!$chost" 2]
      }
      if {[string match *k* $do]} {
        lappend knicks $nick
      }
    } elseif {[info exists storehosts($aname)]} {
      if {[string match *b* $do]} {
        set chost [lindex $storehosts($aname) 0]
        lappend bmasks [maskhost "$nick!$chost" 2]
      }
    } else {
      putserv "NOTICE $nk :$nick :is not on channel $ch"
    }
  }

  if {[info exists bmasks]} {
    while {[set len [llength $bmasks]] > 0} {
      if {$len > $pkb(maxban)} {
        set mode [string repeat "b" $pkb(maxban)]
        set masks [join [lrange $bmasks 0 [expr {$pkb(maxban) - 1}]]]
        set bmasks [lrange $bmasks $pkb(maxban) end]
      } else {
        set mode [string repeat "b" $len]
        set masks [join $bmasks]
        set bmasks ""
      }
      putquick "MODE $ch +$mode $masks"
    }
  }
  if {[info exists knicks]} {
    while {[set len [llength $knicks]] > 0} {
      if {$len > $pkb(maxkick)} {
        set nicks [join [lrange $knicks 0 [expr {$pkb(maxkick) - 1}]] ","]
        set knicks [lrange $knicks $pkb(maxkick) end]
      } else {
        set nicks [join $knicks ","]
        set knicks ""
      }
      putserv "KICK $ch $nicks :$reason"
    }
  }
}


####

bind part - * store:hosts
bind sign - * store:hosts

proc store:hosts {nk uh hn ch msg} {
  set aname [string tolower $nk@$ch]
  set ::storehosts($aname) [list $uh [expr {[unixtime]+120}]]
}

bind time - * expire:hosts

proc expire:hosts {mn hr da mo yr} {
  global storehosts
  set ut [unixtime]

  foreach {aname avalue} [array get storehosts] {
    if {$ut >= [lindex $avalue 1]} { unset storehosts($aname) }
  }
}


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 649

PostPosted: Wed Apr 07, 2021 11:00 am    Post subject: Reply with quote

thanks SpiKe^^ works fine now nice job on the code once again much apreciated i believe this one will benefit many
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 649

PostPosted: Wed Apr 07, 2021 11:49 am    Post subject: Reply with quote

this is my version where i added !m to set mutebans ~q
and also if muteban is used or just ban it checks for voice and removes as well it also checks for chan(half)ops and for flag o to exempt



Code:

# max number of bans to stack in one mode command (1 or more) #
set pkb(maxban) 6

# max number of kicks to stack in one kick command (1 or more) #
set pkb(maxkick) 4

##############


bind pub -|- !k pub:kick
proc pub:kick {nk uh hn ch tx} {  pub:kickban $nk $uh $hn $ch $tx k  }

bind pub -|- !b pub:ban
proc pub:ban {nk uh hn ch tx} {  pub:kickban $nk $uh $hn $ch $tx b  }

bind pub -|- !m pub:muteban
proc pub:muteban {nk uh hn ch tx} {  pub:kickban $nk $uh $hn $ch $tx m  }

bind pub -|- !kb pub:kickban
proc pub:kickban {nk uh hn ch tx {do kb} } {
 global pkb storehosts
 
  if {![isop $nk $ch] && ![ishalfop $nk $ch] && ![matchattr [nick2hand $nk] o|o $ch]} { return 0 }

  set reason [join [lrange [split $tx "."] 1 end] "."]
  if {$reason eq ""} { set reason "Please change your behaviour thank you." }

  set nickls [split [string trim [string tolower [lindex [split $tx "."] 0]]]]
  set chan [string tolower $ch]

  foreach nick $nickls {
    set aname "$nick@$chan"

    if {[onchan $nick $ch]} {
      if {[string match *b* $do]} {
        if {![isop $nick $ch] && ![ishalfop $nick $ch] &&  [isvoice $nick $ch] && ![matchattr [nick2hand $nick] o|o $ch]} {  lappend users $nick }
        set chost [getchanhost $nick $ch]
         if {![isop $nick $ch] && ![ishalfop $nick $ch] &&  ![matchattr [nick2hand $nick] o|o $ch]} { lappend bmasks [maskhost "$nick!$chost" 2] }
      }
      if {[string match *m* $do]} {
        if {![isop $nick $ch] && ![ishalfop $nick $ch] &&  [isvoice $nick $ch] && ![matchattr [nick2hand $nick] o|o $ch]} {  lappend users $nick }
         set chost [getchanhost $nick $ch]
         if {![isop $nick $ch] && ![ishalfop $nick $ch] &&  ![matchattr [nick2hand $nick] o|o $ch]} { lappend bmasks ~q:[maskhost "$nick!$chost" 2] }
      }
      if {[string match *k* $do]} {
        lappend knicks $nick
      }
    } elseif {[info exists storehosts($aname)]} {
      if {[string match *b* $do]} {
        set chost [lindex $storehosts($aname) 0]
       lappend bmasks [maskhost "$nick!$chost" 2]
      }
    } else {
      putserv "NOTICE $nk  $nick :is not on channel $ch"
    }
  }
     if {[info exists users]} {  stackdevoice $chan $users  }

  if {[info exists bmasks]} {
    while {[set len [llength $bmasks]] > 0} {
      if {$len > $pkb(maxban)} {
        set mode [string repeat "b" $pkb(maxban)]
        set masks [join [lrange $bmasks 0 [expr {$pkb(maxban) - 1}]]]
        set bmasks [lrange $bmasks $pkb(maxban) end]
      } else {
        set mode [string repeat "b" $len]
        set masks [join $bmasks]
        set bmasks ""
      }
      putquick "MODE $ch +$mode $masks"
    }
  }
  if {[info exists knicks]} {
    while {[set len [llength $knicks]] > 0} {
      if {$len > $pkb(maxkick)} {
        set nicks [join [lrange $knicks 0 [expr {$pkb(maxkick) - 1}]] ","]
        set knicks [lrange $knicks $pkb(maxkick) end]
      } else {
        set nicks [join $knicks ","]
        set knicks ""
      }
      putserv "KICK $ch $nicks :$reason"
    }
  }
}


proc stackdevoice {chan banlist {max 6}} {
      set count [llength $banlist]
      while {$count > 0} {
         if {$count> $max} {
            set mode [string repeat "v" $max]
            set masks [join [lrange $banlist 0 [expr {$max - 1}]]]
            set banlist [lrange $banlist $max end]
            incr count -$max
            incr total $max
         } else {
            set mode [string repeat "v" $count]
            set masks [join $banlist]
            incr total $count
            set count 0
         }
         putquick "MODE $chan -$mode $masks"
      }
   }




####

bind part - * store:hosts
bind sign - * store:hosts

proc store:hosts {nk uh hn ch msg} {
  set aname [string tolower $nk@$ch]
  set ::storehosts($aname) [list $uh [expr {[unixtime]+120}]]
}

bind time - * expire:hosts

proc expire:hosts {mn hr da mo yr} {
  global storehosts
  set ut [unixtime]

  foreach {aname avalue} [array get storehosts] {
    if {$ut >= [lindex $avalue 1]} { unset storehosts($aname) }
  }
}

Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 672
Location: Tennessee, USA

PostPosted: Wed Apr 07, 2021 7:06 pm    Post subject: !kb !k !b !m script with drive-by helper & protected use Reply with quote

This should be a cleaned up version of the script with all current options and commands...
Code:

# max number of bans/devoice to stack in one mode command (1 or more) #
set pkb(maxban) 6

# max number of kicks to stack in one kick command (1 or more) #
set pkb(maxkick) 3

##############


bind pub -|- !k pub:kick
proc pub:kick {nk uh hn ch tx} {  pub:kickban $nk $uh $hn $ch $tx k  }

bind pub -|- !b pub:ban
proc pub:ban {nk uh hn ch tx} {  pub:kickban $nk $uh $hn $ch $tx b  }

bind pub -|- !m pub:muteban
proc pub:muteban {nk uh hn ch tx} {  pub:kickban $nk $uh $hn $ch $tx m  }

bind pub -|- !kb pub:kickban
proc pub:kickban {nk uh hn ch tx {do kb} } {
  global pkb storehosts
  if {![isop $nk $ch] && ![ishalfop $nk $ch] && ![matchattr $hn o|o $ch]} {
    return 0
  }

  set reason [join [lrange [split $tx "."] 1 end] "."]
  if {$reason eq ""} { set reason "Please change your behaviour thank you." }

  set nickls [split [string trim [string tolower [lindex [split $tx "."] 0]]]]
  set chan [string tolower $ch]

  foreach nick $nickls {
    set aname "$nick@$chan"

    if {[onchan $nick $ch]} {
      if {[isop $nick $ch] || [ishalfop $nick $ch]} { continue }
      if {[matchattr [nick2hand $nick] o|o $ch]} { continue }

      if {[string match *b* $do]} {
        set chost [getchanhost $nick $ch]
        lappend bmasks [maskhost "$nick!$chost" 2]
        if {[isvoice $nick $ch] && ![string match *k* $do]} {
          lappend dvnicks $nick
        }
      }
      if {[string match *m* $do]} {
        set chost [getchanhost $nick $ch]
        lappend bmasks ~q:[maskhost "$nick!$chost" 2]
        if {[isvoice $nick $ch]} {  lappend dvnicks $nick  }
      }
      if {[string match *k* $do]} {
        lappend knicks $nick
      }

    } elseif {[info exists storehosts($aname)]} {
      if {[matchattr [lindex $storehosts($aname) 2] o|o $ch]} { continue }

      if {[string match *b* $do]} {
        set chost [lindex $storehosts($aname) 0]
        lappend bmasks [maskhost "$nick!$chost" 2]
      }
      if {[string match *m* $do]} {
        set chost [lindex $storehosts($aname) 0]
        lappend bmasks ~q:[maskhost "$nick!$chost" 2]
      }

    } else {
      putserv "NOTICE $nk :$nick :is not on channel $ch"
    }
  }

  if {[info exists dvnicks]} {
    while {[set len [llength $dvnicks]] > 0} {
      if {$len > $pkb(maxban)} {
        set mode [string repeat "v" $pkb(maxban)]
        set nicks [join [lrange $dvnicks 0 [expr {$pkb(maxban) - 1}]]]
        set dvnicks [lrange $dvnicks $pkb(maxban) end]
      } else {
        set mode [string repeat "v" $len]
        set nicks [join $dvnicks]
        set dvnicks ""
      }
      putquick "MODE $ch -$mode $nicks"
    }
  }
  if {[info exists bmasks]} {
    while {[set len [llength $bmasks]] > 0} {
      if {$len > $pkb(maxban)} {
        set mode [string repeat "b" $pkb(maxban)]
        set masks [join [lrange $bmasks 0 [expr {$pkb(maxban) - 1}]]]
        set bmasks [lrange $bmasks $pkb(maxban) end]
      } else {
        set mode [string repeat "b" $len]
        set masks [join $bmasks]
        set bmasks ""
      }
      putquick "MODE $ch +$mode $masks"
    }
  }
  if {[info exists knicks]} {
    while {[set len [llength $knicks]] > 0} {
      if {$len > $pkb(maxkick)} {
        set nicks [join [lrange $knicks 0 [expr {$pkb(maxkick) - 1}]] ","]
        set knicks [lrange $knicks $pkb(maxkick) end]
      } else {
        set nicks [join $knicks ","]
        set knicks ""
      }
      putserv "KICK $ch $nicks :$reason"
    }
  }
}


####

bind part - * store:hosts
bind sign - * store:hosts

proc store:hosts {nk uh hn ch msg} {
  set aname [string tolower $nk@$ch]
  set ::storehosts($aname) [list $uh [expr {[unixtime]+120}] $hn]
}

bind time - * expire:hosts

proc expire:hosts {mn hr da mo yr} {
  global storehosts
  set ut [unixtime]

  foreach {aname avalue} [array get storehosts] {
    if {$ut >= [lindex $avalue 1]} { unset storehosts($aname) }
  }
}


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
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 Requests All times are GMT - 4 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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