Hey,
I'm again stuck with a part of my tcl.
i m trying to get info from userlist and matchin it with the $uhost and if it doesnt match do something. I don't think i m doing it correctly.
well, i cant use [finduser] cause i want to match *!@$uhost against all the hosts of particular flag let it be +f like [userlist f|f $chan] or something. and if that nick is a validuser [validuser $nick] and his/her *!@$uhost doesnt match with our particular flag's host { do soemthing }, thats what i want to do.
hosts are not "user.domain.com" but "*!*@user.domain.com" therefore you need to at least match against "!$uhost". Without ! there will be no match. And if you want to completly ignore any possible entries in host for idents then split them off using [lindex [split $host @] 1].
set host "[lindex [split $uhost @] 1]"
foreach user [userlist o] {
foreach userhost [getuser $user hosts] {![string match -nocase $userhost $host]} { do something }
and i aslo want to ask foreach user [userlist o] { putlog "[getuser $user hosts]"} it returns hosts of the respective flags, is it a string or something or should i use it in "" here
your quoted line will most likely never be compiled because
a) foreach uses 3 arguments only
b) there is no function called 0 or 1 (you are missing some conditional structure)
PS: you still have a string match that will never be true, because the pattern contains string parts that $host can never ever have.
Edit: then you will get the split string match line as addionatl list elements @_o
Last edited by De Kus on Thu May 11, 2006 4:05 am, edited 2 times in total.