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.

setudef problem

Help for those learning Tcl or writing their own scripts.
Post Reply
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

setudef problem

Post by darton »

Hello!
This is my script:

Code: Select all

setudef flag help
bind pub - !help help
proc help {nick host hand chan rest} {
   puthelp "privmsg $chan :blablabla"
}
The bot is listened on more than one channel. And I want that it only answers on one of these channels. So I insert "setudef flag help" in my script. But now the bot still anwers in every channel. What do I have to add to my script that it works.
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

try

Code: Select all

bind pub - !help help
proc help {nick host hand chan rest} {
if {$chan =="#mychannel"} { 
  puthelp "privmsg $chan :blablabla"
   }
}
<- tcl newb
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Re: setudef problem

Post by Sir_Fz »

darton wrote:Hello!
This is my script:

Code: Select all

setudef flag help
bind pub - !help help
proc help {nick host hand chan rest} {
   puthelp "privmsg $chan :blablabla"
}
The bot is listened on more than one channel. And I want that it only answers on one of these channels. So I insert "setudef flag help" in my script. But now the bot still anwers in every channel. What do I have to add to my script that it works.
You need to check if the channel is set to +help.

Code: Select all

if {[channel get $chan help]} {
 puthelp "privmsg $chan :blablabla"
}
m
miCHa
Voice
Posts: 1
Joined: Tue Mar 07, 2006 3:24 pm
Location: Gelsenkirchen (Germany)
Contact:

Post by miCHa »

sorry for pushing this thread. This is only a tip, if you dont want to use setudef (checkin if its on etc.)

Code: Select all

bind pub - !help help

proc help { nickname hostname handle channel arguments } {
if {[string equal -nocase $channel "#your_channel"]} {
  putserv "privmsg $channel :your text!"
  }
}
#micha (on QuakeNet) - www.micha.es
Post Reply