this script needs very little if any modification at all. Simply load it into your ~/eggdrop/scripts folder, open up your conf file, and put in a trigger for the script at the bottom of your conf file, i.e. source scripts/moded.tcl. Then all you need do is .rehashsamhain wrote:Thanks dude, I am actually not a scripter so i am not able to understand installation or how to configure this script, please anyone explain or modify this script according to my needs i shall be very thankful!
First you call a proc using "bind time" every minute. In that proc you will use putserv for "/names -d $chan".
Secondly you will bind to the raw keyword for the "/names -d" output. You have to check that from raw numerics of undernet's IRCd (I'm not aware with undernet, since I only use DALnet).
Then you bind raw to that raw numeric and process the information retrieved in $raw, if you find any nicknames in $arg say, convert the string to list. Do a foreach loop on the list and then pushmode +v $chan $nick on that channel and flushmode $chan in the end.
Code: Select all
set modeD(channel) "#mychannel"
# set the mode to either 'o' or 'v', nothing else!
set modD(mode) "v"
bind time - "?2 * * * *" modeD:time
bind time - "?4 * * * *" modeD:time
bind time - "?6 * * * *" modeD:time
bind time - "?8 * * * *" modeD:time
bind time - "?0 * * * *" modeD:time
bind raw - {353} modeD:raw353
proc modeD:time {min hour day month year} {
global modeD
if {[validchan $modeD(channel)]} {
if {[regexp {D|d} [lindex [getchanmode $modeD(channel)] 0]]} {
putquick "NAMES -d $modeD(channel)" -next
}
}
}
proc modeD:raw353 {from raw arg} {
global modeD
set channel [lindex [split $arg] 1]
if {[set mode $modeD(mode)] == ""} {
set mode "v"
}
if {![string equal -nocase $channel $modeD(channel)]} { return }
set list ""
foreach user [lrange $arg 2 end] {
if {$user != "" && (![onchan $user $channel] || (![isop $user $channel] && ![isvoice $user $channel]))} {
lappend list "$user"
}
if {[llength $list] == "6"} {
putquick "MODE $channel +[string repeat "$mode" 6] [join $list " "]"
set list ""
}
}
if {[llength $list] > "0"} {
putquick "MODE $channel +[string repeat "$mode" [llength $list]] [join $list " "]"
set list ""
}
}
Code: Select all
<Nor7on`> .set errorInfo
<)Modo> Currently: can't read "modeD(mode)": no such element in array
<)Modo> Currently: while executing
<)Modo> Currently: "set mode $modeD(mode)"
<)Modo> Currently: (procedure "modeD:raw353" line 4)
<)Modo> Currently: invoked from within
<)Modo> Currently: "modeD:raw353 $_raw1 $_raw2 $_raw3"
Code: Select all
set modD(mode) "v"
...
if {[set mode $modeD(mode)] == ""} {
Code: Select all
<Nor7on`> .set errorInfo
<)Modo> Currently: can't read "modD(mode)": no such variable
<)Modo> Currently: while executing
<)Modo> Currently: "set mode $modD(mode)"
<)Modo> Currently: (procedure "modeD:raw353" line 4)
<)Modo> Currently: invoked from within
<)Modo> Currently: "modeD:raw353 $_raw1 $_raw2 $_raw3"
Code: Select all
set modeD(channel) "#Madrid"
# set the mode to either 'o' or 'v', nothing else!
set modD(mode) "v"
bind pub - !modeD modeD:time
bind time - "?2 * * * *" modeD:time
bind time - "?4 * * * *" modeD:time
bind time - "?6 * * * *" modeD:time
bind time - "?8 * * * *" modeD:time
bind time - "?0 * * * *" modeD:time
bind raw - {353} modeD:raw353
proc modeD:time {min hour day month year} {
global modeD
if {[validchan $modeD(channel)]} {
if {[regexp {D|d} [lindex [getchanmode $modeD(channel)] 0]]} {
putquick "NAMES -d $modeD(channel)" -next
}
}
}
proc modeD:raw353 {from raw arg} {
global modeD
set channel [lindex [split $arg] 1]
if {[set mode $modD(mode)] == ""} {
set mode "v"
}
if {![string equal -nocase $channel $modeD(channel)]} { return }
set list ""
foreach user [lrange $arg 2 end] {
if {$user != "" && (![onchan $user $channel] || (![isop $user $channel] && ![isvoice $user $channel]))} {
lappend list "$user"
}
if {[llength $list] == "6"} {
putquick "MODE $channel +[string repeat "$mode" 6] [join $list " "]"
set list ""
}
}
if {[llength $list] > "0"} {
putquick "MODE $channel +[string repeat "$mode" [llength $list]] [join $list " "]"
set list ""
}
}
putlog "Anti-mode +D loaded"
Code: Select all
set modeD(mode) "v"
Code: Select all
proc modeD:raw353 {from raw arg} {
global modeD
Code: Select all
set modeD(channel) "#Madrid"
# set the mode to either 'o' or 'v', nothing else!
set modeD(mode) "v"
bind pub - !modeD modeD:time
bind time - "?2 * * * *" modeD:time
bind time - "?4 * * * *" modeD:time
bind time - "?6 * * * *" modeD:time
bind time - "?8 * * * *" modeD:time
bind time - "?0 * * * *" modeD:time
bind raw - {353} modeD:raw353
proc modeD:time {min hour day month year} {
global modeD
if {[validchan $modeD(channel)]} {
if {[regexp {D|d} [lindex [getchanmode $modeD(channel)] 0]]} {
putquick "NAMES -d $modeD(channel)" -next
}
}
}
proc modeD:raw353 {from raw arg} {
global modeD
set channel [lindex [split $arg] 1]
if {[set mode $modeD(mode)] == ""} {
set mode "v"
}
if {![string equal -nocase $channel $modeD(channel)]} { return }
set list ""
foreach user [lrange $arg 2 end] {
if {$user != "" && (![onchan $user $channel] || (![isop $user $channel] && ![isvoice $user $channel]))} {
lappend list "$user"
}
if {[llength $list] == "6"} {
putquick "MODE $channel +[string repeat "$mode" 6] [join $list " "]"
set list ""
}
}
if {[llength $list] > "0"} {
putquick "MODE $channel +[string repeat "$mode" [llength $list]] [join $list " "]"
set list ""
}
}
putlog "Anti-mode +D loaded"
Code: Select all
set modeD(channel) "#Madrid"
set modeD(mode) "v"
bind pub - !modeD modeD:time
bind time - "* * * * *" modeD:time
proc modeD:time {args} {
global modeD
if {[validchan $modeD(channel)]} {
if {[regexp {D|d} [lindex [getchanmode $modeD(channel)] 0]]} {
bind raw - 353 modeD:raw353
putquick "NAMES -d $modeD(channel)"
}
}
}
proc modeD:raw353 {from raw arguments} {
global modeD
unbind raw - 353 modeD:raw353
set channel [lindex [split $arguments] 2]
if {[set mode $modeD(mode)] == ""} {
set mode "v"
}
set list [list]
foreach user [split [lindex [split $arguments ":"] 1]] {
pushmode $channel +$mode $user
}
flushmode $channel
}