Hi
Sorry, don't know how to title the thread. I need to work with numbered vars.
var(1) = x
var(2) = y
...
var(13) = z
Thats not the problem (i hope). But i've to know the count of var. I know from PHP something like $count(var). Last but not least must be var( count+1) = 'xy'.
var(14) = xy
Can someone help me, please?!
..i am not sure with what ? ;o
ARGH
Sorry for my bad english ... and sometimes i'm thinking to far away.
I've written a script which checks nicknames and chattext in all channels. If a special user says something or someone says part of my own nick i get a msg in custom window.
At the moment i've many lines in script with $nicks / $adresses to check (if ... elseif ... elseif ... elseif). Each if- and elseif-line contains a special user (friend).
The script is running and there are no errors.
But it's not the best to go for every new person in editor and write a new line with $nick or $adress to check.
My idea is ... i'll pick up a nick in userlist per popup and the script puts the $nick together with other infos in a var list (could be something else of cause). It should check if the $nick already exist in list. Than i could delete all the if- and elseif-lines. I could write simple code to check $nick in a while loop. Only 5 lines instead 25 or 50 lines.
I want to minimize the code and i want to simplify the part to define new friend.
Sounds like you want to use levels
/auser special_guy the_address_here
Then your event instead of being like
ON *:JOIN:...........
will be:
ON special_guy:JOIN:............
Then that event will only only trigger when a user in the special_guy list joins.
Thank you ... this could be what i'm looking for.
Just for future reference, the count in PHP is used to detect the size of an array. PHP being more relaxed of a language, you can assign array blocks "as you go". I think they wanted to know how to get the counf of, say, variables starting with friends (such as friends[1] friends[2] etc). Just so you know in the mean time, you can use a wilcard such as $var(%friends[*], 0) that would tell you the number of variables matching the friends[<number>] pattern.
Just thought i would throw that in there.