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.

what matches

Old posts that have not been replied to for several years.
Locked
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

what matches

Post by Nexus6 »

Hi, bot should putlog when pattern matches string, it's not a prob to determine which pattern matches but I wanna know if it matches $nick or $user2 or both.
if {([string match $rnn $nick]) || ([string match $rnn $user2])} {
putlog "$rnn matched ..."
}

Thanks in advance :)
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You just have to use a little more logic in this sort of thing.

Code: Select all

if {([string match $rnn $nick]) && ([string match $rnn $user2])} { 
  putlog "$rnn matched both..." 
} elseif {[string match $nn $nick]} {
  putlog "$rnn matched nick..."
} elseif {[string match $rnn $user2]} {
  putlog "$rnn matched user2..."
} else {
  putlog "I didn't match any
}
Locked