| View previous topic :: View next topic |
| Author |
Message |
mindflow Voice
Joined: 10 Mar 2005 Posts: 22
|
Posted: Mon Oct 23, 2006 4:57 pm Post subject: on join help! |
|
|
I havent been working in TCL for a long time now, and i need 1 channel to be excluded from the "join" event, this is how it looks like now.
| Code: |
bind join * * msg_jmsg1
proc msg_jmsg1 {nick uhost hand channel args} {
global botnick
putserv "NOTICE $nick : Hi $nick, I'm $botnick. Rest of my message here. :)"
return 1
}
|
how would i make this see if the channel the person join is the excluded channel, the bot are on 6 channels i want it to send the notice on join, then 1 i dont want it to send the notice too.. someone that can help me with this?[/code] |
|
| Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
|
| Back to top |
|
 |
mindflow Voice
Joined: 10 Mar 2005 Posts: 22
|
Posted: Mon Oct 23, 2006 5:18 pm Post subject: |
|
|
uhum, thats a link to other peoples TCL, all i need is a if statement, if {chan == #channel} do nothing
dont remember how to write it right tho.. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Mon Oct 23, 2006 5:26 pm Post subject: |
|
|
| Code: |
set excludedchans "#channelname #chan2 #whatever"
proc msg_jmsg1 {nick uhost hand channel args} {
global botnick
if {[lsearch -exact $::excludedchans $channel] == -1}
putserv "NOTICE $nick : Hi $nick, I'm $botnick. Rest of msg"
} else {
return
}
}
|
BTW "args" is a special case in tcl, in case you run into problems using it. |
|
| Back to top |
|
 |
mindflow Voice
Joined: 10 Mar 2005 Posts: 22
|
Posted: Mon Oct 23, 2006 9:48 pm Post subject: |
|
|
| rosc2112 wrote: | | Code: |
set excludedchans "#channelname #chan2 #whatever"
proc msg_jmsg1 {nick uhost hand channel args} {
global botnick
if {[lsearch -exact $::excludedchans $channel] == -1}
putserv "NOTICE $nick : Hi $nick, I'm $botnick. Rest of msg"
} else {
return
}
}
|
BTW "args" is a special case in tcl, in case you run into problems using it. |
Thnx for the help, the code didnt work as it should tho.. any other idea?
* EDIT *
Forgot to say, the bot dies when i rehach it:
| Quote: |
(03:45) « bot » (file "scripts/fun.tcl" line 710)
(03:45) « bot » invoked from within
(03:45) « bot » "source scripts/fun.tcl"
(03:45) « bot » (file "bot.conf" line 1220)
(03:45) « bot » [05:44] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
Line 710 in the tcl:
proc msg_jmsg1 {nick uhost hand channel} {
|
tryed to edit it a bit, but still same result. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Oct 24, 2006 2:57 am Post subject: |
|
|
* off topic *
mindflow stop checking the 'Disable BBCode in this post' if you use BBCode in your replyes.
* on topic *
| Quote: |
if {[lsearch -exact $::excludedchans $channel] == -1}
|
is missing a "{"
| Code: |
if {[lsearch -exact $::excludedchans $channel] == -1} {
|
Also, if the channel name will be #foo and in the 'excludedchans' you have #FOO or something different than #foo then it will send the message. I would go for 'setudef'. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Tue Oct 24, 2006 3:26 am Post subject: |
|
|
I thought lsearch was case-sensitive when using the -exact switch? Hmm, just looked at the lsearch manpage, guess you'd have to use -exact -ascii for it to be case-sensitive.
And about crashing the bot, sorry! <grin>
Read this post and you'll never have a bot crash from loading scripts:
http://forum.egghelp.org/viewtopic.php?p=63899#63899 |
|
| Back to top |
|
 |
mindflow Voice
Joined: 10 Mar 2005 Posts: 22
|
Posted: Thu Oct 26, 2006 7:44 am Post subject: |
|
|
| caesar wrote: | * off topic *
mindflow stop checking the 'Disable BBCode in this post' if you use BBCode in your replyes.
* on topic *
| Quote: |
if {[lsearch -exact $::excludedchans $channel] == -1}
|
is missing a "{"
| Code: |
if {[lsearch -exact $::excludedchans $channel] == -1} {
|
Also, if the channel name will be #foo and in the 'excludedchans' you have #FOO or something different than #foo then it will send the message. I would go for 'setudef'. |
Ok. the TCL working now, but i got a strange behavior from the bot, after added that line i got a huge "lag" or "delay" when the bot auto op me, i know auto op is a bad this to use, but since the channels are protected by channel service i use it any way
Problem:
befor that line i got auto oped 2 sec after i joined, now it takes up to 1 minute befor i got my @, the bot are on 4 channels with maybe 100 users total, so that shouldent be any problem, anyone that have a suggestion about this? and i have a of topic question too, to change the eggdrop version reply i need to add 1 line in the eggdrop.con file, i forgot what line that is. someone that know what i mean? |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Oct 27, 2006 8:59 am Post subject: |
|
|
If it's under heavy join/parts then it gets lagged thus leading to the delay in oping. If you really need this implement a *delay* function else remove it. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Oct 27, 2006 10:24 am Post subject: |
|
|
I'd also recommend using puthelp as it uses a different queue with a lower priority _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|