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.

Bot to msg during channel join

Help for those learning Tcl or writing their own scripts.
Post Reply
p
panasonic
Voice
Posts: 25
Joined: Sat Sep 15, 2007 5:27 am

Bot to msg during channel join

Post by panasonic »

hi!

i am trying to make my bot to notify user that the bot is now Online and the user can start using the bot commands

i have tried with this script but it wont works

Code: Select all

bind join - #channel bot:joined 

proc bot:joined {nick uhost hand chan} { 
 if {[isbotnick user1 user2 user3] && [string equal -nocase #channel $chan]} { 
  utimer 15 [ putserv "PRIVMSG user1 user2 user3: "I am online now. My commands are available by typing !commands at #channel."]
 } 
}

putlog "Bot ready script - loaded"
but the user did not receive any message while the bot joining the channel now :(

the purpose of this script is just to notify user1, user2 and user3 that my bot is online and they can start using the bot
i have another script for !commands

any advice is appeciated
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: Bot to msg during channel join

Post by speechles »

panasonic wrote:hi!

i am trying to make my bot to notify user that the bot is now Online and the user can start using the bot commands

i have tried with this script but it wont works
Try this script...

Code: Select all

variable yourchannel "#channel"
variable nickalerts "nick1 nick2 nick3"

bind join - $::yourchannel bot:joined 

proc bot:joined {nick uhost hand chan} { 
  if {[isbotnick $nick]} {
    foreach n [split $::nickalerts] {
      putserv "PRIVMSG $n :I am online now. My commands are available by typing !commands on $::yourchannel."
    }
  } 
}
edit: fixed; as per user's observation noted below. ;)
Last edited by speechles on Thu Dec 06, 2007 7:58 pm, edited 3 times in total.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: Bot to msg during channel join

Post by user »

speechles wrote:

Code: Select all

::$yourchannel
...
::$nickalerts
make that

Code: Select all

$::varname
Have you ever read "The Manual"?
Post Reply