# RACE RESULT 12 Example

We want to query the start time from a contest in RR12 and use it as a start time in RemoteDisplay.&#x20;

## Configure RR12

Create an output list in RR12 with all the information you need, at the minimum the start time for your contest. Make it available externall via SImple API.

## Configure Account Script

In this script, we query the RR12 list. If we encounter a start time is set, then we set the starttime of the scene and also switch to a scene called "Runtime". If no start time is present, then we switch to a scene called "Clock".

```javascript

Script.onStart = () => {
    
}

Script.onStop = () => {
  
}

Script.onRefresh = function onRefresh() {
    log("OnRefresh");
    
    // Get link
    var link = Model.Account.GetLink("d184d831-9936-4ba6-321e-08dbceedad15");
    if (!link) 
        return;


    // Get url from a RR12 output list with at least one column called StartTime
    var url = "https://api.raceresult.com/370734/QUFZ34K3ZSYYJ5P0L4V7FVH5M9Y3CWRO";
    var response = httpGet(url);
    
    

    // Check for response status code and parse body to JSON
    if (response.IsSuccessStatusCode) {
        
        var json = JSON.parse(response.body);
	    if (json && json.length > 0) {   
	        var jsonStartTime = json[0].StartTime;
	        if (jsonStartTime.startsWith("00:00:00") || jsonStartTime == 0)
	            jsonStartTime = null;



            if (jsonStartTime) {
                link.SetStartTime(jsonStartTime);
                link.SetScene("Runtime");
            } else {
                link.SetScene("Clock");
            }

         
	    }
    } else {
        
        log("Invalid Response");
    }
    
};
```

## Scene Script

As the account script already sets the starttime, we can use regular script scenes.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dbnetsoft.com/dbnetsoft/remoteredirect/account-scripts/race-result-12-example.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
