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.

Which bind to use?

Old posts that have not been replied to for several years.
Locked
S
Stafford

Post by Stafford »

Hi,

Can i know which bind should I use if I want the bot to echo to channel main when someone voice (+v) it? Thanks.
User avatar
Souperman
Halfop
Posts: 69
Joined: Sat Feb 02, 2002 8:00 pm
Location: Cape Town, South Africa
Contact:

Post by Souperman »

bind mode xxxxxxx

See tcl-commands.doc for the details.
S
Stafford

Post by Stafford »

ahh, I've got it :smile: Thanks anyway. Btw, how can I write a yes/no choice? For example, if 1 is selected, it is yes and 0 is selected, it is no. How can I do that to apply in my script?
User avatar
Souperman
Halfop
Posts: 69
Joined: Sat Feb 02, 2002 8:00 pm
Location: Cape Town, South Africa
Contact:

Post by Souperman »

What do you mean by "selected"?
M
Mentolboy

Post by Mentolboy »

global selected, answ
if { selected == 1 } { set answ "yes" }
elseif { selected == 0 } { set answ "no" }

is this what you mean or am I not getting your point? In other languages you can use a boolean var, I'm not sure if you can use it in TCL, but my code will work just fine.
Grtz
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

standard vars can act as bools when set as positive integers (with 0 being false and anything else being true).

eg

if {$var} {
#code to run if true
} else {
#code to run if false
}

also the ! operator can be used to reverse this
eg

if {!($var)} {
#code to run if false
} else {
#code to run if true
}
S
Stafford

Post by Stafford »

Ahh Mentolboy, that's what I meant. You got it :smile: Anyway, I've figured out how should it be like and it's working fine now. Thanks Everyone :smile:
Locked