| 31 | | = Initial Commands = |
| 32 | | {{{name(String name)}}} |
| 33 | | Specifies the Quagent's ingame name. |
| 34 | | {{{ready()}}} |
| 35 | | 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. |
| 36 | | {{{ready(String[] opcodes)}}} |
| 37 | | Same core functionality as above. The ''opcodes'' array specifies operations which the user wishes to be automatically updated on through the wiki:datastream. |
| 38 | | = Live Functions = |
| 39 | | '''[[ProtocolZero]] Actions''' |
| 40 | | {{{move(double dir, double dist, double speed, int obstacles, int priority)}}} |
| 41 | | Moves by ''dist'' towards the ''dir'' direction at ''speed'' quickness. ''obstacles'' indicates whether the bot automatically maneuvers past simple obstacles. |
| 42 | | {{{move(double dir, double speed, int obstacles, int priority)}}} |
| 43 | | Moves indefinitely towards the ''dir''direction at speed ''speed''. ''obstacles'' is as above. |
| 44 | | {{{move(double[] point, double speed, int obstacles, int priority)}}} |
| 45 | | Moves to the specified ''point''. The ''point'' array should be in {x,y} form. |
| 46 | | {{{move(double dir, long time, double speed, int obstacles, int priority)}}} |
| 47 | | Moves in the specified direction for ''time''. |
| 48 | | {{{jump(double dir, double speed, int priority)}}} |
| 49 | | Jumps in the ''dir'' direction at speed ''speed''. |
| 50 | | {{{rangeFinder(int type, int range, double rot, double azi, int priority)}}} |
| 51 | | Uses the wiki:rangefinder at a limited ''range'', in the direction specified by the ''rot''ational angle and the ''azi''muthal angle. The rangefinder is of the given ''type'' (for more information, see wiki:rf). |
| 52 | | {{{rangeFinder(int type, int priority)}}} |
| 53 | | Uses the wiki:rangefinder in the current direction, with no limit on distance. Uses the specified ''type''. |
| 54 | | {{{rangeFinder(int priority)}}} |
| 55 | | Uses the wiki:rangefinder in the current direction, with no limit on distance. Uses type #1. |
| 56 | | {{{rotate(double rot, double azi, int priority)}}} |
| 57 | | Rotates the bot by a rotational angle ''rot'' and an azimuthal angle ''azi''. |
| 58 | | '''Command Queue management''' |
| 59 | | {{{forgetAllTasks(int priority)}}} |
| 60 | | Clears Quagent command queue, acts as a soft "reset". |
| 61 | | {{{pause(int time, int priority)}}} |
| 62 | | Pauses command queue execution. |
| 63 | | {{{pop(int priority)}}} |
| 64 | | Pops action off command queue. |
| 65 | | {{{skip(int priority)}}} |
| 66 | | Skips the next AI game frame. For more information, see wiki:sk. |
| 67 | | '''[[ProtocolZero]] Queries''' |
| 68 | | {{{currentHealth(int priority)}}} |
| 69 | | Returns Quagent's current health. |
| 70 | | {{{maxHealth(int priority)}}} |
| 71 | | Returns Quagent's maximum health. Kind of useless. |
| 72 | | {{{currentArmour(int priority)}}} |
| 73 | | Returns Quagent's current armor. British spelling adds class. |
| 74 | | {{{maxArmour(int priority)}}} |
| 75 | | Returns Quagent's maximum armor. |
| 76 | | {{{canSee(int entityid, int priority)}}} |
| 77 | | Returns true if entity can see specified ''wiki:entityid''. Also returns distance, yaw, and pitch to target. |
| 78 | | {{{facing(int priority)}}} |
| 79 | | Returns the Quagent's current direction vector. |
| 80 | | {{{radar(double range, int priority)}}} |
| 81 | | Returns a list of all entities within ''range''. |
| 82 | | {{{whatIs(int entityid, int priority)}}} |
| 83 | | Returns a description of the entity specified by ''entityid''. |
| 84 | | '''[[ProtocolOne]] Actions (compound functions)''' |
| 85 | | {{{rotateMove(double rot, double azi, double dist, double speed, int obstacles, int priority)}}} |
| 86 | | Rotates by ''rot''ational and ''azi''muthal angles to face a new direction, then moves in that direction for ''dist''. |
| 87 | | {{{rotateMove(double rot, double azi, double speed, int obstacles, int priority)}}} |
| 88 | | Rotates by 'rot' and 'azi' to face a new direction, then moves in that direction indefinitely. |
| 89 | | {{{rotateFireWeapon(double rot, double azi, int priority)}}} |
| 90 | | Rotates by 'rot' and 'azi' to face a new direction, then fires weapon. |
| 91 | | {{{moveFireWeapon(double dir, double dist, double speed, int obstacles, int priority)}}} |
| 92 | | Moves ''dist'' distance in the specified ''dir'' direction, then fires weapon. |
| 93 | | {{{findMaxiumumDirection(int priority)}}} |
| 94 | | Returns the deepest direction as detected by the type 1 wiki:rangefinder. This values is directly returned by the function. |
| 95 | | {{{faceMaximumDirection(int priority)}}} |
| 96 | | Finds the maximum direction, and then rotates to face it. Does not return anything. |
| 97 | | {{{findEntityDirection(int entityid, int priority)}}} |
| 98 | | Directly returns the direction of the specified entityid, in the form of [rotational,azimuthal]. Returns -1 if nothing found. |
| 99 | | {{{faceEntityDirection(int entityid, int priority)}}} |
| 100 | | Finds the direction of specified entity, then rotates to face this direction. |
| 101 | | {{{gotoEntity(int entityid, double speed, int obstacles, int priority)}}} |
| 102 | | Moves to the specified entity. using the specified ''speed''. |
| 103 | | {{{followEntity(int entityid, double speed, int obstacles, long duration, int priority)}}} |
| 104 | | Follows the specified entity for ''duration''. |
| 105 | | {{{showImage(int priority)}}} |
| 106 | | Displays a depth mapping representing the bot's current "sight". |
| 107 | | {{{maintainDistanceFrom(int entityid, double distbuffer, double speed, int obstacles, long duration, int priority)}}} |
| 108 | | Maintains a "space buffer". If the specified entity enters the buffer zone, the Quagent will run in the opposite direction. |