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.

"IF"

Old posts that have not been replied to for several years.
Locked
User avatar
Tristam
Voice
Posts: 17
Joined: Sun Sep 21, 2003 11:28 am
Location: Finland

"IF"

Post by Tristam »

Hello everyone! I would like to know how to make an "if statement" in tcl. My bot is on two channels, and the same command should get a different result on each channels. For example when I type "!info" the script should check which channel is it, and answer depending on the channel? How to make that? :)
Tristam - tristam@iki.fi
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

check the r0x0ring tutorial by Papillon for the IF commands
User avatar
Rusher2K
Halfop
Posts: 88
Joined: Fri Apr 18, 2003 10:45 am
Location: Germany
Contact:

Post by Rusher2K »

HI

Code: Select all

bind pub - !info pub:info

proc pub:info { nick host hand chan text } { 
    global botnick
    if { $chann == "#chan1" } {putmsg $chan "Hello World, hello $nick, i'm $botnick" }
    if { $chann == "#chan2" } {putmsg $chan "Here is $botnick" }    
} 
User avatar
CrazyCat
Revered One
Posts: 1286
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Sir_Fz wrote:check the r0x0ring tutorial by Papillon for the IF commands
Sir_Fz, you'd better explain him with simple words: RTFM :) :)
User avatar
Tristam
Voice
Posts: 17
Joined: Sun Sep 21, 2003 11:28 am
Location: Finland

Post by Tristam »

Thanks Sir_Fz and Rusher. CrazyCat, if I would had that manual, I wouldnt have posted here :D (but all the other so called tutorials suck ass :P)
Tristam - tristam@iki.fi
User avatar
CrazyCat
Revered One
Posts: 1286
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Tristam, learn the url wich may help you:
http://www.tcl.tk/man/tcl8.4/
I use it every time I'm working on TCL
Locked