How to get a list of players in a chat channel?

I've frequently got Time-Spinner minutes left at the end of the day, and I thought it'd be fun to use them pranking players in my clan - specifically, those who are online at the time. I know that I can "timespinner prank [targetname]" to do the actual pranking. But how can I get a target list of who's in the /clan channel? Is there any way to access this information in a .ash? Maybe something via the API that I can't find documented anywhere?

Thanks very much for the help.
 

Bale

Minion
Let's see if there is such a command...

Code:
[COLOR="#880"]> ashref clan[/COLOR]

void chat_clan( string )
void chat_clan( string, string )
int get_clan_id( )
int [item] get_clan_lounge )
string get_clan_name( )
string [int] get_clan_rumpus( )
boolean [string] who_clan( )

See what I did there? The command you're looking for is who_clan()
 
Thanks for pointing me in the right direction. Believe it or not, I did try both ashref and searching the wiki. Unfortunately, I assumed that any function serving this purpose would work across chat channels, so I tried something like:

Code:
> ashref chat

void chat_clan( string )
void chat_clan( string, string )
void chat_macro( string )
void chat_notify( string, string )
void chat_private( string, string )
int [item] get_chateau( )

> ashref channel

> ashref online

boolean is_online( string )

... and found nothing. Is it safe to assume by implication that there is not similar functionality for any channel other than /clan?

Also - and this is unrelated to the thread title, so I hope you'll indulge me - why doesn't this work?

Code:
boolean [string] clannies = who_clan();
sort clannies by random(100);
foreach clannie in clannies {
	print(clannie);
}

I don't want to prank people according to alphabetical priority, so I tried randomizing them. The wiki page on data structures > sort seems to indicate that random(int) should work. But I still get an alphabetized map. Is it not possible to randomize a map that's not indexed by number?
 

Bale

Minion
... and found nothing. Is it safe to assume by implication that there is not similar functionality for any channel other than /clan?

Correct. There was a reason for that, but I simply can't remember what.


Also - and this is unrelated to the thread title, so I hope you'll indulge me - why doesn't this work?

Code:
boolean [string] clannies = who_clan();
sort clannies by random(100);
foreach clannie in clannies {
	print(clannie);
}

I don't want to prank people according to alphabetical priority, so I tried randomizing them. The wiki page on data structures > sort seems to indicate that random(int) should work. But I still get an alphabetized map. Is it not possible to randomize a map that's not indexed by number?

That doesn't work because you are ordering a whole bunch of booleans, not strings. You're changing which boolean value is ordered by which string. It works fine, but it is pretty meaningless.
 
That doesn't work because you are ordering a whole bunch of booleans, not strings. You're changing which boolean value is ordered by which string. It works fine, but it is pretty meaningless.

Ah, yeah, that was dumb. I guess I'll have to be super-kludgy and copy all those players into an int-indexed map. Thanks for all the help.
 
Top