| View previous topic :: View next topic |
| Author |
Message |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Sun Aug 21, 2005 10:05 am Post subject: Join Notification TCL - Need an alteration. |
|
|
bind join -|- * new_join
setudef flag join
set receiver "#Channel1"
set exemptchan "#Channel2"
proc new_join { nick uhost handle channel } {
global receiver exemptchan
set chan [string tolower $channel]
if {[lsearch -exact [channel info $chan] +join] == -1} {return 0}
if {(![botisop $channel]) || ([isop $nick $channel])} {return 0}
if {($channel != $exemptchan)} {
putserv "NOTICE @$receiver :$nick Has Joined $channel"
}
}
Here, the bot sends an opnotice to #Channel1 .. whenever an user joins the #Channel2. But I need some alteration here.. that is.. if the user who joined #Channel2 is an OP. I dont want the notification to be sent to #Channel1.
Pls Help me.
Rgds
Skipper. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Aug 21, 2005 11:02 am Post subject: |
|
|
An easy solution would be to add the ops into your bot and check if they have the flag you gave'em on join (using matchattr). Send the notification only if they do not have that flag. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Sun Aug 21, 2005 11:12 am Post subject: |
|
|
Hello Sir FZ,
Well, Your idea is good one.. but the thing is.. my channel got some 80+ Ops.. Adding all the ops to bots user list.. and giving flag to all the ops.. is kinda heavy load to the bot.
Wat i feel here is.. The notification is sent well before the script checks whether they are op or not.That is.. Chanserv delayed here.So how to put a timer here.. and check whether the user is op or not. If they are op.. The notification not needed.. And if they are not op.. notification needed.
Can you help me how to put timer and check..
or if there is any other solution?
Rgds
Skipper |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Aug 21, 2005 1:00 pm Post subject: |
|
|
| Code: | bind join -|- * new_join
setudef flag join
set receiver "#Channel1"
set exemptchan "#Channel2"
proc new_join {nick uhost handle chan} {
global receiver exemptchan
if {![channel get $chan join] || ![botisop $chan]} {return 0}
utimer 1 [list check:after $nick $chan ]
}
proc check:after {nick chan} {
global receiver exemptchan
if {![isop $nick $chan] && ![string equal -nocase $exemptchan $chan]} {
putserv "NOTICE @$receiver :$nick Has Joined $chan"
}
}
} |
This will check after 1 second if nick has ops, if not it will notify $reciever. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Sun Aug 21, 2005 1:31 pm Post subject: |
|
|
Hello Sir Fz,
Theres no notification am getting this time.. :/
If the user is not an op also.. am not getting any notification.
Rgds
Skipper |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sun Aug 21, 2005 8:11 pm Post subject: |
|
|
You have to enable the script for your channel:
| Code: | | .chanset #chan +join |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Mon Aug 22, 2005 6:49 am Post subject: |
|
|
Hello Achera,
I have enabled it already... and just curious.. so i enabled once again..
But still no notification coming for me. :/
Rgds
Skipper |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Aug 22, 2005 8:57 am Post subject: |
|
|
replace
| Code: | | if {![channel get $chan join] || ![botisop $chan]} {return 0} |
with
| Code: | | if {![channel get $chan join] && ![botisop $chan]} {return 0} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Mon Aug 22, 2005 11:05 am Post subject: |
|
|
Hello Sir Fz,
Its not sending notification if the user is an op.. But whats happening now is.. its sending notification if the user joins other channel where the bot is in.. But its not sending the notification abt the user who joins the concerned channel.
Example :-
It was supp to send notification abt the user who joins channel2 but its not sending the notification abt it.. instead its sending notification abt the user who joins other channels.
Rgds
Skipper.
P.S: If u dont mind can u pls test the script in ur eggdrop so that u wil understand the exact problem  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Aug 22, 2005 12:44 pm Post subject: |
|
|
Isn't it supposed to notify when user joins a channel except for $exemptchan?
Anyway, use this:
| Code: | bind join -|- * new_join
setudef flag join
set receiver "#Channel1"
proc new_join {nick uhost handle chan} {
global receiver exemptchan
if {![channel get $chan join] && ![botisop $chan]} {return 0}
utimer 1 [list check:after $nick $chan]
}
proc check:after {nick chan} {
global receiver exemptchan
if {![isop $nick $chan]} {
putserv "NOTICE @$receiver :$nick Has Joined $chan"
}
} |
this will only notify if a user joins a +join channel. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Mon Aug 22, 2005 2:13 pm Post subject: |
|
|
Hello Sir Fz,
Its still not working as per my requirement.
I guess i can briefly say abt my requirement here.. so that if u dont mind.. u can alter the tcl again
Channel 1 is a help channel and have around 100+ ops. Channel 2 is the main channel. Where the actual chat goes on. If the ppl wants to get help regarding the channel2. They join channel1 and ask for help.
here, when the users join channel1 (help channel) I want a notification to be sent as opnotice to the ops of channel2. And the user who joined is an op of channel1 . The notification not needed.
This is the requirement. If u dont mind.. pls alter according to this.
Rgds
Skipper |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Aug 22, 2005 3:43 pm Post subject: |
|
|
| Code: | | set receiver "#Channel2" |
| Quote: | | .chanset #channel1 +join |
But note that the bot must be op in #channel1 in order to notify, if you don't want this then remove ![botisop $chan] from the code. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Tue Aug 23, 2005 2:59 am Post subject: |
|
|
Hello Sir Fz,
Still its not working :/
Rgds
Skipper |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Tue Aug 23, 2005 3:05 am Post subject: |
|
|
| Skipper wrote: | | Still its not working :/ |
Could you be a tad more specific? "not working" doesn't give any clues as to what is not happening.
What do you see in the log or via DCC for instance. _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Skipper Voice
Joined: 21 Aug 2005 Posts: 29
|
Posted: Tue Aug 23, 2005 4:05 am Post subject: |
|
|
Hello Alchera,
Forget abt my tcl.
Let me be more specific abt what i exactly want.
There are two channels. Channel1 and channel2.. Channel2 is a help channel.. for Channel1.
So when an user joins Channel2(Help channel) Seeking for help.. The Bot should send a opnotice to #Channel1 to attend the user in #Channel2.
But if the user who joined #Channel2(help channel) is an op.. I Dont want any notification to be sent to #Channel1.
Thats it.
If u can get a script to do these functions.. pls get me one
Rgds
Skipper |
|
| Back to top |
|
 |
|