| View previous topic :: View next topic |
| Author |
Message |
samhain Halfop
Joined: 03 Jan 2007 Posts: 77
|
Posted: Fri Aug 31, 2007 11:25 am Post subject: Autovoice in the presence of +D mode through X |
|
|
Hi I'm sorry I break the rules with my previous request...
We want to +D and +m our channel on undernet due to flood... we know that +D mode is a mode if it is set to a channel then we would not see the users joining the channel and if we do /names -d #channel then we would see the users which are invisible and then we can voice them through X.. I want a tcl which will first do /names -d #channel every 1 minute and then if there are users present which are invisible then the bot will voice them through X please script this for me. |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
|
| Back to top |
|
 |
samhain Halfop
Joined: 03 Jan 2007 Posts: 77
|
Posted: Sat Sep 08, 2007 4:22 pm Post subject: |
|
|
| 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! |
|
| Back to top |
|
 |
YooHoo Owner

Joined: 13 Feb 2003 Posts: 939 Location: Redwood Coast
|
Posted: Sat Sep 08, 2007 7:13 pm Post subject: |
|
|
| samhain 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! | 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 .rehash _________________
Johoho's TCL for beginners
 |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Sun Sep 09, 2007 2:45 am Post subject: |
|
|
The logic behind this would be very simple.
| Quote: |
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.
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sun Sep 09, 2007 10:34 am Post subject: |
|
|
| Code: | 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 ""
}
} |
Give that a try _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Sat Nov 24, 2007 3:36 am Post subject: |
|
|
no found.
get this error.
| Code: |
<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"
|
have egg. 1.6.18. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Sat Nov 24, 2007 9:13 am Post subject: |
|
|
get error.
| Code: |
<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"
|
This the code.
| Code: |
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"
|
|
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Sat Nov 24, 2007 12:09 pm Post subject: |
|
|
you correct it badly...
You must correct the first line:
| Code: | | set modeD(mode) "v" |
and use modeD everywhere: look at the global variable:
| Code: | proc modeD:raw353 {from raw arg} {
global modeD |
_________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Sat Nov 24, 2007 12:39 pm Post subject: |
|
|
its done, don't get me error.
but no run the script.
| Code: |
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"
|
don't put -D.
don't give +v to users in /names -d #chan. |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sat Nov 24, 2007 1:50 pm Post subject: |
|
|
| Code: | 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
} |
untested, should work fine though |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Sat Nov 24, 2007 3:30 pm Post subject: |
|
|
i test this script,
but don't put -D and don't give +v to users in /names -d #chan
don't give error, but don't run. |
|
| Back to top |
|
 |
samhain Halfop
Joined: 03 Jan 2007 Posts: 77
|
Posted: Sun Jul 20, 2008 4:59 am Post subject: |
|
|
| Well this script does not work, I don't know why, however can you give me a valid script, I've been asking people on undernet to give me but they give me [censored] telling me that it's not public and [censored]. I really need this script. Regards. |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
|
| Back to top |
|
 |
|