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.

stuck with On join

Help for those learning Tcl or writing their own scripts.
Post Reply
t
terryd
Voice
Posts: 5
Joined: Tue Dec 27, 2005 6:16 pm

stuck with On join

Post by terryd »

I have

bind join - * proc_join
proc proc_join {nick chan text} {
putserv "PRIVMSG $chan :$nick:For info on server do !help"
}

I have tried a few variations and im still reading the docs now.
But when i join the channle with the bot no joy
all my other things work fine like 1help for example

Terry
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

tcl-commands.doc wrote: procname <nick> <user@host> <handle> <channel>
next time check the doc/tcl-commands.doc file before posting.
Once the game is over, the king and the pawn go back in the same box.
t
terryd
Voice
Posts: 5
Joined: Tue Dec 27, 2005 6:16 pm

Stuck with on join

Post by terryd »

I now have

bind join - * test

proc test {nick uhost handle chan } {
putserv "PRIVMSG $chan : $nick :Hello there!"
}

I have also tried a few other ways. The doc you pointed out i have read a dozen time today. But thank you any way
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Code: Select all

#Set here the channels that you don't want onjoin msg enabled. Set "*" for all.
set no-msg(chan) "#chan1 #chan2"

bind join - * onjoin:msg

proc onjoin:msg {nick uhost hand chan} {
    global no-msg
    set chan [string tolower $chan]
    if {(([lsearch -exact [string tolower $no-msg(chan)] $chan] >= 0) || ($no-msg(chan) == "*"))} {return}
    puthelp "NOTICE $nick :For info on server do !help"
}
The above untested; easily altered to suite your own particular needs. :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
t
terryd
Voice
Posts: 5
Joined: Tue Dec 27, 2005 6:16 pm

Stuck on join

Post by terryd »

Well i tried your snippet in its complete form and tried to tweak it but to no avail.
Today is me first day at this so i must be doing some thing really silly some where :)
My other snippets i have been fiddling with just basic stuff to get the feel of things like

bind pub - !os pub:os

proc pub:os {nick host handle chan text} {
set uname [exec uname -a]
putserv "PRIVMSG $chan :$uname"
}

for example all work fine its just this join thing. But never mind thanks for your help i will keep reading and tweaking

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

Post by Alchera »

Just use this instead:

Code: Select all

bind join - * onjoin:msg

proc onjoin:msg {nick uhost hand chan} {
    puthelp "NOTICE $nick :For info on server do !help"
}
.. tested and works! :D
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
t
terryd
Voice
Posts: 5
Joined: Tue Dec 27, 2005 6:16 pm

On join problems

Post by terryd »

Cheers for that all is now well. To get it going i had to put it in a seperate file for some reason.
I have like half a dozen other script sections in my main script file i thought that was ok to do and they all work fine.

Cheers for your time and help Alchera
:)
Post Reply