From Stealth Client

Jump to: navigation, search


N

NRstkLayer

function NRstkLayer():Byte

Returns the layer number 0x1B - Product backpack with two vendor(NPC Buy no restock container).

In conventional game charov container on this layer is absent, ie ObjAtLayer(NRstkLayer) = 0.

Example 1:

if ObjAtLayer(NRstkLayer) > 0 then 
  AddToSystemJournal('NRstkLayer ID:' + IntToStr(ObjAtLayer(NRstkLayer)));

NS

function NS : Word;

Returns reagent type: Nightshade

NSCount

function NSCount : Word;

Returns Nightshade count in backpack.


NeckLayer

function NeckLayer():Byte

Returns the layer number 0x0A - Necklace(Neck).

Example 1:

if ObjAtLayer(NeckLayer) > 0 then 
  AddToSystemJournal('Neck ID:' + IntToStr(ObjAtLayer(NeckLayer)));

Example 2:

{If there is something on a layer, then remove}
if ObjAtLayer(NeckLayer) <> 0 then
  begin
    Unequip(NeckLayer);
    wait(1000);
  end;

NewMoveXY

function NewMoveXY(Xdst, Ydst : Word; Optimized : Boolean; Accuracy : Integer; Running : Boolean) : Boolean

This function calculates the path to a point and moves to it.

Advantages over Doc:Api/MoveXY:

1) A huge reduction of time for calculating long way due to the fact that the route is recalculated not at every step, but one time and due to the obstacles.

2) The new system of steps gives some performance boost due to optimizing.

3) Auto-door opening (if the option is enabled) Doc:Api/OpenDoor

4) Support for options (add a link here!)

//Xdst, Ydst// - coordinates of the points you want to go to.

//Optimized// - with //True// it will make the path rendering more complex, so it is recommended to include it only at a distance of up to 200 tiles. Optimized option left for compatibility, see Doc:Api/MoveHeuristicMult

//Accuracy// - accuracy of the approximation: 0 - straight to the point, one - close within one tile, etc. Length is limited to 1000 tiles.

//Running// - run/walk to a poing.

If the path has been successfully passed, the function will return // True //, or else // False //.

This function is not suitable for the shards, where to exit the ship is required to pass on the ladder. In this case, you need to be in front of a ladder and use the Doc:Api/Step on the open ramp.

Example:

  NewMoveXY(100,100,True,0,True);

NumGumpButton

function NumGumpButton(GumpIndex, Value:Integer):Boolean

It does not work as a trap for Gump, but only for processing has come Gump.

The principle of operation is the same as that of the Doc:Api/WaitGump, with the only difference that there is no exhaustive search of all gumps in the list, and only the buttons are moving Gump, the index is specified in the GumpIndex

If this button is not found - the server did not sent, and the function returns False.

Button No (Value param) - it's value of "return_value" property of GumpButton. Can be easy obtained from any GetXXXGumpLines or GetGumpInfo methods.

Example:

{Kraft piece of script. 
First, put a trap on target for Ingots on the floor, 
then use to call tinkerools Gump,
then the replacement value TextEntry Gump, 
then press the button Gump.}
  WaitTargetGround($ 1BF5); 
  a:= GetGumpsCount; 
  UseObject(FindType($ 1EB9, backpack));
  while a = GetGumpsCount do
    Wait(50);
  NumGumpTextEntry(GetGumpsCount-1, 513, '30 ');
  NumGumpButton(GetGumpsCount-1, 7956);

NumGumpCheckBox

function NumGumpCheckBox(GumpIndex, CBID, Value:Integer):Boolean

It does not work as a trap for Gump, but only for processing has come Gump.

The principle of operation is the same as that of the Doc:Api/GumpAutoCheckBox, with the only difference that there is no exhaustive search of all Gampo in the list, and get over only the CheckBox Gump, the index is specified in the GumpIndex

If a CheckBox is not found, then the function returns False.

In response to this server Gump 'NOT' sent! This must be done through the Doc:Api/WaitGump or Doc:Api/NumGumpButton

Example:

  WaitTargetGround($ 1BF5); 
  a:= GetGumpsCount; 
  UseObject(FindType($ 1EB9, backpack));
  while a = GetGumpsCount do
    Wait(50);
  NumGumpCheckBox(GetGumpsCount-1, 1537, 1);
  NumGumpButton(GetGumpsCount-1, '7956 ');

NumGumpRadiobutton

function NumGumpRadiobutton(GumpIndex : Word; RadiobuttonID,Value : Integer): Boolean;

NumGumpTextEntry

function NumGumpTextEntry(GumpIndex, TextEntryID:Integer; Value:String):Boolean

It does not work as a trap for Gump, but only for processing has come Gump.

The principle of operation is the same as that of the Doc:Api/GumpAutoTextEntry, with the only difference that there is no exhaustive search of all Gampo in the list, and get over TextEntry only the Gump, the index is specified in the GumpIndex

If such TextEntry not found, then the function returns False.

Example:

{Krafterskogo piece of script. 
First, put a trap on target for Ingots on the floor, 
then trap the incoming Gump, to replace the value TextEntry, 
Gump then trap on the button 
and then use to call tinkertulzov Gump.}
  WaitTargetGround($ 1BF5); 
  a:= GetGumpsCount; 
  UseObject(FindType($ 1EB9, backpack));
  while a = GetGumpsCount do
    Wait(50);
  NumGumpTextEntry(GetGumpsCount-1, 513, '30 ');
  NumGumpButton(GetGumpsCount-1, 7956);