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.

chan == #channel

Old posts that have not been replied to for several years.
Locked
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

chan == #channel

Post by hikaro »

hello i got code on mIRC script
if ($chan == #channel) { halt }
how if i want to do in tcl?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

Code: Select all

set urchan "#channel"

if {[string match -nocase $urchan $chan]} {
  #your code here
  # return 1 would be the same as halt
  return 1
}
i suppose this is on join check eggdrop doc for bind join

$chan is the proc variable so u can call that anything u want thats the string your comparing to

-nocase cause string match is case sensitive
XplaiN but think of me as stupid
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

Dude, why would you use string match? String equal is fine in this case. Hikaro:

Code: Select all

if {[string equal -nocase $chan "#channel"]} {return 0}
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

Sorry :p to me its the same thing i know, its not entirly true but both comes down to the same thing
Dude, why would you use string match? String equal is fine in this case. Hikaro:
so is string match so what is ur point
XplaiN but think of me as stupid
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Actualy the match and equal are two different things. :P According to The Manual the match = "See if pattern matches string." and equal = "Perform a character-by-character comparison of strings string1 and string2"
Once the game is over, the king and the pawn go back in the same box.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

i know but the effect is the same ;) hehe mach can have * ? ... equal not if i remember well as i sad comes down to the same thing hehe the way i use it tho but your right its more accurant to use equal
XplaiN but think of me as stupid
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

Ofloo wrote:i know but the effect is the same ;) hehe mach can have * ? ... equal not if i remember well as i sad comes down to the same thing hehe the way i use it tho but your right its more accurant to use equal
You can either open a door with a key, or drive into it with your car. Comes down to the same thing, but why not use the best way (key :P)? :P
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

lol , your right and i allready sad that it is more correct to use ur string but the difference between using a key or a car and string match or string equal is a bit overboard lol

its more like using the right key and the wrong key but they both open the loc so whats teh difference if you use the wrong key if it still opens the loc :p
XplaiN but think of me as stupid
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Ofloo wrote:its more like using the right key and the wrong key but they both open the loc so whats teh difference if you use the wrong key if it still opens the loc :p
The wrong key might damage the lock! ;P

Code: Select all

set chan {#b[la]h}; string match $chan $chan;# no match.
Have you ever read "The Manual"?
Locked