From Stealth Client

Jump to: navigation, search

Object_Search

Backpack

function Backpack():Cardinal

Returns the char - ID backpack(Backpack ID).

If there is no connection to the UO server - returns 0.

Often used, for example, in the search, index recipient to drag things on and so forth.

Example 1:

if Count(runes) < 10 then
begin
   MoveItem(runestack ,10-Count(runes), Backpack, 0,0,0)
end;

Example 2:

  FindType($ EED, Backpack)

FindAtCord

function FindAtCoord(X:Word; Y:Word):Cardinal

returns the last point found in the specified object.

Example:

ObjId:= FindAtCoord(GetX(Self), GetY(Self));

FindCount

function FindCount():Integer

Returns the number of aytemov found by using the functions Doc:Api/FindType or Doc:Api/FindTypeEx

In calculating the count should be borne in mind that a stack of several "stekirovannyh" aytemov is considered as one aytem!

If nothing is found - return 0.

Example:

FindType(runes, backpack);
  AddAddToSystemJournal('Runes found:' + IntToStr(FindCount));

FindDistance

var FindDistance:Integer

specifies the range of search functions Doc:Api/FindType or Doc:Api/FindTypeEx on the horizontal cells

For example, 3 - so will look at each other and within a radius of three cells.

The default value is 2(taken as the default on most servers as the maximum distance at which an ordinary player under normal conditions can raise or put the thing)

Example:

FindDistance:= 0;'' to look only under current position
FindType(bandage_type, ground);
  AddAddToSystemJournal('Bandages found:' + IntToStr(FindQuantity));

For Python this function is spreaded into two separate functions: GetFindDistance() and SetFindDistance(integer).

FindFullQuantity

function FindFullQuantity:Integer

Returns the total number of aytemov found by using the functions Doc:Api/FindType or Doc:Api/FindTypeEx

Summ of stacked items!

If the stacks(stacks) in the search results do not, then the function returns a number equal to the value of the returns one of the Doc:Api/FindCount

If nothing is found - return 0.

Example:

FindType(BM, backpack);
  AddAddToSystemJournal('BM total found:' + IntToStr(FindFullQuantity));

FindItem

function FindItem():Cardinal

Returns the last object found using the function Doc:Api/FindType or Doc:Api/FindTypeEx

If nothing is found - return 0.

Example 1:

if FindTypeEx(bottle_type,bottle_color,Ground,false) > 0 then
begin
  UseObject(FindItem);
end;

Example 2:

  IF FindType($190,ground) > 0 THEN
    WaitTargetObject(FindItem);

FindNotoriety

function FindNotoriety(ObjType:Word; Notoriety:Byte):Cardinal

Searches for the specified object type ObjType and said, "color" * Notoriety.

To Land

Search results for:

At the distance of the search depends on:

  • Doc:Api/FindDistance - specifies the search range for the horizontal cells. 3 - then will look at each other and within a radius of three cells. The default value is 2(taken as the default on most servers as the maximum distance at which an ordinary player under normal conditions can raise or put the thing)
  • Doc:Api/FindVertical - specifies the search range for the vertical. The default is 5, so as not to affect adjacent floors in the search.

If nothing is found - return 0.

The parameter Notoriety can be used:

  • 1 - innocent(blue)
  • 2 - guilded/ally(green)
  • 3 - attackable but not criminal(gray)
  • 4 - criminal(gray)
  • 5 - enemy(orange)
  • 6 - murderer(red)

0 and 7, the client can not get

Example:

if FindNotoriety($190,6) > 0 then
begin
  AddAddToSystemJournal('Murderer found!');
  '' Make something ''
end;
  • Actually Notoriety - translated as "infamous." But that translation is somehow not very applicable.

FindQuantity

function FindQuantity():Integer

Returns the number of aytemov the stack of the last object found by the functions Doc:Api/FindType or Doc:Api/FindTypeEx

If the latter is not aytem stack(stack), it returns a

If nothing is found - return 0.

Example:

FindType(BM, backpack);
  AddAddToSystemJournal('BM in last found stack:' + IntToStr(FindQuantity));

FindType

function FindType(ObjType:Word; Container:Cardinal):Cardinal

Searches for the specified object type ObjType in the container, Container.

It will NOT look in pouches (containers within the specified container). For such a search refer to Doc:Api/FindTypeEx; in fact, Findtype = FindTypeEx(ObjType, $FFFF, Container, false); If the object satisfies all the conditions, before adding it to FindedList its presence in the IgnoreList is verified. If the object is ignored - then then it won't be part of the selection. For more details, see Doc:Api/Ignore

Search results for:

  • A list of found objects is stored in the FindedList, which can be obtained trough the function Doc:Api/GetFindedList
  • The last object was found is recorded and can be obtained using Doc:Api/FindItem
  • The last object found is returned as result of this function
  • The Doc:Api/FindCount function record the count of found items (a pile of several stackable items is considered as one item!)
  • The Doc:Api/FindQuantity returns the ammount of stack if the latter is a pile
  • The Doc:Api/FindFullQuantity records the total number of items in all the found stacks (if there are no results, it will be equal to Doc:Api/FindCount

At the distance of the search depends on:

  • Doc:Api/FindDistance - specifies the search range for the horizontal cells. F.E.: 3 - then Stealth will look within a radius of three tiles. The default value is 2 (taken as the default on most servers as the maximum distance at which an ordinary player under normal conditions can interact with objects)
  • Doc:Api/FindVertical - specifies the search range for the vertical. The default is 5, so to avoid items in adjacent floors.

If nothing is found - return 0.

The parameter Container can be used:

If you specify a nonexistent container ID, the search is performed in the backpack of your character.

If ObjType = -1 - will be returned all objects in container\ground (with considering of FindDistance and FindVertical)

Example 1:

//Pascal Script
if FindType(bottle_type,Ground) > 0 then
begin
  UseObject(FindItem);
end;
#Python
if FindType(bottle_type, Ground()):
  UseObject(FindItem())

Example 2:

  //Pascal Script
  FindType(runes, backpack);
  AddAddToSystemJournal('Runes found:' + IntToStr(FindCount));
  #Python
  FindType(runes, Backpack())
  AddAddToSystemJournal('Runes found: {0}'.format(FindCount()))

FindTypeEx

function FindTypeEx(ObjType:Word; Color:Word; Container:Cardinal; InSub:Boolean):Cardinal

Searches for the specified object type ObjType and color Color in that container, Container.

InSub includes a search mode in the pouches(containers within the specified container).

Search results for:

  • A list of found objects is stored in the FindedList, which can be obtained, ipolzuya function Doc:Api/GetFindedList
  • The last object was found recorded in the Doc:Api/FindItem
  • The last object found is returned rezutatom perform this function
  • The Doc:Api/FindCount recorded count found aytemov(a stack of several "stekirovannyh" aytemov is considered as one aytem!)
  • The Doc:Api/FindQuantity entered aytemov count on the stack(the stack), if the latter is aytem stack(stack)
  • The Doc:Api/FindFullQuantity recorded the total number of aytemov all I found stacks(if such there in the results, it will be equal to Doc:Api/FindCount

At the distance of the search depends on:

  • Doc:Api/FindDistance - specifies the search range for the horizontal cells. 3 - then will look at each other and within a radius of three cells. The default value is 2(taken as the default on most servers as the maximum distance at which an ordinary player under normal conditions can raise or put the thing)
  • Doc:Api/FindVertical - specifies the search range for the vertical. The default is 5, so as not to affect adjacent floors in the search.

If nothing is found - return 0.

The parameter Container can be used:

If you specify a nonexistent container ID, the search is performed in a backpack chara The parameter Color can be used:

  • $ FFFF(-1) - if the color is not considered in the search
  • The color you want aytema

FindTypeEx with parameters Color = $ FFFF and InSub = False still function Doc:Api/FindType

Example 1:

if FindTypeEx(bottle_type,bottle_color,Ground,false) > 0 then
begin
  UseObject(FindItem);
end;

Example 2:

  FindTypeEx(runes, runes_color, backpack, true);
  AddToSystemJournal('Runes found:' + IntToStr(FindCount));

FindTypesArrayEx

FindTypesArrayEx(ObjTypes,Colors : Array of Word; Containers : Array of Cardinal; InSub : Boolean) : Cardinal

Searches for the specified array of types ObjTypes and array of colors Colors in the array of Containers, Containers. If InSub is True nested containers will be deeply searched.

Pass an Array of Itemtypes, an Array of ItemColors and an Array of Locations. The method inside will go through each type\color\location and execute a simple findtypeex command.

Example 1 - looking for the selected types on ground (mobiles etc.):

FindDistance := 20;
FindVertical := 10;
FindTypesArrayEx([$29A, $29B, $190, $191, $25d, $25e, $192, $193, $25f, $260, $2ea, $2ec, $2ed, $84, $f6, $19, $db, $51, $7a, $2ee, $2e8, $2e9, $2eb, $117, $116, $115],[$FFFF],[Ground],false);
AddToSystemJournal('FindCount = ' + IntToStr(FindCount));

FindVertical

var FindVertical:Integer

specifies the range of search functions Doc:Api/FindType or Doc:Api/FindTypeEx vertically

The default is 5, so as not to affect adjacent floors in the search. Example:

FindVertical:= 25;'' look on the floor above and below
FindType(sheep_type, ground);
  AddAddToSystemJournal('On the three floors of the sheep found:' + IntToStr(FindQuantity));


For Python this function is spreaded into two separate functions: GetFindVertical() and SetFindVertical(integer).

GetFindedList

function GetFindedList(var UserList:TStringList):Boolean

Fills a string list UserList the search results.

In UserList entered the list of found objects, found by Doc:Api/FindType or Doc:Api/FindTypeEx

ATTENTION! UserList must be created through the var_list_name:= TStringList.Create and necessarily removed after use by var_list_name.Free;

ATTENTION! Object ID listed this list, are hex-format!

If nothing is found - return False, and the empty list UserList.

Example:

function GetFoundItemsFromStringList(var Items:Array Of Cardinal):Integer;
var List:TStringList; i:Integer;
begin
  List := TStringList.Create;
  if GetFindedList(List) = False then Result:= 0
  else begin
    SetLength(Items, List.Count);
    for i:= 0 to Length(Items) -1 do Items [i]:= StrToInt('$' + List.Strings [i]);
    Result:= Length(Items);
  end; 
  List.Free;
end;


Note: Starting from version 7.9.0 you can use this:

type TCardinalDynArray = Array of Cardinal;
function GetFoundItems():TCardinalDynArray;

GetIgnoreList

function GetIgnoreList(var UserList:TStringList):Boolean

Fills a string list object UserList from IgnoreList.

In UserList entered the list of objects located in the IgnoreList

ATTENTION! UserList must be created through the var_list_name:= TStringList.Create and necessarily removed after use by var_list_name.Free;

If IgnoreList empty and there is nothing to fill - returns False, and the empty list UserList.

An example of work with a string list can be found in Doc:Api/GetFindedList

Ground

function Ground():Cardinal

A pointer to the ground. Often used, for example, in the search.

If there is no connection to the UO server - returns 0.

Example 1: Search for gold coins on the ground(you can set the search radius using the FindDistance and FindVertical)

  FindType($ EED, Ground);

Ignore

procedure Ignore(ObjID:Cardinal)

Adds a ObjID in IgnoreList

As a result, to ignore the reset or restart the script object will not be the functions Doc:Api/FindType, Doc:Api/FindTypeEx and Doc:Api/FindNotoriety

Examples are not required.

IgnoreOff

procedure IgnoreOff(ObjID:Cardinal)

Removes the object ObjID from IgnoreList

After performing the procedure will be the object function Doc:Api/FindType, Doc:Api/FindTypeEx and Doc:Api/FindNotoriety

Examples are not required.

IgnoreReset

procedure IgnoreReset()

Cleans IgnoreList As a result ignorlist completely cleared, and all objects will be functions of the Doc:Api/FindType, Doc:Api/FindTypeEx and Doc:Api/FindNotoriety

Examples are not required.

LastContainer

function LastContainer():Cardinal

Returns the char - ID of the last open container(Last Opened Container).

If there is no connection to the UO server - returns 0.

Example 1:

if LastContainer <>MyGoldContainer then
begin
  UseObject(MyGoldContainer)
end;

Example 2:

  AddToSystemJournal('The last open container(Last Opened Container):' + IntToStr(LastContainer))