(redirected from ScriptHooks)

ScriptHook

ThereWiki | RecentChanges | Preferences

The V2.00 ThereClient introduced a service specifically intended for use by other programs. These programs may be external to the ThereClient, or may execute within the ThereClient environment in the form of a customized replacement Flash movie. The primary difference between the two modes of operation is:

Although the ScriptHook service was intended for use in automated testing of the ThereClient, it can be used by other applications in many ways. A ScriptHook service request looks like this:

 http://localhost:9999/ScriptHook/operation?Path=path

This service allows you to manipulate a tree of nodes by specifying the node's path and an operation to perform. Paths are similar to Unix file names in that they have multiple components separated by "/" characters, and the root of the tree is referred to as a path containing a single "/" character.

Each node has three elements:

The operation used for the service can be one of the following:

Value Nodes

If you perform a Get or Wait operation on a value node, you will see something like this:

http://localhost:9999/ScriptHook/Get?Path=/thobs/196772622/edprops/forcefield/value

<Answer>
  <Result>1</Result> 
  <Node>
    <Version>1</Version> 
    <Type>Value</Type> 
    <Value>0</Value> 
  </Node>
</Answer>

Container Nodes

If you perform a Get or Wait operation on a container node, you will see something like this:

http://localhost:9999/ScriptHook/Get?Path=/thobs/196772622

<Answer>
  <Result>1</Result> 
  <Node>
    <Version>4</Version> 
    <Type>Container</Type> 
    <Children>
      <Child>
        <Name>edprops</Name> 
        <Type>Container</Type> 
      </Child>
      <Child>
        <Name>state</Name> 
        <Type>Value</Type> 
      </Child>
      <Child>
        <Name>presence0</Name> 
        <Type>Container</Type> 
      </Child>
      <Child>
        <Name>clide</Name> 
        <Type>Value</Type> 
      </Child>
    </Children>
  </Node>
</Answer>

You can see from this example that the children of a container node may have a mixture of node types.

Errors

An attempt to access a non-existent node will result in something like the following:

http://localhost:9999/ScriptHook/Get?Path=/thobs/196772622/edprops/forcefield/valxx

<Answer>
  <Result>0</Result> 
  <ErrorCode>4400001</ErrorCode> 
  <ErrorDetails>No node exists at path '/thobs/196772622/edprops/forcefield/valxx'</ErrorDetails> 
</Answer>

ScriptHook Hierarchy

The root of the ScriptHook hierarchy is the path "/", which is a container node providing the following main branches:

/acc ScriptHooks

The /acc ScriptHook sub-tree provides access to Avatar Centric Chat through a single method /acc/addChatText. You can invoke this with additional arguments to have your avatar "speak" the text. This functionality includes the ability to perform emotes. For example, performing a GET on the following URL makes your avatar jump for joy:

http://localhost:9999/ScriptHook/Invoke?Path=/acc/addChatText&Args=text%3D'''yay'

Note that the nested "=" character in the Args argument is encoded as %3D to prevent that part of the URL being parsed incorrectly. Similarly, if you want to put a space character in the text, you should encode it as either a "+" or a "%20". You can include a newline character (like hitting the carriage return key) by including one encoded as "%0A".

/client ScriptHooks

/mainMenu ScriptHooks

/pilotPobs ScriptHooks

/thobs ScriptHooks


ThereWiki | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited September 12, 2006 7:12 am by YuujoAkebono (diff)
Search: