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.

need help with TCL

Old posts that have not been replied to for several years.
Locked
b
boinkie

need help with TCL

Post by boinkie »

set chanrules {
"First Read FAQ before you are going to ask in the channel!"
"Don't pm ops unless they want it!"
"Obey!!"
"Greetz http://www.newmp3hits.com Crew"
}
bind pub o !rules pub:t
proc pub:t {nick uhost hand chan text} {
global chanrules
set rulenick [lindex [split $text " "] 0]
if {$text != "" && [onchan $rulenick $chan]} {
puthelp "NOTICE $rulenick :these are the rules of our channel. Pay attention!"
foreach line $chanrules { puthelp "NOTICE $rulenick :$line" }
return 0
}
foreach line $chanrules {puthelp "PRIVMSG $chan :$line" }



i want to bind this to a specific channel and i want it that it says the rules in a private message!
D
Dave

Post by Dave »

for the private msg part you need

puthelp "PRIVMSG $rulesnick :blah blah etc yadda"

:)

for specific channel you could do

if {$chan == "#mychan"} {
do something
} else {
return 0
}

I think that would work but there's probably a more simple way to do it, I always do everything the hard way :cry:
b
boinkie

Post by boinkie »

Dave wrote:for the private msg part you need

puthelp "PRIVMSG $rulesnick :blah blah etc yadda"

:)

for specific channel you could do

if {$chan == "#mychan"} {
do something
} else {
return 0
}

I think that would work but there's probably a more simple way to do it, I always do everything the hard way :cry:
can you fix it in the script for me
i'm a n00b at this:)
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

This should do it. I assume the last line was meant to msg the rules to the channel upon connect..

Code: Select all

set chanrules { 
  "First Read FAQ before you are going to ask in the channel!" 
  "Don't pm ops unless they want it!" 
  "Obey!!" 
  "Greetz http://www.newmp3hits.com Crew" 
}

bind pub o !rules pub:rules
proc pub:rules {nick uhost hand chan text} { 
  if {[string compare $text ""] == 0} {
    putserv "NOTICE $nick :Usage: !rules <nick>"
    return
  }
  if {![onchan [set rulenick [lindex [split $text ] 0]]]} {
    putserv "NOTICE $nick :$rulenick is not on $chan."
    return
  }
  puthelp "PRIVMSG $rulenick :These are the rules of our channel. Pay attention!" 
  foreach line $::chanrules {
    puthelp "NOTICE $rulenick :$line"
  } 
  return 0 
}

# Comment this next section out if you don't want the bot to msg the
# channel rules to the channel upon joining it.

bind join - * join:msgrules
proc join:msgrules {nick uhost hand chan} {
  if {![isbotnick $nick]} {
    return
  }
  foreach line $::chanrules {
    puthelp "PRIVMSG $chan :$line"
  }
}
Wcc
Locked