BNWCS Query API
This API is still in the 'beta' stages. It is quite possible that everything may not work right. Please report any bugs to Matthias Rozensztok!
To find out information about the BNWCS with your own scripts, you will need the "BNWCS Developer's Kit."
The BNWCS Query API allows you to ask other avatars' BNWCS meters, or the BNWCS website, certain questions and receive answers.
To use the Query API, all you need to do is drop the "BNWCS.api.query.lsl" script into an object. Then, depending on what you want to know, send a linked messages to the API, and it will send you an answer back.
To ask the Query API a question, send it a linked message in the following format:
//---------- llMessageLinked(LINK_SET , query_id , "query_type" , "query_target"); //----------
Any number. When the Query API has an answer to your query, the negative of this number will be sent as the linked messages's integer parameter. This can help you identify and keep track of multiple simultaneous queries.
A string specifying the type of query you wish to make. A table detailing the possible values of this parameter can be found below.
One or more pieces of information, separated by a pipe character ( " | " ). This tells the query API what to ask about. A table detailing the required values for this parameter for all the different query_types can be found below.
A summary of the currently-accepted "query_types" and the "query_target" you need to use for each, follows:
|player_stats_query||Avatar_Name||Will return all of an avatar's ranking and statistic information for the sim that the Query API script is in.|
|sim_stats_query||Statistic_Name|Top_X_Avatars||You cannot get more than the top 25 avatars.|
|sim_settings_query||(Nothing)||Will return the sim's custom BNWCS settings (damage multiplier, team names, etc) See also http://bnwcs.org/?zone_notes|
When the Query API has an answer to one of your questions, it will send a linked message in the following format:
//---------- llMessageLinked(LINK_SET , -1*query_id , query_type_return , query_results); //----------
The same number used when the query question was asked, but multiplied by -1. It's a good idea to not use 0 for your query_id.
A string telling you what kind of response this is. Whatever the original query_type was, the word "query" will be replaced with "return". For example, the answer to a "meter_state_query" linked message would have "meter_state_return" as its string parameter.
The results of the query. A detailed outline of all the different formats this string may take can be found below.
A summary of the different query_results you will get for each query_type follows. Hold your mouse over an underlined word in the 'query_results' box for an explanation of that piece of data.
|meter_state_return||Avatar_UUID| Avatar_Name| Avatar_Meter_Name| Avatar_Meter_Script_Name| Avatar_Meter_Version| Avatar_Meter_State| Avatar_ActiveOnly| Avatar_HP| Avatar_Team|