mIRC Home    About    Download    Register    News    Help

Print Thread
#43265 20/08/03 09:21 PM
Joined: Jul 2003
Posts: 32
M
mIRCusr Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jul 2003
Posts: 32
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?!

#43266 20/08/03 10:22 PM
Joined: Feb 2003
Posts: 10
Z
Pikka bird
Offline
Pikka bird
Z
Joined: Feb 2003
Posts: 10
..i am not sure with what ? ;o


return is the movement of sense.
#43267 20/08/03 11:00 PM
Joined: Jul 2003
Posts: 32
M
mIRCusr Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jul 2003
Posts: 32
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.

Last edited by mIRCusr; 20/08/03 11:06 PM.
#43268 20/08/03 11:03 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
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.

#43269 20/08/03 11:33 PM
Joined: Jul 2003
Posts: 32
M
mIRCusr Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jul 2003
Posts: 32
Thank you ... this could be what i'm looking for.

#43270 21/08/03 02:18 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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.


-KingTomato

Link Copied to Clipboard