mIRC Home    About    Download    Register    News    Help

Print Thread
Variable assignment ? #260259 24/03/17 02:15 AM
Joined: Mar 2015
Posts: 26
A
Anti Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2015
Posts: 26

Hello,

I have this line in a script :

%clones = %clones $ialchan(%host_to_search_for,chan,%count).nick

What is this ?
This line is out of a condition statements like if then , while , etc ...

What do this line ?

Thx

Re: Variable assignment ? [Re: Anti] #260260 24/03/17 04:02 AM
Joined: Feb 2003
Posts: 2,709
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,709
This line would be from a loop that iterates through the %count of nicknames with a matching %host_to_search_for address mask. It does this %count times, creating a list of all the matching nicknames together into a the %clones variable.

$ialchan(*!*@*.aol.com,#aol,0) would tell the loop how many times it has to iterate.
$ialchan(*!*@*.aol.com,#aol,1).nick would be the first matching nickname.
$ialchan(*!*@*.aol.com,#aol,2).nick would be the second matching nickname.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: Variable assignment ? [Re: Raccoon] #260261 24/03/17 05:06 AM
Joined: Mar 2015
Posts: 26
A
Anti Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2015
Posts: 26

%clones = $ialchan($address($nick($1,%count1),2),$1,%count2).nick

this line assigns the result to %clones variable :

$nick($1,%count1) ; extract %count1 number nick_name from $1 channel from IAL ( internal address list)
$address(nick,2) ; extract *!*@domain from given nick_name from IAL
$ialchan(*!*domain,#channel,%count2) ; found *!*@domain string for %count2 element in IAL

The $ialchan(*!*domain,#channel,%count2) function found the string *!*domain in the %count2 element of IAL.

teorically this is a classic example of while or for programming usage.
I don't understand what mean .nick at the end of line.


Thanks

Last edited by Anti; 24/03/17 08:48 AM.
Re: Variable assignment ? [Re: Anti] #260274 24/03/17 06:03 PM
Joined: Feb 2003
Posts: 2,709
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,709
The '.nick' property at the end of '$ialchan()' tells it to return only the nickname instead of the full address.

$ialchan(*ccoo*!*@*,#chan,1) == Raccoon!fuzzy@woodland.critter

$ialchan(*ccoo*!*@*,#chan,1).nick == Raccoon

same as

$gettok($ialchan(*ccoo*!*@*,#chan,1),1,33) == Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!