Code: Select all
# Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
# if you want to use this script on your chan, type in eggdrop console (via telnet or DCC chat)
# .chanset #channel_name +opers
# and later .save
# min operator nickname length (ex. @, example: @mark = 4 chars)
set min_oper_nick_len 2
# oper nicks file
set oper_file "/home/user/eggdrop/operators.txt"
# new oper nicks file
set chan_oper_file "/home/user/eggdrop/channelOperators.txt"
##############################################################
bind pubm - "*" pharse_parse
setudef flag opers
set get_opers [open $oper_file r]
set all_opers [split [read $get_opers] "\n"]
close $get_opers
proc save_oper { oper } {
global chan_oper_file
set append_hand [open $chan_oper_file a]
puts $append_hand $oper
close $append_hand
}
proc pharse_parse { nick uhost hand chan arg } {
global all_opers min_oper_nick_len
if {![channel get $chan opers]} {
return
}
regsub -all -nocase {(@)} $arg "\n@" arg
set separate_it [split $arg "\n"]
if {[llength $separate_it] > 1} {
foreach word $separate_it {
if {[regexp -nocase {^@} $word]} {
set pharse_oper [string trim [lindex [split $word] 0]]
if {[string length $pharse_oper] > [expr $min_oper_nick_len + 1]} {
regsub -nocase {@} $pharse_oper "" pharse_oper
set oper_exists 0
foreach [string trim operator] $all_opers {
if {$operator == $pharse_oper} {
set oper_exists 1
break;
}
}
if {$oper_exists == 0} {
save_oper $pharse_oper
}
}
}
}
}
}
putlog "operpharse.tcl ver 0.1 by tomekk loaded"
Code: Select all
# Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
# if you want to use this script on your chan, type in eggdrop console (via telnet or DCC chat)
# .chanset #channel_name +opers
# and later .save
# min operator nickname length (ex. @, example: @mark = 4 chars)
set min_oper_nick_len 2
# oper nicks file
set oper_file "/home/user/eggdrop/operators.txt"
# new oper nicks file
set chan_oper_file "/home/user/eggdrop/channelOperators.txt"
##############################################################
bind pubm - "*" pharse_parse
setudef flag opers
set get_opers [open $oper_file r]
set all_opers [split [read $get_opers] "\n"]
close $get_opers
proc check_oper { oper } {
global chan_oper_file
set get_new_opers [open $chan_oper_file r]
set all_new_opers [split [read $get_new_opers] "\n"]
close $get_new_opers
set there_is_one "no"
foreach new_oper $all_new_opers {
if {$new_oper == $oper} {
set there_is_one "yes"
break;
}
}
return $there_is_one
}
proc save_oper { oper } {
global chan_oper_file
set append_hand [open $chan_oper_file a]
puts $append_hand $oper
close $append_hand
}
proc pharse_parse { nick uhost hand chan arg } {
global all_opers min_oper_nick_len
if {![channel get $chan opers]} {
return
}
regsub -all -nocase {(@)} $arg "\n@" arg
set separate_it [split $arg "\n"]
if {[llength $separate_it] > 1} {
foreach word $separate_it {
if {[regexp -nocase {^@} $word]} {
set pharse_oper [string trim [lindex [split $word] 0]]
if {[string length $pharse_oper] > [expr $min_oper_nick_len + 1]} {
regsub -nocase {@} $pharse_oper "" pharse_oper
set oper_exists 0
foreach [string trim operator] $all_opers {
if {$operator == $pharse_oper} {
set oper_exists 1
break;
}
}
if {$oper_exists == 0} {
if {[check_oper $pharse_oper] == "no"} {
save_oper $pharse_oper
}
}
}
}
}
}
}
putlog "operpharse.tcl ver 0.1 by tomekk loaded"