egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Autovoice in the presence of +D mode through X
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
samhain
Halfop


Joined: 03 Jan 2007
Posts: 77

PostPosted: Fri Aug 31, 2007 11:25 am    Post subject: Autovoice in the presence of +D mode through X Reply with quote

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
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Tue Sep 04, 2007 1:54 pm    Post subject: Re: Autovoice in the presence of +D mode through X Reply with quote

I did a google search for scripts like this, i did some digging and found this one http://cybex.b0rk.de/files/tcl/myown/special/berlin/moded.tcl.txt Hope its usefull.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
samhain
Halfop


Joined: 03 Jan 2007
Posts: 77

PostPosted: Sat Sep 08, 2007 4:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
YooHoo
Owner


Joined: 13 Feb 2003
Posts: 939
Location: Redwood Coast

PostPosted: Sat Sep 08, 2007 7:13 pm    Post subject: Reply with quote

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
_________________
Mr. Green
Johoho's TCL for beginners
Mr. Green
Back to top
View user's profile Send private message Send e-mail
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Sun Sep 09, 2007 2:45 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Sun Sep 09, 2007 10:34 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sat Nov 24, 2007 3:36 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Sat Nov 24, 2007 6:44 am    Post subject: Reply with quote

Code:
set modD(mode) "v"
...
if {[set mode $modeD(mode)] == ""} {


You forget a "e"
_________________
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
View user's profile Send private message Visit poster's website
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sat Nov 24, 2007 9:13 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Sat Nov 24, 2007 12:09 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sat Nov 24, 2007 12:39 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sat Nov 24, 2007 1:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sat Nov 24, 2007 3:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
samhain
Halfop


Joined: 03 Jan 2007
Posts: 77

PostPosted: Sun Jul 20, 2008 4:59 am    Post subject: Reply with quote

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
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Sun Jul 20, 2008 5:42 am    Post subject: Reply with quote

http://cybex.b0rk.de/files/tcl/myown/special/berlin/moded.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.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber