Repository navigation
EN Runtime API 30 Targeting
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
Home · C# · IDE · UO API · A–Z · Examples · Languages
Each team opens a card with C#-signatures, parameters and several independent examples.
Overrides the current target cursor if it is active.
Cancels the current target trap (set via WaitTargetObject, WaitTargetXYZ, WaitTargetTile, etc.)
Opens the user's local item/character selection crosshair. Resets the previous response. This is not a server crosshair expectation or an automatic target. Read the result through ClientTargetResponse after ClientTargetResponsePresent/WaitForClientTargetResponse. The choice of land is not taken as an object; the stale callback of the previous request is ignored.
Opens the user's local sight, which allows tile and object selection. The answer is taken through ClientTargetResponse; the new request resets the old response.
Returns a copy of the array [serial, graphic, x, y, z]. For ground/static, serial is 0. Before the answer, if canceled or inappropriate selection, the array is empty. Check its length first; the fact that a selection has been completed does not guarantee five elements.
Returns 1 if the callback of the last user selection has already completed, otherwise 0. Completion may mean cancellation; check the length of ClientTargetResponse() separately.
Returns true if the target's trap is currently armed, that is, a previous call WaitTargetObject, WaitTargetSelf, WaitTargetLast, WaitTargetTile, WaitTargetXYZ, WaitTargetType, or WaitTargetGround queued a response to the target, which hasn't worked yet.
Different overloads perform different operations. Target() cancels the current/prepared target. Target(object) queues the object like WaitTargetObject. Target(targetKey,target) sends a protocol response with an explicit target ID; target can be serial, a named object, or the string 'lasttile'. The seven arguments specify targetKey, object, targetType, graphic/type, x,y,z; targetType=0 — object, 1 — cell. For a normal script, WaitTargetObject/WaitTargetTile are preferred: targetKey for a low-level form must match the server request.
Sends a "target by resource" packet to the server, targeting the specified object with the resource type.
Returns ID of the current target cursor.
Returns 1 if the server/client targeting engine TargetManager is currently active, 0 otherwise. The check does not select a target or queue a response.
Returns 1 if the server/client targeting engine TargetManager is currently active, 0 otherwise. The check does not select a target or queue a response.
In this build, calls WaitTargetObject and puts serial in the response queue. Therefore, the team can prepare a response even before the server sight appears. There is no return value; sending a response does not guarantee the success of the server action.
Queues the response type,x,y,z to the server target via WaitTargetTile. The name TargetToTile does not necessarily mean an immediate response: if there is no sight yet, the response remains prepared.
Places x,y,z coordinates in the response queue to the server sight with graphic/type=0. Game map coordinates are used, not screen pixels.
Returns the saved value of UO.Timer at the time the target was prepared in the corresponding commands. The unit is a tenth of a second; is not a ID sight.
Waits for the user to complete the last local selection: 1 - callback received, 0 - timeout. Parameter in milliseconds, polling step no more than 25 ms. Canceling also terminates the request, so check the ClientTargetResponse() array.
Waits no more than the specified number of milliseconds for the server crosshair to appear. Returns 1 if target cursor is present and 0 if time has expired. Zero or negative timeout means checking without a long wait. The polling period in this build is no more than 25 ms; the old reference's statement about 100 ms does not apply here. Does not select an object or set an automatic target. The general TargetManager is checked: the active local selection cursor can also influence the result. Don't use ClientRequestObjectTarget as a way to wait for a server request.
Compact automatic target selection. The specific serial/named object is queued directly. The values 0 and -1 enable searching by loaded characters/items with filters type, color, distance, notoriety, nearest and maxZ; Ignore is taken into account. If there is no match, the prepared target is cleared. The team does not begin casting or using the item.
Searches for a loaded item on the ground based on graphics and optional color, then places it serial in the target queue. This is a search for an item, not a static map tile. If there is no result, cancels the next automatic response.
Places lasttarget in the response queue to the server target. Make sure the last target is still valid.
Places serial in the response queue to the server target. If the sight is already available, the manager can respond immediately; otherwise the target waits for the next sight. Two arguments specify a sequence of two objects. This command does not trigger the action itself (cast, use of a tool or skill). The string form allows named objects, such as self and lasttarget.
Prepares a sequence of two targets: an explicitly specified object id and a graphic object of type/color found on the ground. If one of the objects is not found, the next automatic target is canceled.
Places the current character in the response queue for the server crosshair. Equivalent to WaitTargetObject("self").
Places tile coordinates in the response queue for the server target. The one-argument form only accepts the string 'lasttile'. If the last tile is missing, the next automatic response is canceled. The x,y,z form uses graphic/type=0; the type,x,y,z form allows you to specify graphics. Use valid map coordinates and elevation; This is not a mouse terrain selection command.
Searches for an item of the specified graphic in the backpack, including the loaded contents of nested containers, and puts the found serial in the target queue. The omitted color is -1 (any color). If an item is missing, it reports this and cancels the next automatic response.
ClassicUO — Bad Newbie & C# Scripts IDE