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.

Join Notification TCL - Need an alteration.

Old posts that have not been replied to for several years.
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Join Notification TCL - Need an alteration.

Post by Skipper »

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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.
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

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
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

You have to enable the script for your channel:

Code: Select all

.chanset #chan +join
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

Hello Achera,

I have enabled it already... and just curious.. so i enabled once again.. :)
But still no notification coming for me. :/


Rgds

Skipper
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

replace

Code: Select all

if {![channel get $chan join] || ![botisop $chan]} {return 0}
with

Code: Select all

if {![channel get $chan join] && ![botisop $chan]} {return 0}
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

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 :)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Isn't it supposed to notify when user joins a channel except for $exemptchan?

Anyway, use this:

Code: Select all

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.
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

set receiver "#Channel2"
.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.
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

Hello Sir Fz,

Still its not working :/

Rgds

Skipper
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

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. :P

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
S
Skipper
Voice
Posts: 29
Joined: Sun Aug 21, 2005 10:00 am

Post by Skipper »

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
Locked