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 

on join help!

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
mindflow
Voice


Joined: 10 Mar 2005
Posts: 22

PostPosted: Mon Oct 23, 2006 4:57 pm    Post subject: on join help! Reply with quote

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


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Mon Oct 23, 2006 5:08 pm    Post subject: Reply with quote

Try it: http://www.egghelp.org/tclhtml/3478-4-7-0-1.htm
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mindflow
Voice


Joined: 10 Mar 2005
Posts: 22

PostPosted: Mon Oct 23, 2006 5:18 pm    Post subject: Reply with quote

username wrote:
Try it: http://www.egghelp.org/tclhtml/3478-4-7-0-1.htm


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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Mon Oct 23, 2006 5:26 pm    Post subject: Reply with quote

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


Joined: 10 Mar 2005
Posts: 22

PostPosted: Mon Oct 23, 2006 9:48 pm    Post subject: Reply with quote

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? Confused

* 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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Tue Oct 24, 2006 2:57 am    Post subject: Reply with quote

* 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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Tue Oct 24, 2006 3:26 am    Post subject: Reply with quote

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


Joined: 10 Mar 2005
Posts: 22

PostPosted: Thu Oct 26, 2006 7:44 am    Post subject: Reply with quote

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 Wink

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Oct 27, 2006 8:59 am    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Oct 27, 2006 10:24 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
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