| 3 | = Usage = |
| 4 | To use quagents, you must have the Client directory in your filesystem. Create a class with a main method, and import the [[Necessary Classes]]. To create a Quagent, simply create a new client using the Client constructor. The constructor takes one argument, which must specify the IP address of the Quagents server. |
| 5 | ''Example'' |
| 6 | {{{Client quagent = new Client("127.0.0.1");}}} |
| 7 | |
| 8 | Now, before the bot spawns, you may use initial commands to specify certain static parameters. These are optional. When you have completed these modifications, call the ready() function to initiate the live section of the session. |
| 9 | ''Example'' |
| 10 | {{{quagent.ready();}}} |
| 11 | |
| 12 | During the live section, you are free to call any live commands, queries, queue management commands, or compound functions you wish. See the following for a list of currently supported functions. |
| 13 | ''Example'' |
| 14 | {{{ //this will make the Quagent face and shoot at the user. |
| 15 | while(true){ |
| 16 | client.faceEntityDirectoin(0,1); |
| 17 | client.fireWeapon(1); |
| 18 | }}}} |
| 19 | |
| 20 | |
| 21 | = Initial Commands = |
| 22 | {{{name(String name)}}} |
| 23 | Specifies the Quagent's ingame name. |
| 24 | {{{ready()}}} |
| 25 | Spawns the bot, opens the nonblocking socket reader, and starts the live section of the game. This is the final command called during the initial section. |
| 26 | {{{ready(String[] opcodes)}}} |
| 27 | Same core functionality as above. The ''opcodes'' array specifies operations which the user wishes to be automatically updated on through the wiki:datastream. |