Skip to content

JA UO Topic search

Codex edited this page Oct 12, 2026 · 4 revisions

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

検索

家 · C# · IDE · UO API · A–Z · 例 · Languages

検索領域とフィルターの選択、結果の処理、見つかった項目と例外のリスト。コマンド カードの値「見つからない」を確認します: serial、数量、リスト - 異なる結果。

セクション

トピック コマンドと説明
検索項目 UO.FindType · UO.FindTypeEx ​​· UO.FindTypesArrayEx · UO.FindAnyType
携帯電話を検索 UO.FindMobile · UO.FindType ​​
プレーヤーを検索 UO.FindMobile · UO.FindType ​​
NPC を検索 UO.FindMobile · UO.FindType ​​
モンスターを検索 UO.FindMobile · UO.FindType ​​
シリアルから探す UO.Exists · UO.GetSerial ​​
タイプから探す UO.FindType · UO.FindTypeEx ​​· UO.FindTypesArrayEx
Notorietyで検索 UO.FindByNotoriety · UO.FindNotoriety ​​
距離から探す UO.FindDistance · UO.FindType ​​
座標で検索 UO.FindAtCoord
Zで検索 UO.FindVertical · UO.FindType ​​
Search Ground UO.FindType · UO.CountGround
コンテナの検索 UO.FindTypeEx · UO.OpenContainer ​​
FindList UO.AddFindList · UO.FindList · UO.GetFindedList · UO.GetFoundItems · UO.FindItem · UO.FindCount · UO.FindQuantity · UO.FindFullQuantity
Ignore Lists UO.Ignore · UO.IgnoreOff · UO.IgnoreReset · UO.AddIgnoreList · UO.SelectIgnoreList
Bad Objects UO.SetBadObject · UO.ClearBadObjectList
Bad Locations UO.SetBadLocation · UO.ClearBadLocationList

すべてのテーマコマンド

検索項目

UO.FindType · UO.FindTypeEx · UO.FindTypesArrayEx · UO.FindAnyType · UO.FindAtCoord · UO.FindItem · UO.FindCount · UO.FindQuantity · UO.FindFullQuantity · UO.Count · UO.CountEx · UO.CountGround · UO.GetWorldItems · UO.GetFoundItems · UO.GetFindedList

携帯電話の検索

UO.FindMobile · UO.FindMan · UO.FindByNotoriety · UO.FindNotoriety

距離から探す / Z

UO.FindDistance · UO.FindVertical

FindList

UO.AddFindList · UO.ClearFindList · UO.DeleteFindList · UO.FindList · UO.InfoFindList · UO.MFGI

Ignore リスト

UO.Ignore · UO.IgnoreOff · UO.IgnoreReset · UO.AddIgnoreList · UO.ClearIgnoreList · UO.DeleteIgnoreList · UO.SelectIgnoreList · UO.GetIgnoreList

不正なオブジェクト

UO.SetBadObject · UO.ClearBadObjectList

悪い場所

UO.SetBadLocation · UO.ClearBadLocationList

このトピックに関する例

各コマンド カードには、直接コード、関数、クラスなどのいくつかの独立したシナリオがあります。以下は厳選された短いシナリオです。制限と完全な分析がカードに含まれています。

UO.FindType

パラメータ、結果、およびすべてのシナリオ

var gold = UO.FindType(0x0EED, -1, "backpack");
if (Truth(gold == ""))
{
    UO.Print("Gold was not found in the loaded backpack");
}
else
{
    UO.Print("Gold serial: " + gold);
    UO.Info(gold);
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

UO.FindFullQuantity

パラメータ、結果、およびすべてのシナリオ

var found = UO.FindType(0x0EED, -1, "backpack");
var value = UO.FindFullQuantity();
UO.Print(Convert.ToString(value));

リファレンスの各部

1 · 2

コマンドの完全なリファレンス


UO.AddFindList

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

void UO.AddFindList(object? list, object? @type);
void UO.AddFindList(object? list, object? @type, object? color);

ルール type/hue を UO.FindList の名前付きセットに追加します。このセットでは、複数のタイプのオブジェクトまたはモバイルを繰り返し検索し、追加順にタイプの優先順位を設定できます。

引数

  • list — ルールセットの名前 (例: 「loot」)。 | を付けずに文字列を渡します。この文字はレコード内の区切り文字として使用されます。名前では大文字と小文字は区別されません。これは、serial コンテナーや見つかったアイテムの配列ではありません。
  • type - アイテムのグラフィック/type または body mobile、その serial ではありません。通常は int 0..65535 (0x0EED を含む) -1 または 0xFFFF は、検索時に任意の type を意味します。エントリごとに 1 つの値を指定します。いくつかのタイプは個別の呼び出しによって追加されます。
  • color — RGB ではなく、オブジェクト/ボディの色相。 int 0..65535; 0 - 通常の hue 0、-1 または 0xFFFF - 任意。 AddFindList では、色をスキップすることは検索時に任意の hue を意味します。

戻り値

void: 戻り値はありません。呼び出しを変数に割り当てたり、true/1 でテストしたりしないでください。定義の状態は推測できます UO.InfoFindList();検索自体は、UO.FindList() 経由で個別に起動されます。

動作

  • 定義は、指定されたスクリプト ランタイムの状態になります。独立した他のランタイムには独自のセットがあります。 IDE ウィンドウを閉じても、これらのルールはクリアされません。これは設定ファイルやグローバル ゲーム オブジェクトのリストではありません。
  • AddFindList はエントリを最後に追加します。繰り返しは削除されません。キットを再プロビジョニングするには、まず ClearFindList("name") を呼び出します。定義を変更しても、すでに受信したFindItem/FindCount/GetFoundItemsはクリアされません。
  • レコードにはテキスト フィールドが保存されます。数値リテラル 0x0EED は「3821」として保存され、文字列「0x0EED」は「0x0EED」として保存されます。検索では両方のオプションが数値に変換され、DeleteFindList は保存されたテキストを比較します。追加時も削除時も同じフォームを使用してください。
  • FindList の不明な名前は空の登録セットではありません。エンジンはそれを数値型のリストとして解析しようとします。数値以外の名前を使用すると、変換エラーが発生します。最後のエントリを削除した後、その名前を検索する前に新しいセットを作成してください。
  • 引数はすぐに保存されます。数値 type/hue チェックは FindList で実行されます。 AddFindList は、アイテムを検索したり、運んだり、serial を Ignore に追加したりしません。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

コマンドは独立した文です。直前のメッセージは呼び出しの開始を示し、サーバーの動作完了を確認するものではありません。

UO.Print("Calling UO.AddFindList");
UO.AddFindList("simple_loot", 0x0EED);

1。独自の戦利品セットを準備して結果を取得 - 直接スクリプト

引数と実行の流れ:

  • 0x0EED はゴールド、0x0F7A はセットの 2 番目の graphic です。他のサーバー データの場合は、グラフィックを置き換えます。完全な BuildLoot 手順は上記に記載されています。
  • FindCount(item) は、特定のスタックのユニット数を読み取ります。 GetFoundItems には個別の serial が含まれています。この例では転送は実行されません。
BuildLoot();
var first = UO.FindList("loot", "ground", 2, -1, false, 5, false);
if (Truth(first == ""))
{
    UO.Print("No matching loot nearby");
    return null;
}
var items = UO.GetFoundItems();
foreach (var item in items)
{
    UO.Print(UO.GetName(item) + " | stack: " + Convert.ToString(UO.FindCount(item)));
}

void BuildLoot()
{
    UO.ClearFindList("loot");
    UO.AddFindList("loot", 0x0EED, -1);
    UO.AddFindList("loot", 0x0F7A, -1);
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

2。バックパックの中から希望の色のアイテムだけを検索 - スクリプト機能

引数と実行の流れ:

  • 0x0044 フィルター hue;これはserialではありません。 backpack はバックパックの直接の中身を検索します。 AddObject は、選択したオブジェクトをこのランタイムに名前を付けて保存します。
return  RunScenario();
 object? RunScenario()
{
    UO.ClearFindList("colored");
    UO.AddFindList("colored", 0x0EED, 0x0044);
    var first = UO.FindList("colored", "backpack");
    if (Truth(first != ""))
    {
        UO.AddObject("colored_item", first);
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3。体型と複数の悪名 - スクリプトクラス

引数と実行の流れ:

  • 各エントリで、欠落している色はいずれかの hue を意味します。 「5|6」行では 2 つの悪名コードが許可されます。このフィルターでは通常のアイテムが除外されます。検索は Follow を攻撃したり起動したりしません。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        UO.ClearFindList("watch");
        UO.AddFindList("watch", 0x0190);
        UO.AddFindList("watch", 0x0191);
        var nearby = UO.FindList("watch", "ground", 12, "5|6", true, 10);
        if (Truth(nearby != ""))
        {
            UO.AddObject("watched_mobile", nearby);
        }

        return null;
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.AddFindList(list, type) — UO.AddFindList(Any,Any)

引数: list (Any), type (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "adddir":

                case "addfindlist":

                case "addgate":

                case "addrecall":

                case "addstep":

                    LegacyList(name).Add(string.Join("|", arguments.Select(value => value.ToString())));

                    break;

UO.AddFindList(list, type, color) — UO.AddFindList(Any,Any,Any)

引数: list (Any), type (Any), color (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "adddir":

                case "addfindlist":

                case "addgate":

                case "addrecall":

                case "addstep":

                    LegacyList(name).Add(string.Join("|", arguments.Select(value => value.ToString())));

                    break;

UO.AddIgnoreList

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

void UO.AddIgnoreList(object? list, object? @type);
void UO.AddIgnoreList(object? list, object? @type, object? color);

検索時にスキップする必要があるものの名​​前付きセットを準備します。たとえば、金を選択しない、または特定の色のものを選択しないでください。ルールは type と hue によって指定されるため、後で出現するオブジェクトを含むすべての適切なオブジェクトに適用されます。設定後、SelectIgnoreList経由でダイヤルできるようにしてください。

引数

  • list — 空ではない任意の名前、たとえば「loot_skip」。名前では大文字と小文字は区別されません。これはアイテムの名前ではなく、serial コンテナの名前でも、FindList の名前でもありません。
  • type - アイテムのグラフィック/type または body mobile。たとえば、0x0EED は金、0x0191 は女性の人体です。数値または数値文字列 ("0x0EED"、"3821"); -1/その他のネガティブ/0xFFFF - 任意のtype。 65535 より大きい値は許可されません。複数の type の場合は、複数のルールを追加します。
  • color - 色相: 0 - 無色のみ、0x0044 - 正確な色の例。陰性または 0xFFFF - 任意。 65535 より大きい値は許可されません。 [追加] のデフォルトは 1 です。 1 つのルール内の Type と hue は AND 条件で接続されます。異なるルール - または。

戻り値

void - 値なし。 var result = およびチェック =true を使用せずに、別の行で使用します。このコマンドはローカル フィルターを変更します。アイテムの数を返さず、サーバーに何も送信しません。

動作

  • 現在選択されているリストに関係なく、FIRST 引数で指定されたリストに追加します。数値的に同一のペアが繰り返される場合、重複することはありません。
  • 名前付きリストにはルール graphic/type + hue が含まれ、通常の Ignore には特定の serial が含まれます。これらは異なるフィルタです。検索でサポートされている場合は結合されます。オブジェクトは引き続き表示され、UseObject/MoveItem から直接アクセスできます。これはHide や行為の禁止ではありません。
  • リスト名では大文字と小文字が区別されません。エッジスペースが削除されます。 1 つの名前付きリストがアクティブで、初期状態はデフォルトです。 AddIgnoreList は自動的に選択しません。 SelectIgnoreList("") は、指定されたフィルターのみを無効にします。
  • このルールは、追加後にアップロードされたアイテムを含む、新しい検索に適用されます。すでに受信した配列と前の結果 FindCount は、新たな検索が行われるまで再計算されません。すべてを除外する場合を除き、ルール -1、-1 を含むリストを選択しないでください。
  • フィルターでは、FindType/FindTypeEx/FindTypesArrayEx、FindList、FindAtCoord、FindNotoriety、Count/CountEx、および拡張選択GetMobiles、GetWorldItems、UseType、 WaitTarget、Attack/AttackNearest/FindMan。 includeIgnored=true を指定すると、serial と type/hue の両方がバイパスされます。引数のない完全な列挙型 GetContent/GetEquipment、GetWorldItems()、および口頭の FindMobile(human,near,...) は、これらのルールを使用しません。
  • GetIgnoreList は、明示的に追加された serial のみを返します。名前付きリストの行はこの配列には含まれません。 IgnoreReset は serial フィルター全体をクリアし、IgnoreOff(serial) は 1 つの serial 例外を削除します。名前付きルールは保持されます。引数なしの ClearIgnoreList() は両方のビューをクリアします。
  • この状態は、クライアント プロファイル スクリプトの一般的な状態に属します。この変更は、この状態の他のスクリプトに影響します。設定は保存されたスナップショットに含まれます。ルールを変更した後、別のスクリプトは以前に取得したスナップショットを使用して検索を実行できます。次の検索では更新が表示されます。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

コマンドは独立した文です。直前のメッセージは呼び出しの開始を示し、サーバーの動作完了を確認するものではありません。

UO.Print("Calling UO.AddIgnoreList");
UO.AddIgnoreList("simple_skip", 0x0EED);

1。地面を探索するときにすべての金スタックをスキップ - 直接スクリプト

引数と実行の流れ:

  • loot_skip — 名前を設定します。欠落している色は、いずれかの hue を意味します。 FindType は 16 進文字列 ID または空の文字列を返します。ここでは結果は next_loot に保存され、アイテムは移動されません。土地を探すとmobileも見つかります。
UO.AddIgnoreList("loot_skip", 0x0EED);
UO.SelectIgnoreList("loot_skip");
var item = UO.FindType(-1, -1, "ground");
if (Truth(item == ""))
{
    UO.Print("No unignored ground object found");
    return null;
}
UO.AddObject("next_loot", item);

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

2。ローブの 1 色だけを除外する - スクリプト関数

引数と実行の流れ:

  • 0x1F03 - graphic ローブ; 0x0044 は保護色の例です。別のhueのロブ検索が可能です。これは、既知の ID による直接の MoveItem からではなく、フィルター検索による選択からの保護です。
return  RunScenario();
 object? RunScenario()
{
    UO.AddIgnoreList("keep_colored", 0x1F03, 0x0044);
    UO.SelectIgnoreList("keep_colored");
    var robe = UO.FindType(0x1F03, -1, "backpack");
    if (Truth(robe != ""))
    {
        UO.AddObject("candidate_robe", robe);
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3。 2 つの独立したセットを作成し、その 1 つであるスクリプト クラスを含めます。

引数と実行の流れ:

  • ルールは両方のリストに保存されます。ゴールドとローブの両方を同時に除外するには、両方の type を同じリストに追加します。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        UO.AddIgnoreList("skip_gold", 0x0EED);
        UO.AddIgnoreList("skip_robes", 0x1F03);
        UO.SelectIgnoreList("skip_gold");
        UO.SelectIgnoreList("skip_robes");
        return null;
    }
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.AddIgnoreList(list, type) — UO.AddIgnoreList(Any,Any)

引数: list (Any), type (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "addignorelist":

                    state.IgnoreTypeLists.Add(Text(0), ResolveType(arguments[1]),

                        arguments.Length > 2 ? NumberConversions.ToInt(arguments[2]) : -1);

                    break;

UO.AddIgnoreList(list, type, color) — UO.AddIgnoreList(Any,Any,Any)

引数: list (Any), type (Any), color (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "addignorelist":

                    state.IgnoreTypeLists.Add(Text(0), ResolveType(arguments[1]),

                        arguments.Length > 2 ? NumberConversions.ToInt(arguments[2]) : -1);

                    break;

UO.ClearBadLocationList

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

void UO.ClearBadLocationList();

SetBadLocation によって保存されたすべてのペアを削除します。

引数

パラメータはありません。

戻り値

void - 戻り値はありません。別の回線で電話してください。 true/false や歩数ではありません。

動作

  • サーバー上のマップ、キャラクター、障害物は変更されません。アプリケーションのランタイム リストのみがクリアされます。
  • すでに受信したパス配列および走行ルートの禁止スナップショットは変更されない。新しい結果を得るには、パス要求を繰り返すか、移動を再度開始します。リスト SetBadObject は個別にクリアされます。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

コマンドは独立した文です。直前のメッセージは呼び出しの開始を示し、サーバーの動作完了を確認するものではありません。

UO.Print("Calling UO.ClearBadLocationList");
UO.ClearBadLocationList();

1。リストのクリア - 直接スクリプト

引数と実行の流れ:

  • パラメータはありません。
  • 戻り値はありません。
UO.ClearBadLocationList();

2。新しい禁止セットの開始 - スクリプト関数

引数と実行の流れ:

  • まず、前のペアが削除され、次に新しいペアが追加されます。
  • これは物理的な障害やクライアント カードの変更ではありません。
return  RunScenario();
 object? RunScenario()
{
    UO.ClearBadLocationList();
    UO.SetBadLocation(1445, 1690);
    return null;
}

3。クリーニング後の繰り返し計算 - シナリオ クラス

引数と実行の流れ:

  • 目標は東の 4 セル、最適化 = true、精度 = 0 です。
  • クリア後​​の空の配列は、一般的な障害または検索制限が原因である可能性があります。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        UO.ClearBadLocationList();
        var path = UO.GetPathArray(UO.GetX() + 4, UO.GetY(), true, 0);
        if (Truth(ArrayLength(path) == 0))
        {
            UO.Print("No complete path under current constraints");
        }

        return null;
    }

    int ArrayLength(object? value) => value is System.Array array ? array.Length : 0;
    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.ClearBadLocationList() — UO.ClearBadLocationList()

引数: 引数はありません。

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "clearbadlocationlist": state.BadLocations.Clear(); return InjectionValue.Unit;

UO.ClearBadObjectList

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

void UO.ClearBadObjectList();

現在のランタイムで SetBadObject によって追加されたすべての type/hue/radius ルールを削除します。

引数

パラメータはありません。

戻り値

void - 戻り値はありません。別の回線で電話してください。 true/false や歩数ではありません。

動作

  • パラメータはありません。リストが空のときに再度呼び出しても安全です。
  • SetBadLocation を浄化したり、自然の障害物を除去したりするものではありません。新しい移動またはパスの要求では、クリアされたリストが使用されます。以前に開始されたルートは、独自のスナップショットを保存します。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

コマンドは独立した文です。直前のメッセージは呼び出しの開始を示し、サーバーの動作完了を確認するものではありません。

UO.Print("Calling UO.ClearBadObjectList");
UO.ClearBadObjectList();

1。項目ルールのリセット - 直接スクリプト

引数と実行の流れ:

  • 引数はありません。通話は別の回線に記録されます。
  • 結果 true/false はなく、削除されたルールの数もありません。
UO.ClearBadObjectList();

2。ルールセットの置換 - スクリプト関数

引数と実行の流れ:

  • クリア後​​は任意の色のtype=0x398Cのみが追加されます。
  • 半径=2は、次のルートの適切なアイテムの周囲の5×5の正方形を除外します。
return  RunScenario();
 object? RunScenario()
{
    UO.ClearBadObjectList();
    UO.SetBadObject(0x398C, -1, 2);
    return null;
}

3。アプリケーション禁止完全リセット後のパス再計算 - スクリプトクラス

引数と実行の流れ:

  • 2 つのリストは独立しています。両方のコマンドを呼び出して両方をリセットします。
  • 東の 3 つの正方形はターゲットの例です。マップの通行可能性、高度、探索限界は維持されます。空の配列も有効な結果です。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        UO.ClearBadObjectList();
        UO.ClearBadLocationList();
        var path = UO.GetPathArray(UO.GetX() + 3, UO.GetY(), true, 0);
        UO.Print(Convert.ToString(ArrayLength(path)));
        return null;
    }

    int ArrayLength(object? value) => value is System.Array array ? array.Length : 0;
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.ClearBadObjectList() — UO.ClearBadObjectList()

引数: 引数はありません。

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "clearbadobjectlist": state.BadObjects.Clear(); return InjectionValue.Unit;

UO.ClearFindList

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

void UO.ClearFindList();
void UO.ClearFindList(object? list);

現在のランタイムの 1 つの名前付き検索セット、またはすべてのセット AddFindList の定義を削除します。ルールが蓄積するのを防ぐためにフィルターを再構成する前に使用されます。

引数

  • list — ルールセットの名前 (例: 「loot」)。 | を付けずに文字列を渡します。この文字はレコード内の区切り文字として使用されます。名前では大文字と小文字は区別されません。これは、serial コンテナーや見つかったアイテムの配列ではありません。引数が欠落している場合、このランタイムの AddFindList のすべての定義が削除されます。

戻り値

void: 戻り値はありません。呼び出しを変数に割り当てたり、true/1 でテストしたりしないでください。定義の状態は推測できます UO.InfoFindList();検索自体は、UO.FindList() 経由で個別に起動されます。

動作

  • 定義は、指定されたスクリプト ランタイムの状態になります。独立した他のランタイムには独自のセットがあります。 IDE ウィンドウを閉じても、これらのルールはクリアされません。これは設定ファイルやグローバル ゲーム オブジェクトのリストではありません。
  • AddFindList はエントリを最後に追加します。繰り返しは削除されません。キットを再プロビジョニングするには、まず ClearFindList("name") を呼び出します。定義を変更しても、すでに受信したFindItem/FindCount/GetFoundItemsはクリアされません。
  • レコードにはテキスト フィールドが保存されます。数値リテラル 0x0EED は「3821」として保存され、文字列「0x0EED」は「0x0EED」として保存されます。検索では両方のオプションが数値に変換され、DeleteFindList は保存されたテキストを比較します。追加時も削除時も同じフォームを使用してください。
  • FindList の不明な名前は空の登録セットではありません。エンジンはそれを数値型のリストとして解析しようとします。数値以外の名前を使用すると、変換エラーが発生します。最後のエントリを削除した後、その名前を検索する前に新しいセットを作成してください。
  • 存在しない名前は安全です。何も削除されません。このコマンドは、ゲーム アイテムの削除、Ignore のクリア、または移動のキャンセルを行いません。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

コマンドは独立した文です。直前のメッセージは呼び出しの開始を示し、サーバーの動作完了を確認するものではありません。

UO.Print("Calling UO.ClearFindList");
UO.ClearFindList();

1。 1 つのセットの再構成 - 直接スクリプト

引数と実行の流れ:

  • BuildLoot 内では戦利品のみがクリアされます。このスクリプトの他の名前付きセットは保存されます。
BuildLoot();
BuildLoot();
UO.InfoFindList();

void BuildLoot()
{
    UO.ClearFindList("loot");
    UO.AddFindList("loot", 0x0EED, -1);
    UO.AddFindList("loot", 0x0F7A, -1);
}

2。季節セットを交換し、予備を保持 - スクリプト機能

引数と実行の流れ:

  • SEASON レジスタは重要ではありません。予備が残っています。今シーズンは新しい type/hue のみです。クリーニング後、最初にレコードが追加され、その後、名前による検索が許可されます。
return  RunScenario();
 object? RunScenario()
{
    UO.AddFindList("reserve", 0x0EED);
    UO.AddFindList("season", 0x0F7A);
    UO.ClearFindList("SEASON");
    UO.AddFindList("season", 0x0EED, 0x0044);
    UO.InfoFindList();
    return null;
}

3。新しいスクリプト モードの前に完全にリセット - スクリプト クラス

引数と実行の流れ:

  • ClearFindList() は現在のランタイムのすべての定義に影響を与えるため、ライブラリ プロシージャには通常、自己名前付きフォームの方が適しています。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        UO.AddFindList("old_loot", 0x0EED);
        UO.AddFindList("old_watch", 0x0190);
        UO.AddFindList("old_watch", 0x0191);
        UO.ClearFindList();
        UO.AddFindList("current", 0x0F7A, -1);
        var found = UO.FindList("current", "backpack");
        if (Truth(found != ""))
        {
            UO.AddObject("current_supply", found);
        }

        return null;
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.ClearFindList() — UO.ClearFindList()

引数: 引数はありません。

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "clearfindlist":

                    if (arguments.Length == 0) LegacyList("AddFindList").Clear();

                    else LegacyList("AddFindList").RemoveAll(value => value.Split('|')[0]

                        .Equals(Text(0), StringComparison.OrdinalIgnoreCase));

                    break;

UO.ClearFindList(list) — UO.ClearFindList(Any)

引数: list (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "clearfindlist":

                    if (arguments.Length == 0) LegacyList("AddFindList").Clear();

                    else LegacyList("AddFindList").RemoveAll(value => value.Split('|')[0]

                        .Equals(Text(0), StringComparison.OrdinalIgnoreCase));

                    break;

UO.ClearIgnoreList

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

void UO.ClearIgnoreList();
void UO.ClearIgnoreList(object? list);

検索例外をリセットします。名前付き - type/hue の 1 セットのみ。引数なし - すべての名前付きセットと、Ignore を通じて追加されたすべての serial。クリーンなルールで新しい並べ替えを開始すると便利です。

引数

  • list — 空ではない任意の名前、たとえば「loot_skip」。名前では大文字と小文字は区別されません。これはアイテムの名前ではなく、serial コンテナの名前でも、FindList の名前でもありません。オプション。これが存在しないということは、アクティブ リストだけでなく、全体的なリセットを意味します。

戻り値

void - 値なし。 var result = およびチェック =true を使用せずに、別の行で使用します。このコマンドはローカル フィルターを変更します。アイテムの数を返さず、サーバーに何も送信しません。

動作

  • ClearIgnoreList("名前") は、結果として DeleteIgnoreList("名前") と同等です。ここでは空の文字列は許可されません。削除せずに無効にするには、SelectIgnoreList("") を使用します。
  • 名前付きリストにはルール graphic/type + hue が含まれ、通常の Ignore には特定の serial が含まれます。これらは異なるフィルタです。検索でサポートされている場合は結合されます。オブジェクトは引き続き表示され、UseObject/MoveItem から直接アクセスできます。これはHide や行為の禁止ではありません。
  • リスト名では大文字と小文字が区別されません。エッジスペースが削除されます。 1 つの名前付きリストがアクティブで、初期状態はデフォルトです。 AddIgnoreList は自動的に選択しません。 SelectIgnoreList("") は、指定されたフィルターのみを無効にします。
  • このルールは、追加後にアップロードされたアイテムを含む、新しい検索に適用されます。すでに受信した配列と前の結果 FindCount は、新たな検索が行われるまで再計算されません。すべてを除外する場合を除き、ルール -1、-1 を含むリストを選択しないでください。
  • フィルターでは、FindType/FindTypeEx/FindTypesArrayEx、FindList、FindAtCoord、FindNotoriety、Count/CountEx、および拡張選択GetMobiles、GetWorldItems、UseType、 WaitTarget、Attack/AttackNearest/FindMan。 includeIgnored=true を指定すると、serial と type/hue の両方がバイパスされます。引数のない完全な列挙型 GetContent/GetEquipment、GetWorldItems()、および口頭の FindMobile(human,near,...) は、これらのルールを使用しません。
  • GetIgnoreList は、明示的に追加された serial のみを返します。名前付きリストの行はこの配列には含まれません。 IgnoreReset は serial フィルター全体をクリアし、IgnoreOff(serial) は 1 つの serial 例外を削除します。名前付きルールは保持されます。引数なしの ClearIgnoreList() は両方のビューをクリアします。
  • この状態は、クライアント プロファイル スクリプトの一般的な状態に属します。この変更は、この状態の他のスクリプトに影響します。設定は保存されたスナップショットに含まれます。ルールを変更した後、別のスクリプトは以前に取得したスナップショットを使用して検索を実行できます。次の検索では更新が表示されます。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

コマンドは独立した文です。直前のメッセージは呼び出しの開始を示し、サーバーの動作完了を確認するものではありません。

UO.Print("Calling UO.ClearIgnoreList");
UO.ClearIgnoreList();

1。一時セットをクリアし、残りを保持 - 直接スクリプト

引数と実行の流れ:

  • 一時的に削除されましたが、引き続きローブは除外されます。通常リスト serial はクリアされません。
UO.AddIgnoreList("temporary", 0x0EED);
UO.AddIgnoreList("keep", 0x1F03);
UO.ClearIgnoreList("temporary");
UO.SelectIgnoreList("keep");

2。以前の例外なしで検索を開始 - スクリプト関数

引数と実行の流れ:

  • 引数を指定しないと、両方のタイプの例外がスローされます。古い変数/配列はクリアされません。新しい FindType が結果を再生成します。
return  RunScenario();
 object? RunScenario()
{
    UO.ClearIgnoreList();
    var item = UO.FindType(0x0EED, -1, "ground");
    if (Truth(item != ""))
    {
        UO.AddObject("fresh_gold", item);
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3。セット内容の置換 - スクリプトクラス

引数と実行の流れ:

  • 古い並べ替えルールは新しいルールが追加される前に削除されました。ローブはすべて金色で、0x0044 のカラーリングのみです。個別のコマンド間で、別のスクリプトが中間状態を参照する場合があります。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        UO.ClearIgnoreList("sorting");
        UO.AddIgnoreList("sorting", 0x0EED);
        UO.AddIgnoreList("sorting", 0x1F03, 0x0044);
        UO.SelectIgnoreList("sorting");
        return null;
    }
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.ClearIgnoreList() — UO.ClearIgnoreList()

引数: 引数はありません。

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "clearignorelist":

                    if (arguments.Length == 0)

                    {

                        IgnoreReset();

                        state.IgnoreTypeLists.Clear();

                    }

                    else

                        state.IgnoreTypeLists.Remove(Text(0));

                    break;

UO.ClearIgnoreList(list) — UO.ClearIgnoreList(Any)

引数: list (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "clearignorelist":

                    if (arguments.Length == 0)

                    {

                        IgnoreReset();

                        state.IgnoreTypeLists.Clear();

                    }

                    else

                        state.IgnoreTypeLists.Remove(Text(0));

                    break;

UO.Count

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

int UO.Count(object? @type);
int UO.Count(object? @type, object? color);
int UO.Count(object? @type, object? color, object? container);

検索を実行し、見つかったアイテムの単位を集計します。

引数

  • type - serial ではなく、アイテムのグラフィック/type (例: 0x0EED)。 -1 または 0xFFFF - 任意の type。
  • color — アイテムの色合い。 -1 または 0xFFFF - 任意の色。 Count(type) と CountGround(type) のデフォルトは 1 です。
  • container - Count(type,color,container): my または数値 -1 - ルート所有者が self であるすべてのアイテム (機器およびネストされたバッグを含む)。 backpack/serial — 指定されたコンテナーの内容は再帰的です。 UO.Ground()、明示的な 0/「0」、ground または 1 - 地上のアイテムとモバイル。 CountEx では、数字の -1 と 0xFFFFFFFF も地面を意味しますが、具体的な serial は直接の内容のみを意味します。 CountEx は backpack を受け取り、AddObject という名前を付けます。不明な名前によりスクリプト エラーが発生します。呼び出す前に、結果の serial を確認してください。明示的な null は、欠落しているコンテナではなく地面を選択します。

戻り値

int — 見つかったアイテムの合計 max(1, Amount);すべてのモバイルに 1 が追加されます。 0 一致しません。これはスタックの数ではなく、ユニットの数です。 FindItem、FindCount、FindFullQuantity、GetFoundItems は同時に更新されます。

動作

  • Count は、1 つまたは 2 つの引数を指定して、機器やネストされたバッグなど、self が所有するアイテムを検索します。 CountGround は常に土地を検索します。これには一致するモバイルも含まれますが、self は除外されます。
  • Count(type,color,serial) はネストされたバッグをバイパスし、CountEx(type,color,serial) - 直接のコンテンツのみをバイパスします。制約 FindDistance/FindVertical が土地に適用されます。 Ignore は発見されたオブジェクトに適用されます。
  • 結果は、すでに受信したコンテナの内容によって異なります。完全なインベントリを自動的に開くことも、サーバーへのリクエストもありません。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

1 回の呼び出し結果をジャーナルに表示します。数値は bool に変換されません。配列の場合は要素数を表示します。

var result = UO.Count(0x0EED, -1, "backpack");
UO.Print("Count: " + Convert.ToString(result));

1。ゴールド単位の計算 - 直接スクリプト

引数と実行の流れ:

  • type=0x0EED、カラー=-1。エリア - バックパック;再帰性の差 Count/CountEx を考慮してください。
  • 1000 ダストユニット = 1000 から 1 フィート、1 ではありません。
var units = UO.Count(0x0EED, -1, "backpack");
UO.Print("Units: " + Convert.ToString(units));

2。単位とオブジェクト数を分けて表示 - スクリプト関数

引数と実行の流れ:

  • FindCount は、Count の直後、別の検索の前に読み取られます。
  • 50 を 2 スタックすると、2 アイテムと 100 ユニットが得られます。
return  RunScenario();
 object? RunScenario()
{
    var units = UO.Count(0x0EED, -1, "backpack");
    var items = UO.FindCount();
    UO.Print(Convert.ToString(items) + " items, " + Convert.ToString(units) + " units");
    return null;
}

3。十分な量がある場合にのみ続行 - シナリオ クラス

引数と実行の流れ:

  • 100 は、この例の単位のしきい値です。
  • これはスナップショットのチェックであり、アイテムの予約ではありません。数量はレビューと転送の間に変更される可能性があります。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var units = UO.Count(0x0EED, -1, "backpack");
        if (Truth(units >= 100))
        {
            UO.Print("Enough units known to the client");
        }
        else
        {
            UO.Print("Not enough known units");
        }

        return null;
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.Count(type) — UO.Count(Any)

引数: type (Any)

結果: int / Integer.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

public int Count(InjectionValue type) 

            => Count(ResolveType(type), -1, -1);

UO.Count(type, color) — UO.Count(Any,Any)

引数: type (Any), color (Any)

結果: int / Integer.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

public int Count(InjectionValue type, InjectionValue color) 

            => Count(ResolveType(type), NumberConversions.ToInt(color), 0);

UO.Count(type, color, container) — UO.Count(Any,Any,Any)

引数: type (Any), color (Any), container (Any)

結果: int / Integer.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

public int Count(InjectionValue type, InjectionValue color, InjectionValue container)

            => Count(ResolveType(type), NumberConversions.ToInt(color), ConvertContainer(container));

UO.CountEx

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

int UO.CountEx(object? objType, object? color, object? container);

検索を実行し、見つかったアイテムの単位を集計します。

引数

  • objType - serial ではなく、アイテムのグラフィック/type (例: 0x0EED)。 -1 または 0xFFFF - 任意の type。
  • color — アイテムの色合い。 -1 または 0xFFFF - 任意の色。 Count(type) と CountGround(type) のデフォルトは 1 です。
  • container - Count(type,color,container): my または数値 -1 - ルート所有者が self であるすべてのアイテム (機器およびネストされたバッグを含む)。 backpack/serial — 指定されたコンテナーの内容は再帰的です。 UO.Ground()、明示的な 0/「0」、ground または 1 - 地上のアイテムとモバイル。 CountEx では、数字の -1 と 0xFFFFFFFF も地面を意味しますが、具体的な serial は直接の内容のみを意味します。 CountEx は backpack を受け取り、AddObject という名前を付けます。不明な名前によりスクリプト エラーが発生します。呼び出す前に、結果の serial を確認してください。明示的な null は、欠落しているコンテナではなく地面を選択します。

戻り値

int — 見つかったアイテムの合計 max(1, Amount);すべてのモバイルに 1 が追加されます。 0 一致しません。これはスタックの数ではなく、ユニットの数です。 FindItem、FindCount、FindFullQuantity、GetFoundItems は同時に更新されます。

動作

  • Count は、1 つまたは 2 つの引数を指定して、機器やネストされたバッグなど、self が所有するアイテムを検索します。 CountGround は常に土地を検索します。これには一致するモバイルも含まれますが、self は除外されます。
  • Count(type,color,serial) はネストされたバッグをバイパスし、CountEx(type,color,serial) - 直接のコンテンツのみをバイパスします。制約 FindDistance/FindVertical が土地に適用されます。 Ignore は発見されたオブジェクトに適用されます。
  • 結果は、すでに受信したコンテナの内容によって異なります。完全なインベントリを自動的に開くことも、サーバーへのリクエストもありません。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

1 回の呼び出し結果をジャーナルに表示します。数値は bool に変換されません。配列の場合は要素数を表示します。

var result = UO.CountEx(0x0EED, -1, "backpack");
UO.Print("CountEx: " + Convert.ToString(result));

1。ゴールド単位の計算 - 直接スクリプト

引数と実行の流れ:

  • type=0x0EED、カラー=-1。エリア - バックパック;再帰性の差 Count/CountEx を考慮してください。
  • 1000 ダストユニット = 1000 から 1 フィート、1 ではありません。
var units = UO.CountEx(0x0EED, -1, "backpack");
UO.Print("Units: " + Convert.ToString(units));

2。単位とオブジェクト数を分けて表示 - スクリプト関数

引数と実行の流れ:

  • FindCount は、Count の直後、別の検索の前に読み取られます。
  • 50 を 2 スタックすると、2 アイテムと 100 ユニットが得られます。
return  RunScenario();
 object? RunScenario()
{
    var units = UO.CountEx(0x0EED, -1, "backpack");
    var items = UO.FindCount();
    UO.Print(Convert.ToString(items) + " items, " + Convert.ToString(units) + " units");
    return null;
}

3。十分な量がある場合にのみ続行 - シナリオ クラス

引数と実行の流れ:

  • 100 は、この例の単位のしきい値です。
  • これはスナップショットのチェックであり、アイテムの予約ではありません。数量はレビューと転送の間に変更される可能性があります。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var units = UO.CountEx(0x0EED, -1, "backpack");
        if (Truth(units >= 100))
        {
            UO.Print("Enough units known to the client");
        }
        else
        {
            UO.Print("Not enough known units");
        }

        return null;
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.CountEx(objType, color, container) — UO.CountEx(Any,Any,Any)

引数: objType (Any), color (Any), container (Any)

結果: int / Integer.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "countex":

                    bridge.FindType(ResolveType(arguments[0]), Arg(1), StealthContainer(2), -1, false);

                    return new InjectionValue(bridge.FindFullQuantity());

UO.CountGround

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

int UO.CountGround(object? @type);
int UO.CountGround(object? @type, object? color);

検索を実行し、見つかったアイテムの単位を集計します。

引数

  • type - serial ではなく、アイテムのグラフィック/type (例: 0x0EED)。 -1 または 0xFFFF - 任意の type。
  • color — アイテムの色合い。 -1 または 0xFFFF - 任意の色。 Count(type) と CountGround(type) のデフォルトは 1 です。

戻り値

int — 見つかったアイテムの合計 max(1, Amount);すべてのモバイルに 1 が追加されます。 0 一致しません。これはスタックの数ではなく、ユニットの数です。 FindItem、FindCount、FindFullQuantity、GetFoundItems は同時に更新されます。

動作

  • Count は、1 つまたは 2 つの引数を指定して、機器やネストされたバッグなど、self が所有するアイテムを検索します。 CountGround は常に土地を検索します。これには一致するモバイルも含まれますが、self は除外されます。
  • Count(type,color,serial) はネストされたバッグをバイパスし、CountEx(type,color,serial) - 直接のコンテンツのみをバイパスします。制約 FindDistance/FindVertical が土地に適用されます。 Ignore は発見されたオブジェクトに適用されます。
  • 結果は、すでに受信したコンテナの内容によって異なります。完全なインベントリを自動的に開くことも、サーバーへのリクエストもありません。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

1 回の呼び出し結果をジャーナルに表示します。数値は bool に変換されません。配列の場合は要素数を表示します。

var result = UO.CountGround(0x0EED, -1);
UO.Print("CountGround: " + Convert.ToString(result));

1。ゴールド単位の計算 - 直接スクリプト

引数と実行の流れ:

  • type=0x0EED、色=-1。エリアはキャラクターの隣の土地です。
  • 1000 ダストユニット = 1000 から 1 フィート、1 ではありません。
var units = UO.CountGround(0x0EED, -1);
UO.Print("Units: " + Convert.ToString(units));

2。単位とオブジェクト数を分けて表示 - スクリプト関数

引数と実行の流れ:

  • FindCount は、Count の直後、別の検索の前に読み取られます。
  • 50 を 2 スタックすると、2 アイテムと 100 ユニットが得られます。
return  RunScenario();
 object? RunScenario()
{
    var units = UO.CountGround(0x0EED, -1);
    var items = UO.FindCount();
    UO.Print(Convert.ToString(items) + " items, " + Convert.ToString(units) + " units");
    return null;
}

3。十分な量がある場合にのみ続行 - シナリオ クラス

引数と実行の流れ:

  • 100 は、この例の単位のしきい値です。
  • これはスナップショットのチェックであり、アイテムの予約ではありません。数量はレビューと転送の間に変更される可能性があります。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var units = UO.CountGround(0x0EED, -1);
        if (Truth(units >= 100))
        {
            UO.Print("Enough units known to the client");
        }
        else
        {
            UO.Print("Not enough known units");
        }

        return null;
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.CountGround(type) — UO.CountGround(Any)

引数: type (Any)

結果: int / Integer.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

public int CountGround(InjectionValue type)

            => CountGround(type, new InjectionValue(-1));

UO.CountGround(type, color) — UO.CountGround(Any,Any)

引数: type (Any), color (Any)

結果: int / Integer.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

public int CountGround(InjectionValue type, InjectionValue color)

            => bridge.Count(ResolveType(type), NumberConversions.ToInt(color), 1);

UO.DeleteFindList

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

void UO.DeleteFindList(object? list);
void UO.DeleteFindList(object? list, object? @type);
void UO.DeleteFindList(object? list, object? @type, object? color);

指定されたリスト、list/type、または list/type/color プレフィックスに一致するすべての定義を削除します。残りの設定ルールを維持しながら、1 種類のアイテムまたは特定の hue を削除できます。

引数

  • list — ルールセットの名前 (例: 「loot」)。 | を付けずに文字列を渡します。この文字はレコード内の区切り文字として使用されます。名前では大文字と小文字は区別されません。これは、serial コンテナーや見つかったアイテムの配列ではありません。
  • type - アイテムのグラフィック/type または body mobile、その serial ではありません。通常は int 0..65535 (0x0EED を含む) -1 または 0xFFFF は、検索時に任意の type を意味します。エントリごとに 1 つの値を指定します。いくつかのタイプは個別の呼び出しによって追加されます。削除するには、フィールドのテキストが比較されます。スキップすると、すべての名前エントリが削除されます。
  • color — RGB ではなく、オブジェクト/ボディの色相。 int 0..65535; 0 - 通常の hue 0、-1 または 0xFFFF - 任意。 AddFindList では、色をスキップすることは検索時に任意の hue を意味します。削除の場合、これはワイルドカードではなくリテラル フィールドです。 -1 は、-1 が明示的に保存されているエントリのみを削除します。色を省略すると、hue に関係なく、すべてのリスト/type エントリが削除されます。

戻り値

void: 戻り値はありません。呼び出しを変数に割り当てたり、true/1 でテストしたりしないでください。定義の状態は推測できます UO.InfoFindList();検索自体は、UO.FindList() 経由で個別に起動されます。

動作

  • 定義は、指定されたスクリプト ランタイムの状態になります。独立した他のランタイムには独自のセットがあります。 IDE ウィンドウを閉じても、これらのルールはクリアされません。これは設定ファイルやグローバル ゲーム オブジェクトのリストではありません。
  • AddFindList はエントリを最後に追加します。繰り返しは削除されません。キットを再プロビジョニングするには、まず ClearFindList("name") を呼び出します。定義を変更しても、すでに受信したFindItem/FindCount/GetFoundItemsはクリアされません。
  • レコードにはテキスト フィールドが保存されます。数値リテラル 0x0EED は「3821」として保存され、文字列「0x0EED」は「0x0EED」として保存されます。検索では両方のオプションが数値に変換され、DeleteFindList は保存されたテキストを比較します。追加時も削除時も同じフォームを使用してください。
  • FindList の不明な名前は空の登録セットではありません。エンジンはそれを数値型のリストとして解析しようとします。数値以外の名前を使用すると、変換エラーが発生します。最後のエントリを削除した後、その名前を検索する前に新しいセットを作成してください。
  • DeleteFindList(list,type,-1) は、2 つのパラメーターのレコード AddFindList(list,type) を削除しません。これには 3 番目のフィールドがありません。一致した重複はすべて削除されます。一致が存在しない場合は何も変わりません。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

コマンドは独立した文です。直前のメッセージは呼び出しの開始を示し、サーバーの動作完了を確認するものではありません。

UO.AddFindList("simple_loot", 0x0EED);
UO.Print("Calling UO.DeleteFindList");
UO.DeleteFindList("simple_loot");

1。同じタイプのすべての色を除外 - 直接スクリプト

引数と実行の流れ:

  • 2 つの引数は、両方のゴールド エントリ (任意の hue と hue 0x0044) を削除します。
UO.ClearFindList("loot");
UO.AddFindList("loot", 0x0EED, -1);
UO.AddFindList("loot", 0x0EED, 0x0044);
UO.AddFindList("loot", 0x0F7A);
UO.DeleteFindList("loot", 0x0EED);
var found = UO.FindList("loot", "backpack");
if (Truth(found != ""))
{
    UO.AddObject("remaining_supply", found);
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

2。 hue を 1 つだけ削除 - スクリプト関数

引数と実行の流れ:

  • 3 つの引数: 色、graphic ゴールド、特定の hue。残るはhue 0 だけです。他のセットでは、このgraphicは削除されません。
return  RunScenario();
 object? RunScenario()
{
    UO.ClearFindList("colors");
    UO.AddFindList("colors", 0x0EED, 0);
    UO.AddFindList("colors", 0x0EED, 0x0044);
    UO.DeleteFindList("colors", 0x0EED, 0x0044);
    UO.InfoFindList();
    return null;
}

3。セット全体を削除して置換を作成 - スクリプト クラス

引数と実行の流れ:

  • 1 つの引数により、古いエントリがすべて削除されます。ルールが「0x0190」行で指定されている場合は、同じ行でルールを削除するか、名前でセットを削除します。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        UO.AddFindList("old", 0x0190);
        UO.AddFindList("old", 0x0191);
        UO.DeleteFindList("OLD");
        UO.AddFindList("new_watch", 0x0190, -1);
        UO.AddFindList("new_watch", 0x0191, -1);
        UO.InfoFindList();
        return null;
    }
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.DeleteFindList(list) — UO.DeleteFindList(Any)

引数: list (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "deletefindlist":

                    LegacyList("AddFindList").RemoveAll(value => LegacyListEntryMatches(value,

                        arguments));

                    break;

UO.DeleteFindList(list, type) — UO.DeleteFindList(Any,Any)

引数: list (Any), type (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "deletefindlist":

                    LegacyList("AddFindList").RemoveAll(value => LegacyListEntryMatches(value,

                        arguments));

                    break;

UO.DeleteFindList(list, type, color) — UO.DeleteFindList(Any,Any,Any)

引数: list (Any), type (Any), color (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "deletefindlist":

                    LegacyList("AddFindList").RemoveAll(value => LegacyListEntryMatches(value,

                        arguments));

                    break;

UO.DeleteIgnoreList

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

void UO.DeleteIgnoreList(object? list);
void UO.DeleteIgnoreList(object? list, object? @type);
void UO.DeleteIgnoreList(object? list, object? @type, object? color);

名前付きフィルター全体、またはそのフィルター内で選択されたルールを削除します。他の例外を除いて、特定の type または hue を検索に戻す必要がある場合に使用します。

引数

  • list — 空ではない任意の名前、たとえば「loot_skip」。名前では大文字と小文字は区別されません。これはアイテムの名前ではなく、serial コンテナの名前でも、FindList の名前でもありません。
  • type - アイテムのグラフィック/type または body mobile。たとえば、0x0EED は金、0x0191 は女性の人体です。数値または数値文字列 ("0x0EED"、"3821"); -1/その他のネガティブ/0xFFFF - 任意のtype。 65535 より大きい値は許可されません。複数の type の場合は、複数のルールを追加します。転送されない場合は、リスト全体を削除します。色なしで渡された場合、すべてのルールはまさにこれ type になります。
  • color - 色相: 0 - 無色のみ、0x0044 - 正確な色の例。陰性または 0xFFFF - 任意。 65535 より大きい値は許可されません。 [追加] のデフォルトは 1 です。 1 つのルール内の Type と hue は AND 条件で接続されます。異なるルール - または。削除する場合は、正確なルール マスクを設定します。 -1 は、すべての個別の色ではなく、「任意の色」ルールを削除します。

戻り値

void - 値なし。 var result = およびチェック =true を使用せずに、別の行で使用します。このコマンドはローカル フィルターを変更します。アイテムの数を返さず、サーバーに何も送信しません。

動作

  • 数字 3821 と文字列 "0x0EED" は 1 つの type を表します。存在しないルールを削除しても何も変わりません。選択したリストの名前は、リスト自体が削除されても保持されます。それは空になります。
  • 名前付きリストにはルール graphic/type + hue が含まれ、通常の Ignore には特定の serial が含まれます。これらは異なるフィルタです。検索でサポートされている場合は結合されます。オブジェクトは引き続き表示され、UseObject/MoveItem から直接アクセスできます。これはHide や行為の禁止ではありません。
  • リスト名では大文字と小文字が区別されません。エッジスペースが削除されます。 1 つの名前付きリストがアクティブで、初期状態はデフォルトです。 AddIgnoreList は自動的に選択しません。 SelectIgnoreList("") は、指定されたフィルターのみを無効にします。
  • このルールは、追加後にアップロードされたアイテムを含む、新しい検索に適用されます。すでに受信した配列と前の結果 FindCount は、新たな検索が行われるまで再計算されません。すべてを除外する場合を除き、ルール -1、-1 を含むリストを選択しないでください。
  • フィルターでは、FindType/FindTypeEx/FindTypesArrayEx、FindList、FindAtCoord、FindNotoriety、Count/CountEx、および拡張選択GetMobiles、GetWorldItems、UseType、 WaitTarget、Attack/AttackNearest/FindMan。 includeIgnored=true を指定すると、serial と type/hue の両方がバイパスされます。引数のない完全な列挙型 GetContent/GetEquipment、GetWorldItems()、および口頭の FindMobile(human,near,...) は、これらのルールを使用しません。
  • GetIgnoreList は、明示的に追加された serial のみを返します。名前付きリストの行はこの配列には含まれません。 IgnoreReset は serial フィルター全体をクリアし、IgnoreOff(serial) は 1 つの serial 例外を削除します。名前付きルールは保持されます。引数なしの ClearIgnoreList() は両方のビューをクリアします。
  • この状態は、クライアント プロファイル スクリプトの一般的な状態に属します。この変更は、この状態の他のスクリプトに影響します。設定は保存されたスナップショットに含まれます。ルールを変更した後、別のスクリプトは以前に取得したスナップショットを使用して検索を実行できます。次の検索では更新が表示されます。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

コマンドは独立した文です。直前のメッセージは呼び出しの開始を示し、サーバーの動作完了を確認するものではありません。

UO.AddIgnoreList("simple_skip", 0x0EED);
UO.Print("Calling UO.DeleteIgnoreList");
UO.DeleteIgnoreList("simple_skip");

1。セット全体を削除 - 直接スクリプト

引数と実行の流れ:

  • 一時的にのみ削除されます。他のリストとIgnore(serial)は保持されます。
UO.AddIgnoreList("temporary", 0x0EED);
UO.SelectIgnoreList("temporary");
UO.DeleteIgnoreList("temporary");
var gold = UO.FindType(0x0EED, -1, "ground");

2。 1 つの type のすべての色付けを許可 - スクリプト関数

引数と実行の流れ:

  • 両方のローブ ルールは削除されましたが、ゴールド ルールは残ります。別のタイプの一般ルール -1,type-any が追加された場合、それ自体は削除されません。
return  RunScenario();
 object? RunScenario()
{
    UO.AddIgnoreList("sort", 0x1F03, 0);
    UO.AddIgnoreList("sort", 0x1F03, 0x0044);
    UO.AddIgnoreList("sort", 0x0EED);
    UO.DeleteIgnoreList("sort", 0x1F03);
    UO.SelectIgnoreList("sort");
    return null;
}

3。正確なカラールールのみを削除 - スクリプトクラス

引数と実行の流れ:

  • 68 = 0x0044: 数字の形式は同じです。染色されていないローブは引き続き除外されます。この type に hue=-1 を伴うルールがある場合、引き続き色 68 が除外されます。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        UO.AddIgnoreList("robes", 0x1F03, 0);
        UO.AddIgnoreList("robes", 0x1F03, 0x0044);
        UO.DeleteIgnoreList("robes", "0x1F03", 68);
        UO.SelectIgnoreList("robes");
        var robe = UO.FindType(0x1F03, 0x0044, "backpack");
        return null;
    }
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.DeleteIgnoreList(list) — UO.DeleteIgnoreList(Any)

引数: list (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "deleteignorelist":

                    state.IgnoreTypeLists.Remove(Text(0), arguments.Length > 1 ? ResolveType(arguments[1]) : (int?)null,

                        arguments.Length > 2 ? NumberConversions.ToInt(arguments[2]) : (int?)null);

                    break;

UO.DeleteIgnoreList(list, type) — UO.DeleteIgnoreList(Any,Any)

引数: list (Any), type (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "deleteignorelist":

                    state.IgnoreTypeLists.Remove(Text(0), arguments.Length > 1 ? ResolveType(arguments[1]) : (int?)null,

                        arguments.Length > 2 ? NumberConversions.ToInt(arguments[2]) : (int?)null);

                    break;

UO.DeleteIgnoreList(list, type, color) — UO.DeleteIgnoreList(Any,Any,Any)

引数: list (Any), type (Any), color (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "deleteignorelist":

                    state.IgnoreTypeLists.Remove(Text(0), arguments.Length > 1 ? ResolveType(arguments[1]) : (int?)null,

                        arguments.Length > 2 ? NumberConversions.ToInt(arguments[2]) : (int?)null);

                    break;

UO.FindAnyType

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

int UO.FindAnyType(object? distance, object? @type);
int UO.FindAnyType(object? distance, object? @type, object? type2);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20, object? type21);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20, object? type21, object? type22);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20, object? type21, object? type22, object? type23);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20, object? type21, object? type22, object? type23, object? type24);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20, object? type21, object? type22, object? type23, object? type24, object? type25);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20, object? type21, object? type22, object? type23, object? type24, object? type25, object? type26);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20, object? type21, object? type22, object? type23, object? type24, object? type25, object? type26, object? type27);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20, object? type21, object? type22, object? type23, object? type24, object? type25, object? type26, object? type27, object? type28);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20, object? type21, object? type22, object? type23, object? type24, object? type25, object? type26, object? type27, object? type28, object? type29);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20, object? type21, object? type22, object? type23, object? type24, object? type25, object? type26, object? type27, object? type28, object? type29, object? type30);
int UO.FindAnyType(object? distance, object? @type, object? type2, object? type3, object? type4, object? type5, object? type6, object? type7, object? type8, object? type9, object? type10, object? type11, object? type12, object? type13, object? type14, object? type15, object? type16, object? type17, object? type18, object? type19, object? type20, object? type21, object? type22, object? type23, object? type24, object? type25, object? type26, object? type27, object? type28, object? type29, object? type30, object? type31);

指定された graphic ボディの 1 つで最も近いロード済みの mobile を検索します。特定の種類の生き物を検索するために使用されます。このチームはチェストや地面にあるアイテムを探しません。FindType/FindList が必要です。

引数

  • distance — セル内の水平半径: 5 では、距離 0..5 が許可されます。距離は max(abs(dx),abs(dy)) なので、隣接する対角線も 1 です。デフォルトまたは数値が負の場合、無制限の検索ではなく UO.FindDistance() が使用されます。 0 は同じ X/Y セルを残します。ルートの長さではありません。障害物と床はこのパラメータではチェックされません。
  • type — serial や graphic オブジェクトではなく、mobile ボディのグラフィック。数値 0..65534 または 16 進文字列 (例: 0x003B)。複数の値は、OR: 数値 5、文字列 "5|6"、または数値/数値文字列のフラット配列として結合されます。フラット配列と個々の引数を混在させることができます。値の順序に優先順位はありません。数値以外のトークンは除外されます。完全に間違ったマスクでは何も検出されません。ネストされた配列は数値ではないため、無効な要素として無視されます。多次元マスクはサポートされていません。
  • type2 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type3 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type4 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type5 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type6 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type7 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type8 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type9 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type10 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type11 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type12 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type13 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type14 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type15 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type16 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type17 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type18 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type19 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type20 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type21 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type22 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type23 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type24 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type25 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type26 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type27 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type28 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type29 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type30 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • type31 — オプションの追加マスク type; typeと同じ形状。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。

戻り値

選択した mobile の int ~ serial、または適切なものがない場合は 0。これは graphic/type ではなく、ID、見つかったオブジェクトの数、または true/false: if (found != 0) { ... }、not found == true を使用します。見つかった ID は、UO.AddObject、UO.Attack、または UO.Follow に渡すことができますが、各ゲーム アクションは個別に呼び出されます。

動作

  • 検索では、クライアントによって既にダウンロードされているモバイルのみが読み取られます。破壊されたレコードとIgnoreは除外されます。呼び出し自体はターゲットを開いたり、攻撃したり、ターゲットに到達したり、サーバーにリモート オブジェクトを要求したりすることはありません。
  • 距離は幾何学的な max(abs(dx),abs(dy)) であり、ルートの長さではありません。近接しているからといって、壁がないことや、別のフロアにアクセスできることは保証されません。返品時に状態が変わる場合がございます。
  • ライフ、ステルス、視線は自動的にチェックされません。重要な場合は、GetMobiles と aliveOnly/visibleOnly または独自の小切手を使用します。サーバーが敵ステータスであっても、NPC は対象になりません。
  • FindItem、FindCount、GetFoundItems は変更されません。これらのフィールドには、以前の他のコマンドの結果が含まれる場合があります。返された ID を直接使用してください。
  • 2 から 32 までの引数: 距離と 31 マスク type まで。フラット配列を使用すると、より多くの値を渡すことができます。 type 以降の各値は、依然として body/type であり、hue や悪名ではありません。
  • このコマンドには、Z、悪名、プレイヤーの人種、服装クラスのフィルターはありません。 Self は除外されません。自分の graphic がマスクに含まれ、self が Ignore に含まれていない場合、0 の距離でserial を取得できます。
  • 最も近いものを選択します。等しい距離は、serial が小さいほど許可されます。 -1/any/0xFFFF/具象タイプのない空のマスクは 0 を与えます: コマンドには少なくとも 1 つの明示的な type が必要です。ほぼ特定の type ワイルドカードは無視されます。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

1 回の呼び出し結果をジャーナルに表示します。数値は bool に変換されません。配列の場合は要素数を表示します。

var result = UO.FindAnyType(10, 0x003B);
UO.Print("FindAnyType: " + Convert.ToString(result));

1。希望するタイプの最も近いクリーチャーを保存 - 直接スクリプト

引数と実行の流れ:

  • ID ではなく、0x003B - body。見つかった特定の mobile のクリーチャー - ID を返します。チームはZ、健康状態、または攻撃性をチェックしません。
var creature = UO.FindAnyType(10, 0x003B);
if (Truth(creature != 0))
{
    UO.AddObject("creature", creature);
    UO.Print("Distance: " + Convert.ToString(UO.GetDistance(creature)));
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

2。ビューの配列と追加のビュー - スクリプト関数

引数と実行の流れ:

  • ボディとセパレートの0x000Cが合体します。 self が見つかった場合、この例では単純にアクションをスキップします。彼は次の候補者を探しているわけではない。リクエスト自体で self を除外するには、適切なフィルター GetMobiles を使用します。
return  RunScenario();
 object? RunScenario()
{
    dynamic[] bodies = new dynamic[checked((int)(0) + 1)];
    bodies[0] = 0x003B;
    var creature = UO.FindAnyType(18, bodies, 0x000C);
    if (Truth(creature != 0) && Truth(creature != Asc(UO.GetSerial("self"), 0)))
    {
        UO.AddObject("observed_creature", creature);
    }

    return null;
}

int Asc(object? value, int fallback = 0)
{
    string text = Convert.ToString(value) ?? "";
    if (text.StartsWith("0x", StringComparison.OrdinalIgnoreCase))
        return int.TryParse(text[2..], System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.InvariantCulture, out int hex) ? hex : fallback;
    return int.TryParse(text, out int number) ? number : fallback;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3。最も近い目的のビューまでの距離を返す - スクリプト クラス

引数と実行の流れ:

  • body - graphic、半径 - 探索限界 X/Y。ヘルパーは距離または独自のコード -1 を返します。 UO.FindAnyType 自体は serial または 0 を返します。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var distance = DistanceToBody(0x003B, 8);
        if (Truth(distance >= 0) && Truth(distance <= 3))
        {
            UO.Print("Creature is within three cells");
        }

        return null;
    }

    dynamic DistanceToBody(dynamic body, dynamic radius)
    {
        var found = UO.FindAnyType(radius, body);
        if (Truth(found == 0))
        {
            return -1;
        }

        return UO.GetDistance(found);
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.FindAnyType(distance, type) — UO.FindAnyType(Any,Any)

引数: distance (Any), type (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2) — UO.FindAnyType(Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3) — UO.FindAnyType(Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4) — UO.FindAnyType(Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5) — UO.FindAnyType(Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any), type21 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any), type21 (Any), type22 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any), type21 (Any), type22 (Any), type23 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23, type24) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any), type21 (Any), type22 (Any), type23 (Any), type24 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23, type24, type25) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any), type21 (Any), type22 (Any), type23 (Any), type24 (Any), type25 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23, type24, type25, type26) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any), type21 (Any), type22 (Any), type23 (Any), type24 (Any), type25 (Any), type26 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23, type24, type25, type26, type27) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any), type21 (Any), type22 (Any), type23 (Any), type24 (Any), type25 (Any), type26 (Any), type27 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23, type24, type25, type26, type27, type28) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any), type21 (Any), type22 (Any), type23 (Any), type24 (Any), type25 (Any), type26 (Any), type27 (Any), type28 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23, type24, type25, type26, type27, type28, type29) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any), type21 (Any), type22 (Any), type23 (Any), type24 (Any), type25 (Any), type26 (Any), type27 (Any), type28 (Any), type29 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23, type24, type25, type26, type27, type28, type29, type30) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any), type21 (Any), type22 (Any), type23 (Any), type24 (Any), type25 (Any), type26 (Any), type27 (Any), type28 (Any), type29 (Any), type30 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAnyType(distance, type, type2, type3, type4, type5, type6, type7, type8, type9, type10, type11, type12, type13, type14, type15, type16, type17, type18, type19, type20, type21, type22, type23, type24, type25, type26, type27, type28, type29, type30, type31) — UO.FindAnyType(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), type (Any), type2 (Any), type3 (Any), type4 (Any), type5 (Any), type6 (Any), type7 (Any), type8 (Any), type9 (Any), type10 (Any), type11 (Any), type12 (Any), type13 (Any), type14 (Any), type15 (Any), type16 (Any), type17 (Any), type18 (Any), type19 (Any), type20 (Any), type21 (Any), type22 (Any), type23 (Any), type24 (Any), type25 (Any), type26 (Any), type27 (Any), type28 (Any), type29 (Any), type30 (Any), type31 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindAnyType(values[0], CombineMask(values, 1)))

UO.FindAtCoord

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

int UO.FindAtCoord(object? x, object? y);

現在のマップの 1 つの正確な X/Y タイル上でロードされたワールド オブジェクトを検索します。

引数

  • x — 水平ワールド座標、int 0..65535。必須;これらはコンテナ ウィンドウのピクセルではありません。
  • y は垂直世界座標、int 0..65535 です。必須。 Z、地図、type、半径には追加のオプションはありません。

戻り値

int - serial そのクライアントの結果リストで最初に一致した項目。 0: 一致しません。文字が欠落/削除されているか、座標が 0..65535 の外にあります。これはオブジェクトの ID であり、type、数量、または bool ではありません。すべての 32 ビットが保存されます。 == true や > 0 ではなく、!= 0 を確認してください。同じIDがFindItem()に書き込まれます。

動作

  • このセル上のキャラクター自身を含む、地上およびモバイル上の削除されていないアイテムをチェックします。コンテナの中身や着用品は除外されます。それらの X/Y は世界座標とみなされません。シリアルはリストIgnoreから除外されます。
  • 指定された X/Y におけるすべての Z 高さが適切です。 FindDistance と FindVertical は、この検索を正確なセルに限定しません。現在の世界のロードされたオブジェクトのみが表示されます。風景、静的、その他のマップは読み込まれません。パケットは送信されず、ターゲットは開かれず、アイテムは移動されません。
  • 各呼び出しでは、まず前の検索がクリアされます。 FindCount() はオブジェクトをカウントし、FindFullQuantity() はスタック内のユニットを合計し (モバイルは 1 を追加します)、GetFoundItems() は見つかった serial を返します。アイテムが最初に検索され、次にモバイルが検索されます。コレクション内では、現在の列挙順序が適用されます。結果を置き換える次の検索のためにリストを保存します。
  • 上記の選択順序とフィルターは、このクライアントの実装を説明しています。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

1 回の呼び出し結果をジャーナルに表示します。数値は bool に変換されません。配列の場合は要素数を表示します。

var result = UO.FindAtCoord(1445, 1690);
UO.Print("FindAtCoord: " + Convert.ToString(result));

1。 ID - ダイレクト スクリプトを 1 つ入手します

引数と実行の流れ:

  • 1445 と 1690 は世界の X/Y の例です。これらをあなたのセルに置き換えてください。 ID は 1 つの serial を保存します。 HEXは16進数で出力します。 != 0 は、数量ではなく、結果の存在をチェックします。
var id = UO.FindAtCoord(1445, 1690);
if (Truth(id != 0))
{
    UO.Print(Hex(id));
}
else
{
    UO.Print("No loaded object");
}

string Hex(object? value) => Convert.ToInt64(value).ToString("X");
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

2。文字正方形上のすべてのオブジェクトを表示 - スクリプト関数

引数と実行の流れ:

  • x/y は文字から読み取られます。 ids は現在の検索のリストを保存します。各 ID は、スタック全体を含む 1 つのオブジェクトを表します。 GetType(id) は graphic/body となります。アイテムが選択または使用されていません。
return  RunScenario();
 object? RunScenario()
{
    var x = UO.GetX("self");
    var y = UO.GetY("self");
    UO.FindAtCoord(x, y);
    var ids = UO.GetFoundItems();
    foreach (var id in ids)
    {
        UO.Print(Hex(id) + " type=" + Hex(UO.GetType(id)));
    }

    return null;
}

string Hex(object? value) => Convert.ToInt64(value).ToString("X");

3。フル機能 CountGraphicAt - スクリプトクラス

引数と実行の流れ:

  • CountGraphicAt(x, y, graphic) はセルを 1 回検索し、保存された ID を反復処理して、目的のグラフィックスを持つオブジェクトをカウントします。 graphic=0x0EED – ゴールド。 1 の合計や true/false ではなく、オブジェクト/スタックの数が返されます。 1 つのスタックが 1 つになります。関数は Main の後に完全に定義されます。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var count = CountGraphicAt(1445, 1690, 0x0EED);
        UO.Print("Objects/stacks: " + Convert.ToString(count));
        return null;
    }

    dynamic CountGraphicAt(dynamic x, dynamic y, dynamic graphic)
    {
        UO.FindAtCoord(x, y);
        var ids = UO.GetFoundItems();
        var count = 0;
        foreach (var id in ids)
        {
            if (Truth(UO.GetType(id) == graphic))
            {
                count += 1;
            }
        }

        return count;
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.FindAtCoord(x, y) — UO.FindAtCoord(Any,Any)

引数: x (Any), y (Any)

結果: int / Integer.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "findatcoord": return new InjectionValue(bridge.FindAtCoord(Arg(0), Arg(1)));

UO.FindByNotoriety

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

int UO.FindByNotoriety(object? distance, object? notoriety);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20, object? notoriety21);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20, object? notoriety21, object? notoriety22);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20, object? notoriety21, object? notoriety22, object? notoriety23);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20, object? notoriety21, object? notoriety22, object? notoriety23, object? notoriety24);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20, object? notoriety21, object? notoriety22, object? notoriety23, object? notoriety24, object? notoriety25);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20, object? notoriety21, object? notoriety22, object? notoriety23, object? notoriety24, object? notoriety25, object? notoriety26);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20, object? notoriety21, object? notoriety22, object? notoriety23, object? notoriety24, object? notoriety25, object? notoriety26, object? notoriety27);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20, object? notoriety21, object? notoriety22, object? notoriety23, object? notoriety24, object? notoriety25, object? notoriety26, object? notoriety27, object? notoriety28);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20, object? notoriety21, object? notoriety22, object? notoriety23, object? notoriety24, object? notoriety25, object? notoriety26, object? notoriety27, object? notoriety28, object? notoriety29);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20, object? notoriety21, object? notoriety22, object? notoriety23, object? notoriety24, object? notoriety25, object? notoriety26, object? notoriety27, object? notoriety28, object? notoriety29, object? notoriety30);
int UO.FindByNotoriety(object? distance, object? notoriety, object? notoriety2, object? notoriety3, object? notoriety4, object? notoriety5, object? notoriety6, object? notoriety7, object? notoriety8, object? notoriety9, object? notoriety10, object? notoriety11, object? notoriety12, object? notoriety13, object? notoriety14, object? notoriety15, object? notoriety16, object? notoriety17, object? notoriety18, object? notoriety19, object? notoriety20, object? notoriety21, object? notoriety22, object? notoriety23, object? notoriety24, object? notoriety25, object? notoriety26, object? notoriety27, object? notoriety28, object? notoriety29, object? notoriety30, object? notoriety31);

指定された悪名ステータスの 1 つを持つ最も近い他のキャラクター/NPC を検索します。最初に敵、味方、または観察対象を選択し、それから攻撃するか追跡するかを個別に決定する必要がある場合に便利です。

引数

  • distance — セル内の水平半径: 5 では、距離 0..5 が許可されます。距離は max(abs(dx),abs(dy)) なので、隣接する対角線も 1 です。デフォルトまたは数値が負の場合、無制限の検索ではなく UO.FindDistance() が使用されます。 0 は同じ X/Y セルを残します。ルートの長さではありません。障害物と床はこのパラメータではチェックされません。
  • notoriety — サーバーから受け取ったキャラクターとの関係ステータス: 0 — 不明、1 — 無実、2 — 味方、3 — 灰色、4 — 犯罪者、5 — 敵、6 — 殺人者、 7 - 無敵。数字は 1 つのステータスを意味します。 "5|6" または数値の配列 - 上記のいずれか。服の色やクラスではありません。負の数 (通常は -1)、0xFFFF、「任意」、空の文字列または空の配列は、このフィルターを個別に無効にします。有効な数値のない無効な文字列は誰も見つかりません。ステータスの順序によって優先度が設定されるわけではありません。 5 フィルターは、NPC/モンスターを自動的に選択するのではなく、敵を選択します。実際の値はサーバーによって異なります。複数の値は、OR: 数値 5、文字列 "5|6"、または数値/数値文字列のフラット配列として結合されます。フラット配列と個々の引数を混在させることができます。値の順序に優先順位はありません。数値以外のトークンは除外されます。完全に間違ったマスクでは何も検出されません。ネストされた配列は数値ではないため、無効な要素として無視されます。多次元マスクはサポートされていません。
  • notoriety2 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety3 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety4 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety5 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety6 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety7 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety8 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety9 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety10 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety11 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety12 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety13 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety14 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety15 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety16 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety17 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety18 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety19 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety20 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety21 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety22 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety23 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety24 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety25 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety26 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety27 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety28 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety29 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety30 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。
  • notoriety31 - オプションの追加の悪名マスク。悪名と同じ形態。 OR を介して以前のものと結合しますが、個別の半径、hue、Z、または優先度は設定しません。

戻り値

選択した mobile の int ~ serial、または適切なものがない場合は 0。これは graphic/type ではなく、ID、見つかったオブジェクトの数、または true/false: if (found != 0) { ... }、not found == true を使用します。見つかった ID は、UO.AddObject、UO.Attack、または UO.Follow に渡すことができますが、各ゲーム アクションは個別に呼び出されます。

動作

  • 検索では、クライアントによって既にダウンロードされているモバイルのみが読み取られます。破壊されたレコードとIgnoreは除外されます。呼び出し自体はターゲットを開いたり、攻撃したり、ターゲットに到達したり、サーバーにリモート オブジェクトを要求したりすることはありません。
  • 距離は幾何学的な max(abs(dx),abs(dy)) であり、ルートの長さではありません。近接しているからといって、壁がないことや、別のフロアにアクセスできることは保証されません。返品時に状態が変わる場合がございます。
  • ライフ、ステルス、視線は自動的にチェックされません。重要な場合は、GetMobiles と aliveOnly/visibleOnly または独自の小切手を使用します。サーバーが敵ステータスであっても、NPC は対象になりません。
  • FindItem、FindCount、GetFoundItems は変更されません。これらのフィールドには、以前の他のコマンドの結果が含まれる場合があります。返された ID を直接使用してください。
  • 少なくとも 2 つの引数: 距離、悪名。最大 32: 半径と最大 31 のマスク。より多くの値を指定するには、フラット配列を 1 つの引数として渡します。フィルタの削除: -1/any/0xFFFF/空の文字列または空の配列を個別に削除します。特定のコードが隣り合ってリストされている場合、それらのコードには制限が適用されます。
  • selfを除きます。差Zの限界としてUO.FindVertical()​​に準拠します。このコマンドにはパラメータ maxZ がありません。等しい場合、常に最も近いものを選択します - 小さい方 serial。悪名を経た後の議論は依然として悪名であり、最も近いものではなく、bodyでもありません。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

1 回の呼び出し結果をジャーナルに表示します。数値は bool に変換されません。配列の場合は要素数を表示します。

var result = UO.FindByNotoriety(12, "5|6");
UO.Print("FindByNotoriety: " + Convert.ToString(result));

1。最も近いターゲットを選択し、その名前を保存します - 直接スクリプト

引数と実行の流れ:

  • 保存した対戦相手は後で使用できます。この例では攻撃しません。現在の FindVertical は、ターゲットが X/Y に近い場合にも適用されます。
var found = UO.FindByNotoriety(12, "5|6");
if (Truth(found != 0))
{
    UO.AddObject("opponent", found);
    UO.Print("Selected: " + UO.GetName(found));
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

2。配列からのステータスのリストと別のコード - スクリプト関数

引数と実行の流れ:

  • 許可されるには敵が含まれます。別の 6 には殺人者が追加されます。ステータスは優先度によって並べ替えられるのではなく、結合されます。この例では、生存していることが判明した mobile への攻撃をリクエストしています。サーバー ルールによって何が許容されるかが決まります。
return  RunScenario();
 object? RunScenario()
{
    dynamic[] allowed = new dynamic[checked((int)(0) + 1)];
    allowed[0] = 5;
    var found = UO.FindByNotoriety(8, allowed, 6);
    if (Truth(found != 0) && !(Truth(UO.IsDead(found))))
    {
        UO.Attack(found);
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3。完全等高探索関数 - スクリプトクラス

引数と実行の流れ:

  • radius — セル内の X/Y 半径。 FindVertical(0) には同じ Z が必要です。これは床や壁の検査ではありません。この関数は ID/0 を返し、最後にスクリプトの他の部分の設定を保存します。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var found = FindOpponentAtSameLevel(10);
        if (Truth(found != 0))
        {
            UO.AddObject("same_level", found);
        }

        return null;
    }

    dynamic FindOpponentAtSameLevel(dynamic radius)
    {
        var previous = UO.FindVertical();
        try
        {
            UO.FindVertical(0);
            return UO.FindByNotoriety(radius, "5|6");
        }
        finally
        {
            UO.FindVertical(previous);
        }
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.FindByNotoriety(distance, notoriety) — UO.FindByNotoriety(Any,Any)

引数: distance (Any), notoriety (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2) — UO.FindByNotoriety(Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3) — UO.FindByNotoriety(Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4) — UO.FindByNotoriety(Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20, notoriety21) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any), notoriety21 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20, notoriety21, notoriety22) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any), notoriety21 (Any), notoriety22 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20, notoriety21, notoriety22, notoriety23) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any), notoriety21 (Any), notoriety22 (Any), notoriety23 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20, notoriety21, notoriety22, notoriety23, notoriety24) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any), notoriety21 (Any), notoriety22 (Any), notoriety23 (Any), notoriety24 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20, notoriety21, notoriety22, notoriety23, notoriety24, notoriety25) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any), notoriety21 (Any), notoriety22 (Any), notoriety23 (Any), notoriety24 (Any), notoriety25 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20, notoriety21, notoriety22, notoriety23, notoriety24, notoriety25, notoriety26) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any), notoriety21 (Any), notoriety22 (Any), notoriety23 (Any), notoriety24 (Any), notoriety25 (Any), notoriety26 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20, notoriety21, notoriety22, notoriety23, notoriety24, notoriety25, notoriety26, notoriety27) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any), notoriety21 (Any), notoriety22 (Any), notoriety23 (Any), notoriety24 (Any), notoriety25 (Any), notoriety26 (Any), notoriety27 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20, notoriety21, notoriety22, notoriety23, notoriety24, notoriety25, notoriety26, notoriety27, notoriety28) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any), notoriety21 (Any), notoriety22 (Any), notoriety23 (Any), notoriety24 (Any), notoriety25 (Any), notoriety26 (Any), notoriety27 (Any), notoriety28 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20, notoriety21, notoriety22, notoriety23, notoriety24, notoriety25, notoriety26, notoriety27, notoriety28, notoriety29) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any), notoriety21 (Any), notoriety22 (Any), notoriety23 (Any), notoriety24 (Any), notoriety25 (Any), notoriety26 (Any), notoriety27 (Any), notoriety28 (Any), notoriety29 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20, notoriety21, notoriety22, notoriety23, notoriety24, notoriety25, notoriety26, notoriety27, notoriety28, notoriety29, notoriety30) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any), notoriety21 (Any), notoriety22 (Any), notoriety23 (Any), notoriety24 (Any), notoriety25 (Any), notoriety26 (Any), notoriety27 (Any), notoriety28 (Any), notoriety29 (Any), notoriety30 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindByNotoriety(distance, notoriety, notoriety2, notoriety3, notoriety4, notoriety5, notoriety6, notoriety7, notoriety8, notoriety9, notoriety10, notoriety11, notoriety12, notoriety13, notoriety14, notoriety15, notoriety16, notoriety17, notoriety18, notoriety19, notoriety20, notoriety21, notoriety22, notoriety23, notoriety24, notoriety25, notoriety26, notoriety27, notoriety28, notoriety29, notoriety30, notoriety31) — UO.FindByNotoriety(Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any,Any)

引数: distance (Any), notoriety (Any), notoriety2 (Any), notoriety3 (Any), notoriety4 (Any), notoriety5 (Any), notoriety6 (Any), notoriety7 (Any), notoriety8 (Any), notoriety9 (Any), notoriety10 (Any), notoriety11 (Any), notoriety12 (Any), notoriety13 (Any), notoriety14 (Any), notoriety15 (Any), notoriety16 (Any), notoriety17 (Any), notoriety18 (Any), notoriety19 (Any), notoriety20 (Any), notoriety21 (Any), notoriety22 (Any), notoriety23 (Any), notoriety24 (Any), notoriety25 (Any), notoriety26 (Any), notoriety27 (Any), notoriety28 (Any), notoriety29 (Any), notoriety30 (Any), notoriety31 (Any)

結果: int / Integer.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(FindFilteredMobileSerial(-1, CombineMask(values, 1),

                        NumberConversions.ToInt(values[0]), true, bridge.GetFindVertical(), -1, false))

UO.FindCount

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

int UO.FindCount();
int UO.FindCount(object? id);

ID が渡された場合、指定されたスタック内の 1 の数を読み取ります。引数のない形式は、最後の検索のオブジェクトの数という別の意味を保持します。

引数

  • id — 特定のオブジェクトのシリアル/ID: int、10 進数/16 進数の文字列、またはセットエイリアス self、backpack、lasttarget、lastobject または名前 AddObject。これはgraphic/typeではありません。オプションの引数。 ID が渡されると、この特定のアイテムの現在の金額が読み取られます。 finditem エイリアスは、最初の検索結果を明示的に選択します。引数を指定しないと、見つかったオブジェクトの数が返されます。

戻り値

int: FindCount(id) — 指定されたスタック内のユニットの数 (Amount);通常の単一アイテムの場合は 1、不明または削除されたアイテム、誤ったエイリアス、またはモバイルの場合は 0 となります。 ID のない FindCount() は、最後の検索でのオブジェクトの数です。Amount に関係なく、1 つのスタックが 1 つのオブジェクトとみなされます。たとえば、20、50、100 の 3 つのスタック: FindCount()=3、FindCount(2 番目のスタックのID)=50、FindFullQuantity()=170。

動作

  • FindCount(id) は GetQuantity(id) の読み取りと同等で、検索はトリガーされず、FindItem/FindCount()/FindFullQuantity/GetFoundItems は変更されません。
  • ID は、type ではなく、特定のアイテムの serial を意味します。数量の変更は、次回 FindCount(id) が呼び出されたときに反映されます。削除されたアイテムの数量は 0 です。別のスタックは自動的に検索されません。
  • 引数なしの元の互換性は維持されます。 FindCount() はオブジェクトをカウントします。 FindQuantity() は見つかった 1 つのスタックを読み取り、FindFullQuantity() は最後の検索からのユニットを合計します。
  • データは、このスクリプトの最後の通常検索に属します。 FindType と 1–5 引数、FindTypeEx、Count/CountEx/CountGround は結果を置き換えます。このスナップショットを変更するために、高度なフィルター処理された文字コマンドは必要ありません。
  • 一致しない新しい検索では、FindItem、FindCount、FindFullQuantity がクリアされ、GetFoundItems がクリアされます。結果を単独で読み取るだけでは、新しい検索はトリガーされません。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

1 回の呼び出し結果をジャーナルに表示します。数値は bool に変換されません。配列の場合は要素数を表示します。

UO.FindType(0x0EED, -1, "backpack");
var result = UO.FindCount();
UO.Print("FindCount: " + Convert.ToString(result));

1。 ID による特定のスタック内の数量 - 直接スクリプト

引数と実行の流れ:

  • id=0x40001234 は、serial スタックの例です。アイテムの ID をあなたのものに置き換えてください。
  • 50 ユニットのスタックは 50 を返します。単品 - 1;不明 ID - 0。
var amount = UO.FindCount("0x40001234");
UO.Print("Units: " + Convert.ToString(amount));

2。アイテムを検索して数量を読み取る - スクリプト関数

引数と実行の流れ:

  • FindType は、type ゴールド 0x0EED、任意の hue=-1、エリア backpack を受け取り、serial を返します。
  • 返された serial 項目は FindCount に渡されます。 type 0x0EED自体はここでは転送できません。
return  RunScenario();
 object? RunScenario()
{
    var item = UO.FindType(0x0EED, -1, "backpack");
    if (Truth(item != ""))
    {
        var units = UO.FindCount(item);
        UO.Print(Convert.ToString(units));
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3。最後のターゲットと保存された名前の数量はシナリオ クラスです。

引数と実行の流れ:

  • lasttarget はオブジェクトを示す必要があります。 AddObject は、この serial を selected_stack という名前で保存します。
  • FindCount は名前を ID に解決し、金額を読み取ります。文字ターゲットが選択されている場合は、0 が返されます。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var item = UO.GetSerial("lasttarget");
        if (Truth(UO.Exists(item)))
        {
            UO.AddObject("selected_stack", item);
            UO.Print(Convert.ToString(UO.FindCount("selected_stack")));
        }

        return null;
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

4。ゴールド検索結果の測定 - 直接スクリプト

引数と実行の流れ:

  • type=0x0EED – ゴールド; color=-1 — 任意の hue; backpack - この形式のバックパックの直接の内容のみ FindType。
  • int — 見つかった項目/文字の数、0 は一致しませんでした。 1000 ユニットの 1 つのスタックは 1 つのオブジェクトとしてカウントされます。これは単位の合計ではありません。 FindFullQuantity が必要です。
var found = UO.FindType(0x0EED, -1, "backpack");
var value = UO.FindCount();
UO.Print(Convert.ToString(value));

5。項目と単位の比較 - スクリプト機能

引数と実行の流れ:

  • 間に別の検索が呼び出されるまで、4 つの読み取りすべてが 1 つの検索に属します。
  • たとえば、50 の 2 つのスタック: アイテム=2、最初のスタック=50、すべてのユニット=100;最初の ID には、1 つのスタックの一意の ID が含まれます。
return  RunScenario();
 object? RunScenario()
{
    var found = UO.FindType(0x0EED, -1, "backpack");
    UO.Print("Items: " + Convert.ToString(UO.FindCount()));
    UO.Print("First stack: " + Convert.ToString(UO.FindQuantity()));
    UO.Print("All units: " + Convert.ToString(UO.FindFullQuantity()));
    UO.Print("First ID: 0x" + Hex(UO.FindItem()));
    return null;
}

string Hex(object? value) => Convert.ToInt64(value).ToString("X");

6。次の検索まで結果を保存 - スクリプト クラス

引数と実行の流れ:

  • 最初の type は金で、2 番目の 0x0F7A は別のタイプの試薬です。新しいチームは全体的なショットを変更します。
  • 保存された番号は最初の検索の番号のままです。 2 番目の読み取り値は、一致しない場合でも試薬に適用されます。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var found = UO.FindType(0x0EED, -1, "backpack");
        var saved = UO.FindCount();
        found = UO.FindType(0x0F7A, -1, "backpack");
        UO.Print("Saved: " + Convert.ToString(saved));
        UO.Print("Current: " + Convert.ToString(UO.FindCount()));
        return null;
    }
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.FindCount() — UO.FindCount()

引数: 引数はありません。

結果: int / Integer.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

public int FindCount() => bridge.FindCount();

UO.FindCount(id) — UO.FindCount(Any)

引数: id (Any)

結果: int / Integer.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

public int FindCount(InjectionValue id) => bridge.GetQuantity(GetObject(id));

UO.FindDistance

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

int UO.FindDistance();
void UO.FindDistance(object? value);

デフォルトの水平検索半径を読み取るか変更します。

引数

  • value - オプションのint。引数なし - 読み取り;値 — 設定。値は 0..255 の範囲に制限されます。マイナスはノーリミットではなく0になります。新しいランタイム: 18;復元された状態には異なる値が含まれる場合があります。小数はゼロに切り捨てられます。数値文字列 double/0x も使用できます。暗黙的な変換を回避するには、int を使用します。

戻り値

引数なし: int は現在の制限 (セル内の距離) であり、ID、オブジェクトの数、または bool は見つかりません。 0 は失敗ではなくゼロ限界を意味します。値あり: void - 値なし。これはtrue/false や古い設定ではありません。インストールしたら、FindDistance() を読み取って、保存されている値を確認します。

動作

  • 距離: クライアント範囲の現在の参照点からの max(abs(dx), abs(dy))。対角線上の正方形は 1 つとしてカウントされます。境界線がオンになります。 0 の場合、同じ X/Y 上のオブジェクトのみが適しています。モバイルの移動の場合、距離にはステップのキューの最終位置が考慮されます。
  • 設定は現在のスクリプトのランタイムに保存されます。そのプロシージャでは単一の値が使用されます。独立したランタイムには個別の設定があります。読み取りと書き込みでは、検索、FindItem/FindCount/GetFoundItems のクリア、パケットの送信、キャラクターの移動、または遠くのオブジェクトのロードはトリガーされません。
  • FindTypeEx と FindTypesArrayEx は、地上で探索するときにこれらの制限を使用しますが、コンテナ内では使用しません。残りのフィルターは、type、hue、Ignore、およびロードされたオブジェクトの存在です。 FindAtCoord は両方の制限を無視します。拡張コマンドでは、明示的な距離/maxZ で設定をオーバーライドできます。このようなパラメータの -1 は、設定自体を -1 に設定するのではなく、設定を取得することを意味します。 FindList はコンテナを検索するときに Z もフィルタリングします。指定されたコンテナ例外は適用されません。
  • 一時的に検索する前に、値を保存して、Finally に戻します。インストールは自動的にはキャンセルされません。最後に、正常に完了し、スクリプト エラーが捕捉された場合に動作します。非常停止をクリーニング機構として使用することはできません。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

1 回の呼び出し結果をジャーナルに表示します。数値は bool に変換されません。配列の場合は要素数を表示します。

var result = UO.FindDistance();
UO.Print("FindDistance: " + Convert.ToString(result));

1。読み取り、設定、および範囲制限 - 直接スクリプト

引数と実行の流れ:

  • 前回は実際の設定を保存します。 value:=5 は通常の制限を設定します。 1000は255までのリミットを示します。 Print は、引数なしの別の呼び出しとして結果を読み取ります。ようやく以前に戻ります。
var previous = UO.FindDistance();
try
{
    UO.FindDistance(5);
    UO.Print(Convert.ToString(UO.FindDistance()));
    UO.FindDistance(1000);
    UO.Print(Convert.ToString(UO.FindDistance()));
}
finally
{
    UO.FindDistance(previous);
}

2。 Temporary Ground Search - Script Function

引数と実行の流れ:

  • 前に呼び出しコードの設定を保存します。 5 は FindDistance のみを変更します。 2 番目の制限は変わりません。 0x0EED - ゴールドグラフィック、-1 - 任意の hue、Container=-1 - ワールド、false - コンテナ再帰なし。 ID - 1 serial; != 0 は空き状況を確認します。 FindCount はオブジェクト/スタック全体をカウントします。最後に、結果のリストではなく、設定を復元します。
return  RunScenario();
 object? RunScenario()
{
    var previous = UO.FindDistance();
    try
    {
        UO.FindDistance(5);
        var id = UO.FindTypeEx(0x0EED, -1, -1, false);
        if (Truth(id != 0))
        {
            UO.Print(Hex(id) + ":" + Convert.ToString(UO.FindCount()));
        }
        else
        {
            UO.Print("0");
        }
    }
    finally
    {
        UO.FindDistance(previous);
    }

    return null;
}

string Hex(object? value) => Convert.ToInt64(value).ToString("X");
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3。フル機能 CountGroundInRange - スクリプトクラス

引数と実行の流れ:

  • CountGroundInRange(graphic, 半径, 高さ) は両方の制限を保存し、半径=5 と高さ=10 を設定し、graphic=0x0EED を探して、FindCount() を返します。スタックは 1 つのオブジェクトとみなされます。完全な関数は Main の後に与えられます。最終的には、リターンで終了する場合でも両方の制限を復元します。検索結果は引き続き利用可能です。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var count = CountGroundInRange(0x0EED, 5, 10);
        UO.Print(Convert.ToString(count));
        return null;
    }

    dynamic CountGroundInRange(dynamic graphic, dynamic radius, dynamic height)
    {
        var oldDistance = UO.FindDistance();
        var oldVertical = UO.FindVertical();
        try
        {
            UO.FindDistance(radius);
            UO.FindVertical(height);
            UO.FindTypeEx(graphic, -1, -1, false);
            return UO.FindCount();
        }
        finally
        {
            UO.FindDistance(oldDistance);
            UO.FindVertical(oldVertical);
        }
    }
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.FindDistance() — UO.FindDistance()

引数: 引数はありません。

結果: int / Integer.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "finddistance":

                    if (arguments.Length > 0) { bridge.SetFindDistance(Arg(0)); return InjectionValue.Unit; }

                    return new InjectionValue(bridge.GetFindDistance());

UO.FindDistance(value) — UO.FindDistance(Any)

引数: value (Any)

結果: void / Unit.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "finddistance":

                    if (arguments.Length > 0) { bridge.SetFindDistance(Arg(0)); return InjectionValue.Unit; }

                    return new InjectionValue(bridge.GetFindDistance());

UO.FindFullQuantity

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

dynamic UO.FindFullQuantity();

最後の検索スナップショット内のユニットの合計数を読み取ります。

引数

パラメータはありません。

戻り値

int — 見つかったアイテムの合計 max(1, Amount);見つかった各文字は 1 を追加します。 0 一致しません。 50 を 2 スタックすると 100 が生成され、FindCount は 2 が生成されます。これは検索時のスナップショットであり、常に更新される量ではありません。

動作

  • データは、このスクリプトの最後の通常検索に属します。 FindType と 1–5 引数、FindTypeEx、Count/CountEx/CountGround は結果を置き換えます。このスナップショットを変更するために、高度なフィルター処理された文字コマンドは必要ありません。
  • 一致しない新しい検索では、FindItem、FindCount、FindFullQuantity がクリアされ、GetFoundItems がクリアされます。結果を単独で読み取るだけでは、新しい検索はトリガーされません。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

1 回の呼び出し結果をジャーナルに表示します。数値は bool に変換されません。配列の場合は要素数を表示します。

UO.FindType(0x0EED, -1, "backpack");
object? result = UO.FindFullQuantity();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1。ゴールド検索結果の測定 - 直接スクリプト

引数と実行の流れ:

  • type=0x0EED – ゴールド; color=-1 — 任意の hue; backpack - この形式のバックパックの直接の内容のみ FindType。
  • int — 見つかったアイテムの合計 max(1, Amount);見つかった各文字は 1 を追加します。 0 一致しません。 50 を 2 スタックすると 100 が生成され、FindCount は 2 が生成されます。これは検索時のスナップショットであり、常に更新される量ではありません。
var found = UO.FindType(0x0EED, -1, "backpack");
var value = UO.FindFullQuantity();
UO.Print(Convert.ToString(value));

2。項目と単位の比較 - スクリプト機能

引数と実行の流れ:

  • 間に別の検索が呼び出されるまで、4 つの読み取りすべてが 1 つの検索に属します。
  • たとえば、50 の 2 つのスタック: アイテム=2、最初のスタック=50、すべてのユニット=100;最初の ID には、1 つのスタックの一意の ID が含まれます。
return  RunScenario();
 object? RunScenario()
{
    var found = UO.FindType(0x0EED, -1, "backpack");
    UO.Print("Items: " + Convert.ToString(UO.FindCount()));
    UO.Print("First stack: " + Convert.ToString(UO.FindQuantity()));
    UO.Print("All units: " + Convert.ToString(UO.FindFullQuantity()));
    UO.Print("First ID: 0x" + Hex(UO.FindItem()));
    return null;
}

string Hex(object? value) => Convert.ToInt64(value).ToString("X");

3。次の検索まで結果を保存 - スクリプト クラス

引数と実行の流れ:

  • 最初の type は金で、2 番目の 0x0F7A は別のタイプの試薬です。新しいチームは全体的なショットを変更します。
  • 保存された番号は最初の検索の番号のままです。 2 番目の読み取り値は、一致しない場合でも試薬に適用されます。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var found = UO.FindType(0x0EED, -1, "backpack");
        var saved = UO.FindFullQuantity();
        found = UO.FindType(0x0F7A, -1, "backpack");
        UO.Print("Saved: " + Convert.ToString(saved));
        UO.Print("Current: " + Convert.ToString(UO.FindFullQuantity()));
        return null;
    }
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.FindFullQuantity() — UO.FindFullQuantity()

引数: 引数はありません。

結果: dynamic / Any.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "findfullquantity": return new InjectionValue(bridge.FindFullQuantity());

UO.FindItem

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

dynamic UO.FindItem();

最後の通常検索の最初の結果の serial を読み取ります。

引数

パラメータはありません。

戻り値

最初に見つかったオブジェクトのint - serial/ID、結果がない場合は0。これは数値の serial ですが、FindType は 16 進文字列または空の文字列を返します。 type が戻りません。

動作

  • データは、このスクリプトの最後の通常検索に属します。 FindType と 1–5 引数、FindTypeEx、Count/CountEx/CountGround は結果を置き換えます。このスナップショットを変更するために、高度なフィルター処理された文字コマンドは必要ありません。
  • 一致しない新しい検索では、FindItem、FindCount、FindFullQuantity がクリアされ、GetFoundItems がクリアされます。結果を単独で読み取るだけでは、新しい検索はトリガーされません。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

1 回の呼び出し結果をジャーナルに表示します。数値は bool に変換されません。配列の場合は要素数を表示します。

UO.FindType(0x0EED, -1, "backpack");
object? result = UO.FindItem();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));

1。ゴールド検索結果の測定 - 直接スクリプト

引数と実行の流れ:

  • type=0x0EED – ゴールド; color=-1 — 任意の hue; backpack - この形式のバックパックの直接の内容のみ FindType。
  • 最初に見つかったオブジェクトのint - serial/ID、結果がない場合は0。これは数値の serial ですが、FindType は 16 進文字列または空の文字列を返します。 type が戻りません。
var found = UO.FindType(0x0EED, -1, "backpack");
var value = UO.FindItem();
UO.Print(Convert.ToString(value));

2。項目と単位の比較 - スクリプト機能

引数と実行の流れ:

  • 間に別の検索が呼び出されるまで、4 つの読み取りすべてが 1 つの検索に属します。
  • たとえば、50 の 2 つのスタック: アイテム=2、最初のスタック=50、すべてのユニット=100;最初の ID には、1 つのスタックの一意の ID が含まれます。
return  RunScenario();
 object? RunScenario()
{
    var found = UO.FindType(0x0EED, -1, "backpack");
    UO.Print("Items: " + Convert.ToString(UO.FindCount()));
    UO.Print("First stack: " + Convert.ToString(UO.FindQuantity()));
    UO.Print("All units: " + Convert.ToString(UO.FindFullQuantity()));
    UO.Print("First ID: 0x" + Hex(UO.FindItem()));
    return null;
}

string Hex(object? value) => Convert.ToInt64(value).ToString("X");

3。次の検索まで結果を保存 - スクリプト クラス

引数と実行の流れ:

  • 最初の type は金で、2 番目の 0x0F7A は別のタイプの試薬です。新しいチームは全体的なショットを変更します。
  • 保存された番号は最初の検索の番号のままです。 2 番目の読み取り値は、一致しない場合でも試薬に適用されます。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        var found = UO.FindType(0x0EED, -1, "backpack");
        var saved = UO.FindItem();
        found = UO.FindType(0x0F7A, -1, "backpack");
        UO.Print("Saved: " + Convert.ToString(saved));
        UO.Print("Current: " + Convert.ToString(UO.FindItem()));
        return null;
    }
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.FindItem() — UO.FindItem()

引数: 引数はありません。

結果: dynamic / Any.

呼び出し時:

内部実装のコードです。単独のスクリプトとして実行できません。

case "finditem": return new InjectionValue(bridge.FindItem);

UO.FindList

Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어

C# のシグネチャ

string UO.FindList(object? list);
string UO.FindList(object? list, object? container);
string UO.FindList(object? list, object? container, object? distance);
string UO.FindList(object? list, object? container, object? distance, object? notoriety);
string UO.FindList(object? list, object? container, object? distance, object? notoriety, object? nearest);
string UO.FindList(object? list, object? container, object? distance, object? notoriety, object? nearest, object? maxZ);
string UO.FindList(object? list, object? container, object? distance, object? notoriety, object? nearest, object? maxZ, object? includeIgnored);

複数のtype/hueにまたがって、ダウンロードしたアイテムやモバイルを検索します。最初の serial を文字列として返し、FindItem、FindCount、GetFoundItems の順序付けされた結果全体を保存します。

引数

  • list — 空ではないセット AddFindList の名前。または数値 type のフラット配列。または、|、カンマ、セミコロン、またはスペースで区切られたタイプの文字列 (「0x0EED|0x0F7A」など)。配列/文字列型は、任意の hue を使用します。配列内の [type,hue] ペアはサポートされていません。 hue の場合は、名前付きセットを作成します。エントリの順序によって優先度が決まります。アイテムのグラフィック/type は、serial ではなく、body mobile です。通常、int 0..65535 (0x0EED を含む)。 -1 または 0xFFFF は、検索時に任意の type を意味します。エントリごとに 1 つの値を指定します。いくつかのタイプは個別の呼び出しによって追加されます。
  • container — デフォルト - 1: ルートコンテナがキャラクターであるアイテム (ネストされたバッグや装備を含む)。 「my」=-1。 ground、「ground」、UO.Ground()、数値0 または 1 で世界を選択します: self を除く地上およびモバイルのアイテム。コンテナ >1 の「backpack」または serial は、再帰なしで直接コンテンツのみを検索します。オブジェクトのエイリアスは serial に解決されます。エイリアスが間違っていると 0 となる可能性があるため、事前に GetSerial で確認してください。
  • distance — max(abs(dx),abs(dy)) によるセルの非負の半径。対角 - 1 つのセル。検索 ground に有効です。コンテナの直接の内容は距離によって制限されません。デフォルトでは、負の引数を指定すると、UO.FindDistance() が使用されます。 0 - 同じX/Y。
  • notoriety — デフォルト - 1、任意のコード。単一の数値、文字列「5|6」、または数値のフラット配列で、許可される携帯電話コードを指定します。このフィルターではアイテムが除外されます。コード: 0 不明、1 無実、2 味方、3 灰色、4 犯罪者、5 敵、6 殺人者、7 無敵。関係の意味はサーバーによって決定されます。特定のコードのない空のマスク /any/-1 には制限がありません。ワイルドカードとコードを混合する場合、特定のコードには制限が残ります。数値以外のトークンは、有効なトークンの次に無視されます。誤ったトークンだけのマスクでは何も見つかりません。
  • nearest — デフォルトの false。 false/0: リストエントリの優先順位が最初で、次に優先順位が低くなります serial。 true/1: 最初に距離、次に録画優先、次にserial。これは命令であり、追加のフィルターではありません。
  • maxZ — Z とキャラクターの間の許容される絶対差 (両端を含む)。デフォルトまたは負の引数は UO.FindVertical() です。 0 は同じ Z のみを許可します。明示的な serial コンテナ >1 の場合、ロードされたコンテナの Z を取得します (コンテナがない場合は、Z のもの)。他のモードの場合 - Z 候補。ガンプ内の物の座標は世界の高さではありません。
  • includeIgnored — デフォルトでは、false: このランタイムの Ignore からの serial は除外されます。 true/1 はこの検索にのみ含まれ、Ignore はクリアされません。

戻り値

string: 最初の結果の 16 進数 - serial (例: "0x40000011")、または一致するものがなかった場合は空の文字列 ""。これは type ではなく ID、数量ではなく bool です。チェック結果 != "" であり、結果 == true ではありません。通常の空ではないクエリでは、FindItem は同じ ID 番号、FindCount() - 個別のオブジェクトの数、GetFoundItems() - それらの数値 serial の配列を格納します。

動作

  • 1 から 7 の位置引数。スキップできるのは尾部のみです。 maxZ を指定するには、前述の引数を明示的に渡します。検索はローカルにロードされた状態に基づいて同期的に行われます。つまり、コンテナを開いたり、コンテンツをロードしたり、見通し線や可用性をチェックしたり、攻撃したりしません。
  • 各オブジェクトは、複数のルールに一致する場合でも、一度だけ組み込まれます。その優先順位は、最初に一致したエントリです。不明な名前は型文字列として解析されようとします。読み取れない type/hue は変換エラーを引き起こします。
  • 空ではないクエリは、選択前に前の FindItem/FindCount/GetFoundItems をクリアします。一致しないと空の結果が残ります。例外: 空の配列または空の文字列リストは、検索前に "" を返し、以前の結果を保持します。このような呼び出しの後は、FindCount を新しい結果としてカウントしないでください。
  • AddFindList/ClearFindList/DeleteFindList の定義を変更しても、すでに見つかったセットは変更されません。このランタイムの他の検索は FindItem と配列全体を置き換えるため、ネストされた検索の前に GetFoundItems を保存します。
  • 定義は、指定されたスクリプト ランタイムの状態になります。独立した他のランタイムには独自のセットがあります。 IDE ウィンドウを閉じても、これらのルールはクリアされません。これは設定ファイルやグローバル ゲーム オブジェクトのリストではありません。
  • AddFindList はエントリを最後に追加します。繰り返しは削除されません。キットを再プロビジョニングするには、まず ClearFindList("name") を呼び出します。定義を変更しても、すでに受信したFindItem/FindCount/GetFoundItemsはクリアされません。
  • レコードにはテキスト フィールドが保存されます。数値リテラル 0x0EED は「3821」として保存され、文字列「0x0EED」は「0x0EED」として保存されます。検索では両方のオプションが数値に変換され、DeleteFindList は保存されたテキストを比較します。追加時も削除時も同じフォームを使用してください。
  • FindList の不明な名前は空の登録セットではありません。エンジンはそれを数値型のリストとして解析しようとします。数値以外の名前を使用すると、変換エラーが発生します。最後のエントリを削除した後、その名前を検索する前に新しいセットを作成してください。

単独で実行できる C# スクリプト

各サンプルは個別のファイル .csx として保存し、IDE で実行できます。 UO オブジェクトと待機関数は、現在のゲーム セッションのホストを提供します。デモの serial の名前、座標、アドレスを自分のものに置き換えます。

簡単な例

このコードを独立した .csx ファイルとして実行します。引数は呼び出しに直接記載されています。例の名前、serial、アドレスを自分の値に置き換えてください。

1 回の呼び出し結果をジャーナルに表示します。数値は bool に変換されません。配列の場合は要素数を表示します。

var result = UO.FindList(new[] { 0x0EED }, "backpack");
UO.Print("FindList: " + Convert.ToString(result));

1。優先度によってリソースを選択し、1 つのスタックを転送 - 直接スクリプト

引数と実行の流れ:

  • false では、たとえ遠距離であっても、ゴールドが 2 番目の type よりも優先されます。半径 2 および maxZ=5 により候補が制限されます。物を受け取る権利を保証するものではありません。
  • これは実際のゲーム アクションです。最初に見つかったオブジェクトのみが転送されます。結果 MoveItem は、サーバーが移動全体を確認したことを意味するものではありません。
BuildLoot();
var item = UO.FindList("loot", "ground", 2, -1, false, 5);
if (Truth(item == ""))
{
    return null;
}
var accepted = UO.MoveItem(item, 0, "backpack");
if (Truth(accepted == 0))
{
    UO.Print("Move was not accepted");
}

void BuildLoot()
{
    UO.ClearFindList("loot");
    UO.AddFindList("loot", 0x0EED, -1);
    UO.AddFindList("loot", 0x0F7A, -1);
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

2。 2 つの悪名のうち最も近い mobile を保存 - スクリプト関数

引数と実行の流れ:

  • 7 つのパラメータ: 2 つの body、ワールド、半径 12、コード 5 または 6、最も近いものから順、差分 Z 10 以下、無視され除外されます。あるのは選択と保存だけです。攻撃スクリプトは適切な条件を個別にチェックする必要があります。
return  RunScenario();
 object? RunScenario()
{
    var target = UO.FindList("0x0190|0x0191", "ground", 12, "5|6", true, 10, false);
    if (Truth(target != ""))
    {
        UO.AddObject("candidate", target);
        UO.Print("Candidate: " + UO.GetName(target));
    }

    return null;
}

bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;

3。配列から複数の種類の株を数える - スクリプト クラス

引数と実行の流れ:

  • 変数 type[1] を宣言すると、このエンジンにインデックス 0 と 1 が作成されます。スタック数ではなく、2 つのタイプの単位が合計されます。 backpack は直接的なコンテンツに限定されます。インサートバッグはここには含まれません。
return  new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenario();
class ScriptScenario
{
    private readonly global::ClassicUO.CSharp.CSharpGameApi UO;
    private readonly Func<int, Task> WaitAsync;
    private readonly string[] Args;
    private readonly CancellationToken Cancellation;
    private readonly Action Checkpoint;
    public ScriptScenario(global::ClassicUO.CSharp.CSharpGameApi api, Func<int, Task> wait, string[] args, CancellationToken cancellation, Action checkpoint)
    {
        UO = api;
        WaitAsync = wait;
        Args = args;
        Cancellation = cancellation;
        Checkpoint = checkpoint;
    }

     public object? RunScenario()
    {
        dynamic[] types = new dynamic[checked((int)(1) + 1)];
        types[0] = 0x0EED;
        types[1] = 0x0F7A;
        var first = UO.FindList(types, "backpack");
        var total = 0;
        if (Truth(first != ""))
        {
            var items = UO.GetFoundItems();
            foreach (var item in items)
            {
                total += UO.FindCount(item);
            }
        }

        if (Truth(total < 100))
        {
            UO.Print("Stock below limit: " + Convert.ToString(total));
        }

        return null;
    }

    bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}

コマンドの実装

C# は大文字と小文字を区別します。正確な UO 名を使用してください。数値フラグは 0 と比較し、戻り値が bool の場合だけ bool を使います。

UO.FindList(list) — UO.FindList(Any)

引数: list (Any)

結果: string / String.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(CompactFindList(values))

UO.FindList(list, container) — UO.FindList(Any,Any)

引数: list (Any), container (Any)

結果: string / String.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(CompactFindList(values))

UO.FindList(list, container, distance) — UO.FindList(Any,Any,Any)

引数: list (Any), container (Any), distance (Any)

結果: string / String.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(CompactFindList(values))

UO.FindList(list, container, distance, notoriety) — UO.FindList(Any,Any,Any,Any)

引数: list (Any), container (Any), distance (Any), notoriety (Any)

結果: string / String.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(CompactFindList(values))

UO.FindList(list, container, distance, notoriety, nearest) — UO.FindList(Any,Any,Any,Any,Any)

引数: list (Any), container (Any), distance (Any), notoriety (Any), nearest (Any)

結果: string / String.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(CompactFindList(values))

UO.FindList(list, container, distance, notoriety, nearest, maxZ) — UO.FindList(Any,Any,Any,Any,Any,Any)

引数: list (Any), container (Any), distance (Any), notoriety (Any), nearest (Any), maxZ (Any)

結果: string / String.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(CompactFindList(values))

UO.FindList(list, container, distance, notoriety, nearest, maxZ, includeIgnored) — UO.FindList(Any,Any,Any,Any,Any,Any,Any)

引数: list (Any), container (Any), distance (Any), notoriety (Any), nearest (Any), maxZ (Any), includeIgnored (Any)

結果: string / String.

呼び出し時:

呼び出し時には保存済みのハンドラー delegate を実行します。登録メソッドは API の構築時にこの delegate を作成します。

内部実装のコードです。単独のスクリプトとして実行できません。

values => new InjectionValue(CompactFindList(values))

Clone this wiki locally