Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # --------------------------------------------------------------------
- # Commands
- # --------------------------------------------------------------------
- # Support Commands:
- # --> .next [x] = voices next (x) user(s) in list
- # --> .done <nick> = removes voice from <nick>
- # --> .list = notices you the list
- # --> .noidle <nick> = kickbans <nick> for idling
- # --> .clearlist = clear the list
- # --> .getlist = rebuild the list with non opped/voiced users
- # Admin Commands:
- # --> .on = turn script on
- # --> .off = turn script off
- # --------------------------------------------------------------------
- # VARIABLES
- # you have to change these
- # --------------------------------------------------------------------
- # The channel you will use this:
- set next(chan) "#bf-support"
- # the char that marks public commands (.next, etc...)
- set next(char) "!"
- # topics ... k you can add as many topics as you want, just call the others next(topic3) next(topic4) ...
- # note: be carefull with special signs like [ ] " & ...
- #set next(topic1) "14.::[ 4Willkommen im #BF-support Channel 14|| 4Wartet auf Voice! Auch wenn es mal länger dauert 14|| 4Kein idlen! 14|| 4Keine ungefragten Querys!14 || 4Nennt uns zuerst euren Trackernick! 14] 8>> 12Ein gebannter Account wegen Cheatens ist unwiderruflich deaktiviert 8<<10"
- #set next(topic2) "14.::[ 4Willkommen im #BF-support Channel 14|| 4Wartet auf Voice! Auch wenn es mal länger dauert 14|| 4Kein idlen! 14|| 4Keine ungefragten Querys!14 || 4Nennt uns zuerst euren Trackernick! 14] 8>> 12Ein gebannter Account wegen Cheatens ist unwiderruflich deaktiviert 8<<10"
- # noidle ban type: (code based on on Moretools.tcl by MC_8)
- # 0 = *!user@host.domain
- # 1 = *!*user@host.domain
- # 2 = *!*@host.domain
- # 3 = *!*user@*.domain
- # 4 = *!*@*.domain
- # 5 = nick!user@host.domain
- # 6 = nick!*user@host.domain
- # 7 = nick!*@host.domain
- # 8 = nick!*user@*.domain
- # 9 = nick!*@*.domain
- # 10 = regular eggdrop mask
- set next(bantype) "1"
- # noidle kick message
- set next(noidle) "10Dies ist ein Support-Channel... 4DON'T IDLE!!!"
- # noidle bantime
- set next(bantime) "1"
- # automatic rebuild the voice list with the non opped/voiced
- # users on the channel after a rehash? (1/0)
- set next(rehash) "1"
- # --------------------------------------------------------------------
- # MAGIC BORDER
- # Don't cross this line unless you feel prepared to code
- # --------------------------------------------------------------------
- set next(list) {}
- set next(chan) [string tolower $next(chan)]
- set next(version) "v2.2"
- set next(status) "on"
- set next(num2name) "none Trainee {Regular Helper} {Channel Op} Admin Owner"
- # --------------------------------------------------------------------
- # mode handlers
- # --------------------------------------------------------------------
- #### join / rejoin
- proc next.add {nick uhost handle chan} {
- global botnick next
- if {$nick == $botnick || [string tolower $chan] != $next(chan) || [matchattr $handle g|g $next(chan)]} { return }
- lappend next(list) $nick
- set num [lsearch -exact $next(list) $nick]
- incr num
- putserv "NOTICE $nick :4Bitte warte bis du an der Reihe bist. Du bist Nummer 12$num 4in der Warteliste... Danke!"
- }
- #### part & sign
- proc next.purge {nick uhost handle chan msg} {
- global botnick next
- if {$nick == $botnick || [string tolower $chan] != $next(chan) || [matchattr $handle g|g $next(chan)]} { return }
- set index [lsearch -exact $next(list) $nick]
- if {$index >= 0} {
- set next(list) [lreplace $next(list) $index $index ]
- } else { return }
- }
- #### nick
- proc next.replace {nick uhost handle chan newnick} {
- global botnick next
- if {$nick == $botnick || [string tolower $chan] != $next(chan) || [matchattr $handle g|g $next(chan)]} { return }
- set index [lsearch -exact $next(list) $nick]
- if {$index >= 0} {
- set next(list) [lreplace $next(list) $index $index $newnick]
- } else { return }
- }
- #### kick
- proc next.kick {nick uhost handle chan vict reason} {
- global botnick next
- if {$vict == $botnick || [string tolower $chan] != $next(chan) || [matchattr [nick2hand $vict $next(chan)] g|g $next(chan)]} { return }
- set index [lsearch -exact $next(list) $vict]
- set next(list) [lreplace $next(list) $index $index ]
- }
- #### split
- proc next.splt {nick uhost handle chan} {
- global botnick next
- if {$nick == $botnick || [string tolower $chan] != $next(chan) || [matchattr $handle g|g $next(chan)]} { return }
- set index [lsearch -exact $next(list) $nick]
- set next(list) [lreplace $next(list) $index $index ]
- }
- #### voiced / opped
- proc next.voiced {nick host hand chan mdechg dnick} {
- global botnick next
- if {[string tolower $chan] == $next(chan) && $dnick != $botnick} {
- set index [lsearch -exact $next(list) $dnick]
- set next(list) [lreplace $next(list) $index $index ]
- } else { return }
- }
- #### rehash
- proc next.rehash {type} {
- global botnick next
- if {$next(rehash) && [botonchan $next(chan)]} {
- set llength [llength $next(list)]
- foreach user [chanlist $next(chan)] {
- if {![isvoice $user $next(chan)] && ![isop $user $next(chan)] && [onchan $user $next(chan)] && $user != $botnick && ![matchattr [nick2hand $user $next(chan)] g $next(chan)]} {
- set index [lsearch -exact $next(list) [lindex $user 0]]
- if {$index < 0} {
- set next(list) [linsert $next(list) $llength $user ]
- }
- }
- }
- }
- }
- # --------------------------------------------------------------------
- # Regular command handlers
- # --------------------------------------------------------------------
- #### next
- proc next.pub:voice {nick uhost handle chan arg} {
- global next
- if {[string tolower $chan] != $next(chan)} { return 0 } {
- if {$next(list) == ""} { putserv "NOTICE $nick :List is empty." ; return }
- if {[botisop $chan]} {
- set num [lindex [split $arg] 0]
- if {$num != "" && [string is integer $num]} {
- for { set i 0 } { $i < $num } { incr i } {
- if {$next(list) == ""} { break }
- set voice [lindex $next(list) 0]
- putserv "MODE $chan +v $voice"
- set index [lsearch -exact $next(list) $voice]
- set next(list) [lreplace $next(list) $index $index ]
- putserv "NOTICE $voice :So, du bist der nächste im $next(chan) , bitte stelle jetzt deine Frage!"
- }
- } else {
- set voice [lindex $next(list) 0]
- putserv "MODE $chan +v $voice"
- set index [lsearch -exact $next(list) $voice]
- set next(list) [lreplace $next(list) $index $index ]
- putserv "PRIVMSG $chan :$voice: 12Stelle deine Frage bitte jetzt... 10Dir wird geholfen von: 4$nick"
- }
- return }
- putserv "NOTICE $nick :I can't do my job cos I'm not oped on $chan."
- return
- }
- }
- #### done
- proc next.pub:done {nick uhost handle chan arg} {
- global botnick next
- if {[string tolower $chan] != $next(chan)} { return 0 } {
- if {[botisop $chan] && [isvoice [lindex [split $arg] 0] $chan]} {
- putserv "MODE $chan -v :[lindex [split $arg] 0]"
- putserv "PRIVMSG $chan [lindex [split $arg] 0]10 dein Support ist nun beendet... Bitte verlasse jetzt diesen Channel 10- 4don't idle!"
- return }
- }
- }
- #### noidle ####
- proc next.pub:noidle {nick uhost handle chan arg} {
- global botnick botname next
- if {[string tolower $chan] != $next(chan)} { return 0 } {
- if {[lindex [split $arg] 0] == ""} {putserv "NOTICE $nick :Usage: !noidle <nick>"
- return}
- if {[onchan [lindex [split $arg] 0] $next(chan)]} {set index [lsearch -exact $next(list) [lindex [split $arg] 0]]
- if {$index >= 0} {
- set next(list) [lreplace $next(list) $index $index ]
- }
- switch $next(bantype) {
- 0 {set ban "*![string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string first ! [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}
- 1 {set ban "*!*[string trimleft [string range [getchanhost [lindex [split $arg] 0] $next(chan)] [expr [string first ! [getchanhost [lindex [split $arg] 0] $next(chan)]]+1] e] "~"]"}
- 2 {set ban "*!*[string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string first @ [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}
- 3 {set ident [string range [getchanhost [lindex [split $arg] 0] $next(chan)] [expr [string first ! [getchanhost [lindex [split $arg] 0] $next(chan)]]+1] [expr [string last @ [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ban "*!*[string trimleft $ident "~"][string range [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]] [string first @ [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]]] e]"}
- 4 {set ban "*!*[string range [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]] [string last "@" [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]]] e]"}
- 5 {set ban "[lindex [split $arg] 0]![string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string first ! [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}
- 6 {set nick [string range [getchanhost [lindex [split $arg] 0] $next(chan)] 0 [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ident [string range [getchanhost [lindex [split $arg] 0] $next(chan)] [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]+1] [expr [string last "@" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ban "[lindex [split $arg] 0]!*[string trimleft $ident "~"][string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string last "@" [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}
- 7 {set nick [string range [getchanhost [lindex [split $arg] 0] $next(chan)] 0 [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ban "[lindex [split $arg] 0]!*[string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string last "@" [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}
- 8 {set nick [string range [getchanhost [lindex [split $arg] 0] $next(chan)] 0 [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ident [string range [getchanhost [lindex [split $arg] 0] $next(chan)] [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]+1] [expr [string last "@" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ban "[lindex [split $arg] 0]!*[string trimleft $ident "~"][string range [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]] [string last "@" [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]]] e]"}
- 9 {set nick [string range [getchanhost [lindex [split $arg] 0] $next(chan)] 0 [expr [string first "!" [getchanhost [lindex [split $arg] 0] $next(chan)]]-1]] ; set ban "[lindex [split $arg] 0]!*[string range [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]] [string last "@" [maskhost [getchanhost [lindex [split $arg] 0] $next(chan)]]] e]"}
- default {set ban "*!*[string range [getchanhost [lindex [split $arg] 0] $next(chan)] [string first "@" [getchanhost [lindex [split $arg] 0] $next(chan)]] e]"}
- }
- set nnick [lindex [split $ban !] 0]
- set iident [string range $ban [expr [string first ! $ban]+1] [expr [string last @ $ban]-1]]
- set hhost [string range $ban [expr [string last @ $ban]+1] e]
- if {$iident != [set temp [string range $iident [expr [string length $iident]-9] e]]} {set iident *[string trimleft $temp *]}
- if {$hhost != [set temp [string range $hhost [expr [string length $hhost]-63] e]]} {set hhost *[string trimleft $temp *]}
- set next(ban) "$nnick!$iident@$hhost"
- if {[string match "$next(ban)" "$botname"]} {putserv "NOTICE $nick :The ban ( $next(ban) ) matches me ..."
- return }
- newchanban $next(chan) $next(ban) $nick "$next(noidle)" $next(bantime)
- pushmode $chan -o [lindex [split $arg] 0]
- pushmode $chan +b $next(ban)
- putkick $chan [lindex [split $arg] 0] "$next(noidle)"
- return }
- putserv "NOTICE $nick :[lindex [split $arg] 0] isn't on $next(chan)"
- return }
- }
- #### list
- proc next.pub:list {nick uhost handle chan arg} {
- global next
- if {[string tolower $chan] != $next(chan)} { return 0 } {
- if {$next(list) == ""} { putserv "NOTICE $nick :Voice list is curently empty."
- return }
- putserv "NOTICE $nick :\002List\002: $next(list)"; return
- }
- }
- #### getlist
- proc next.pub:getlist {nick uhost handle chan arg} {
- global botnick next
- if {[string tolower $chan] != $next(chan)} { return 0 } {
- set llength [llength $next(list)]
- foreach user [chanlist $chan] {
- if {![isvoice $user $chan] && ![isop $user $chan] && [onchan $user $chan] && $user != $botnick && ![matchattr [nick2hand $nick $chan] o]} {
- set index [lsearch -exact $next(list) [lindex $user 0]]
- if {$index < 0} {
- set next(list) [linsert $next(list) $llength $user ]
- }
- }
- }
- if {$next(list) == ""} { putserv "NOTICE $nick :No users added to voice list. Voice list is empty"
- } else {
- putserv "NOTICE $nick :\002getlist copmleted\002. ( $next(list) )"
- }
- return
- }
- }
- #### clearlist
- proc next.pub:clearlist {nick uhost handle chan arg} {
- global botnick next
- if {[string tolower $chan] != $next(chan)} { return 0 } {
- if {[llength $next(list)] == "0"} {
- putserv "NOTICE $nick :Voice list is allready empty. No users to remove."
- return
- } else {
- set next(list) {}
- putserv "NOTICE $nick :Cleared. Voice list is empty."
- return
- }
- }
- }
- # --------------------------------------------------------------------
- # Admin command handlers
- # --------------------------------------------------------------------
- bind pub m|m ${next(char)}on next.pub:on
- bind pub m|m ${next(char)}off next.pub:off
- #### on
- proc next.pub:on {nick uhost handle chan arg} {
- global next botnick
- if {$next(status) == "on"} {
- putserv "NOTICE $nick :.next $next(version) is allready on!"
- } else {
- next.status on
- putserv "NOTICE $nick :.next $next(version) is now on!"
- set next(status) "on"
- }
- }
- #### off
- proc next.pub:off {nick uhost handle chan arg} {
- global next botnick
- if {$next(status) == "off"} {
- putserv "NOTICE $nick :.next $next(version) is allready off!"
- } else {
- next.status off
- putserv "NOTICE $nick :.next $next(version) is now off!"
- set next(status) "off"
- }
- }
- proc next.status {arg} {
- global next
- switch $arg {
- on {
- bind join - * next.add
- bind rejn - * next.add
- bind part - * next.purge
- bind sign - * next.purge
- bind nick - * next.replace
- bind kick - * next.kick
- bind splt - * next.splt
- bind mode - *+v* next.voiced
- bind mode - *+o* next.voiced
- bind evnt - rehash next.rehash
- bind pub f ${next(char)}next next.pub:voice
- bind pub f ${next(char)}done next.pub:done
- bind pub f ${next(char)}list next.pub:list
- bind pub f ${next(char)}noidle next.pub:noidle
- bind pub f ${next(char)}clearlist next.pub:clearlist
- bind pub f ${next(char)}getlist next.pub:getlist
- return 1}
- off {
- catch { unbind join - * next.add }
- catch { unbind rejn - * next.add }
- catch { unbind part - * next.purge }
- catch { unbind sign - * next.purge }
- catch { unbind nick - * next.replace }
- catch { unbind kick - * next.kick }
- catch { unbind splt - * next.splt }
- catch { unbind mode - *+v* next.voiced }
- catch { unbind mode - *+o* next.voiced }
- catch { unbind evnt - rehash next.rehash }
- catch { unbind pub f ${next(char)}next next.pub:voice }
- catch { unbind pub f ${next(char)}done next.pub:done }
- catch { unbind pub f ${next(char)}list next.pub:list }
- catch { unbind pub f ${next(char)}noidle next.pub:noidle }
- catch { unbind pub f ${next(char)}clearlist next.pub:clearlist }
- catch { unbind pub f ${next(char)}getlist next.pub:getlist }
- return 1}
- }
- }
- # --------------------------------------------------------------------
- # the end
- # --------------------------------------------------------------------
- next.status on
- putlog ".next $next(version) by Thanatos loaded ..."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement