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.
Old posts that have not been replied to for several years.
J
Jiuy
Post
by Jiuy » Wed Oct 01, 2003 1:57 pm
ok...i have problem to match channel name...
if my channel are config like this #TestChannel and $chan variable are #testchannel....then channel doesn't match, right? so are there any way to solve this?
there is my code....
Code: Select all
bind pub - !testing pub:testing
proc pub:testing { nick host hand chan arg } {
if {[matchattr $nick m $chan]} {
...some code...
}
}
ps. sorry bad english :/
Rusher2K
Halfop
Posts: 88 Joined: Fri Apr 18, 2003 10:45 am
Location: Germany
Contact:
Post
by Rusher2K » Wed Oct 01, 2003 2:01 pm
I think:
Code: Select all
bind pub - !testing pub:testing
proc pub:testing { nick host handle chan arg } {
if {[matchattr $handle m $chan]} {
...some code...
}
}
J
Jiuy
Post
by Jiuy » Wed Oct 01, 2003 2:43 pm
ouh...mistake in example code...
that's not solution for my problem
caesar
Mint Rubber
Posts: 3777 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Oct 01, 2003 3:05 pm
Use "string match -nocase" then, consult the manual
here or do a forum search.
Once the game is over, the king and the pawn go back in the same box.
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Thu Oct 02, 2003 5:30 pm
and maybe add this
Code: Select all
{[matchattr $handle m $chan] == 1}
could be mestaking
XplaiN but think of me as stupid
CrazyCat
Revered One
Posts: 1280 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Fri Oct 03, 2003 3:56 am
Jiuy wrote: ok...i have problem to match channel name...
if my channel are config like this #TestChannel and $chan variable are #testchannel....then channel doesn't match, right? so are there any way to solve this?
Code: Select all
bind pub - !testing pub:testing
proc pub:testing { nick host hand chan arg } {
set channel [string lower $chan]
if {[matchattr $nick m $channel]} {
...some code...
}
}
another security is:
Code: Select all
if {[matchattr $nick -|m $channel]} {
caesar
Mint Rubber
Posts: 3777 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Fri Oct 03, 2003 10:32 am
For matching #TestChannel with #testchannel use the string match and for matching flags to a certain user use:
Code: Select all
if {[matchattr $hand -|m $channel]} {
if the person who trigers the proc is the person who should be checked for the specified flag(s) and else:
Code: Select all
if {[matchattr [nick2hand $nick] -|m $channel]} {
when the person who triggers the proc is not the person who should be checked for the flags but a certain defined user from the channel.
Once the game is over, the king and the pawn go back in the same box.