This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Autovoice in the presence of +D mode through X

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
s
samhain
Halfop
Posts: 77
Joined: Wed Jan 03, 2007 5:19 am

Autovoice in the presence of +D mode through X

Post by samhain »

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.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Re: Autovoice in the presence of +D mode through X

Post by TCL_no_TK »

I did a google search for scripts like this, i did some digging and found this one http://cybex.b0rk.de/files/tcl/myown/sp ... ed.tcl.txt Hope its usefull.
s
samhain
Halfop
Posts: 77
Joined: Wed Jan 03, 2007 5:19 am

Post by samhain »

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!
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

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
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

The logic behind this would be very simple.
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.
==================================
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

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 ""
    }
}
Give that a try
r0t3n @ #r0t3n @ Quakenet
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

no found.

get this error.

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"
have egg. 1.6.18.
User avatar
CrazyCat
Revered One
Posts: 1299
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Code: Select all

set modD(mode) "v"
...
if {[set mode $modeD(mode)] == ""} {
You forget a "e"
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

get error.

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"

This the code.

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"
User avatar
CrazyCat
Revered One
Posts: 1299
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

you correct it badly...

You must correct the first line:

Code: Select all

set modeD(mode) "v"
and use modeD everywhere: look at the global variable:

Code: Select all

proc modeD:raw353 {from raw arg} {
    global modeD
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

its done, don't get me error.
but no run the script.

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"
don't put -D.
don't give +v to users in /names -d #chan.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

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
}  
untested, should work fine though
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

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.
s
samhain
Halfop
Posts: 77
Joined: Wed Jan 03, 2007 5:19 am

Post by samhain »

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.
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

http://cybex.b0rk.de/files/tcl/myown/sp ... ed.tcl.txt

This Script work, but don't put -D, its put +v to users on join in mode +D.

Maybe u can edit and add the command line what u want.
Post Reply