Creating a list of contacts which are online.

icon315

Member
I found this script which created a list of contacts which are online. Here is that snippet:
PHP:
string[int] make_online_contacts_list() {

	string list = visit_url( "account_contactlist.php" );
	list = substring( list, 0 , index_of( list , "Ignore List" ) );
	string[int] contacts;

	int index = -1;
	int i = 0;
	repeat {
		index = index_of( list , "showplayer" );
		if ( index < 0 ) break;
		int start = index_of( list , "<b>" , index ) + 3;
		int end   = index_of( list , "</b>" , start );
                //Debug Print
		print(substring( list , start , end ));
		if (is_online(substring( list , start , end ))){
		contacts[i] = substring( list , start , end );
		list = substring( list , end );
		i = i + 1;
		}
	} until ( index < 0 );

	return contacts;
}
Here is what was outputted in the CLI:
Code:
aZn_loath
Icon315
Yarglefoot
Yarglefoot
Yarglefoot
Yarglefoot
.......
Yarglefoot
Yarglefoot
KoLmafia declares world peace.
I stopped it after little while. Can anyone help tell me why this is going on?

EDIT: Also, somewhat unrelated, is there a way of making an "Enter" when sending a package via a url?
 
Last edited:
Back
Top