Repository navigation
EN UO Topic party
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
Home · C# · IDE · UO API · A–Z · Examples · Languages
Group invitations, members, exit and messages. These transactions differ from general speech and commercial exchange.
| Topic | Commands and explanations |
|---|---|
| InParty | UO.InParty |
| Invite | UO.InviteToParty |
| Accept | UO.PartyAcceptInvite |
| Decline | UO.PartyDeclineInvite |
| Leave | UO.PartyLeave |
| Remove Member | UO.RemoveFromParty |
| Members List | UO.PartyMembersList |
| PartySay | UO.PartySay |
| Private Party Message | UO.PartyPrivateMessageTo |
UO.InParty · UO.InviteToParty · UO.PartyAcceptInvite · UO.PartyDeclineInvite · UO.PartyLeave · UO.RemoveFromParty · UO.PartyMembersList · UO.PartyCanLootMe · UO.PartySay · UO.PartyPrivateMessageTo
Each command card has several independent scenarios: direct code, functions and classes. Below are selected short scenarios; restrictions and full analysis are in the cards.
Parameters, result and all scenarios
var members = UO.PartyMembersList();
UO.Print(UO.GetArrayLength(members));Parameters, result and all scenarios
UO.PartySay("Ready");Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
int UO.InParty();Checks the presence of a current group based on the client's Party status.
There are no parameters.
int 1 — non-zero serial of the leader is known in Party. int 0 - there is no leader. This is not the number of participants or the index of your own character in the list.
The result of the command is a numeric flag: 1 means a fulfilled condition, 0 means an unfulfilled one. After var result = command(...) check if (result != 0) or if (result == 0). Save the result of one call: a repeated call can perform the action again or read the state that has already changed.
- The local client model is read; There are no requests to the server, no waiting or moving.
- The result refers to the moment of reading. After UO.Wait or other action, the object and its flags may change.
- This client checks Party.Leader, not just the number of non-empty list lines. If the invitation is accepted, the status will change after the server update.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.
var result = UO.InParty();
UO.Print("InParty: " + Convert.ToString(result));Parameters and execution flow:
- There are no arguments. The current character's group is checked.
- The team does not create a group and does not accept the invitation.
if (Truth(UO.InParty()))
{
UO.Print("Party is active");
}
else
{
UO.Print("No active party");
}
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;Parameters and execution flow:
- inParty is a bool number, not the number of participants.
- Reusing a variable does not reread the changed group.
return RunScenario();
object? RunScenario()
{
var inParty = UO.InParty();
UO.Print("Party 1/0: " + Convert.ToString(inParty));
return null;
}Parameters and execution flow:
- No more than 10 pauses for 200 ms; The cycle is limited to approximately two seconds plus command execution.
- Waiting does not send invitations or guarantee membership in the group.
return await new ScriptScenario(UO, WaitAsync, Args, Cancellation, Checkpoint).RunScenarioAsync();
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;
}
async public Task<object?> RunScenarioAsync()
{
var attempts = 0;
while (Truth(UO.InParty() == 0) && Truth(attempts < 10))
{
await Delay(200);
attempts = attempts + 1;
}
if (Truth(UO.InParty()))
{
UO.Print("Party state received");
}
else
{
UO.Print("Party still absent");
}
return null;
}
Task Delay(object? milliseconds) => WaitAsync(checked((int)Convert.ToDouble(milliseconds)));
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: int / Integer.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.InParty:bridge.InParty().
Internal implementation code; this is not a standalone script.
case "inparty": return new InjectionValue(bridge.InParty());Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.InviteToParty(object? objID);Requests an invitation for a character to join the group.
-
objID— Serial/ID object: int, numeric/hex string or set alias, for example "lasttarget". This is not a graphic/type. Check the loaded object before taking action.
void - no value. Call on a separate line; completion does not confirm the server's action.
- PartyInvite puts serial through _manager.QueueTarget, then calls RequestPartyInviteByTarget. First, the target's queue is prepared, then the invitation request is sent.
- Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.InviteToParty");
UO.InviteToParty(UO.GetSerial("lasttarget"));Parameters and execution flow:
- Requests an invitation for a character to join the group.
var id = UO.GetSerial("lasttarget");
if (Truth(UO.Exists(id)))
{
UO.InviteToParty(id);
}
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;Parameters and execution flow:
- PartyInvite puts serial through _manager.QueueTarget, then calls RequestPartyInviteByTarget. First, the target's queue is prepared, then the invitation request is sent.
return RunScenario();
object? RunScenario()
{
var id = UO.GetSerial("self");
if (Truth(UO.Exists(id)))
{
UO.InviteToParty(id);
}
return null;
}
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;Parameters and execution flow:
- Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
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()
{
ApplyToLoaded(UO.GetSerial("lasttarget"));
return null;
}
void ApplyToLoaded(dynamic id)
{
if (Truth(UO.Exists(id)))
{
UO.InviteToParty(id);
}
}
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: objID (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.PartyInvite:bridge.PartyInvite(Arg(0)). -
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility::Arg:Arg(0).
Internal implementation code; this is not a standalone script.
case "invitetoparty": bridge.PartyInvite(Arg(0)); return InjectionValue.Unit;Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.PartyAcceptInvite();Accepts the saved invitation to the group.
There are no parameters.
void - no value. Call on a separate line; completion does not confirm the server's action.
- PartyAcceptInvite if Party.Inviter is non-zero, sends RequestPartyAccept, locally assigns Leader=Inviter and clears Inviter. Without an invitation there is no action.
- In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.PartyAcceptInvite");
UO.PartyAcceptInvite();Parameters and execution flow:
- Accepts the saved invitation to the group.
UO.PartyAcceptInvite();Parameters and execution flow:
- PartyAcceptInvite if Party.Inviter is non-zero, sends RequestPartyAccept, locally assigns Leader=Inviter and clears Inviter. Without an invitation there is no action.
return RunScenario();
object? RunScenario()
{
UO.PartyAcceptInvite();
UO.Print(UO.InParty());
return null;
}Parameters and execution flow:
- In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.
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.PartyAcceptInvite();
UO.Wait(500);
UO.Print(UO.GetArrayLength(UO.PartyMembersList()));
return null;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.PartyAcceptInvite:bridge.PartyAcceptInvite().
Internal implementation code; this is not a standalone script.
case "partyacceptinvite": bridge.PartyAcceptInvite(); return InjectionValue.Unit;Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.PartyCanLootMe(object? value);Changes whether party members are allowed to remove items from a corpse.
-
value- 0 turns off; any non-zero integer includes.
void - no value. Call on a separate line; completion does not confirm the server's action.
- PartyCanLoot locally sets Party.CanLoot and calls RequestPartyLootState(enabled). Non-zero Value turns on, 0 turns off. The server still checks the rules.
- Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.PartyCanLootMe");
UO.PartyCanLootMe(1);Parameters and execution flow:
- Changes whether party members are allowed to remove items from a corpse.
UO.PartyCanLootMe(1);Parameters and execution flow:
- PartyCanLoot locally sets Party.CanLoot and calls RequestPartyLootState(enabled). Non-zero Value turns on, 0 turns off. The server still checks the rules.
return RunScenario();
object? RunScenario()
{
UO.PartyCanLootMe(0);
return null;
}Parameters and execution flow:
- Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
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()
{
ApplyMode(1);
return null;
}
void ApplyMode(dynamic mode)
{
UO.PartyCanLootMe(mode);
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: value (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.PartyCanLoot:bridge.PartyCanLoot(Arg(0) != 0). -
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility::Arg:Arg(0).
Internal implementation code; this is not a standalone script.
case "partycanlootme": bridge.PartyCanLoot(Arg(0) != 0); return InjectionValue.Unit;Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.PartyDeclineInvite();Declines a saved group invitation.
There are no parameters.
void - no value. Call on a separate line; completion does not confirm the server's action.
- PartyDeclineInvite if Party.Inviter is non-zero, sends Send_PartyDecline and clears Inviter. Without an invitation there is no action.
- In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.PartyDeclineInvite");
UO.PartyDeclineInvite();Parameters and execution flow:
- Declines a saved group invitation.
UO.PartyDeclineInvite();Parameters and execution flow:
- PartyDeclineInvite if Party.Inviter is non-zero, sends Send_PartyDecline and clears Inviter. Without an invitation there is no action.
return RunScenario();
object? RunScenario()
{
UO.PartyDeclineInvite();
UO.Print(UO.InParty());
return null;
}Parameters and execution flow:
- In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.
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.PartyDeclineInvite();
UO.Wait(500);
UO.Print(UO.GetArrayLength(UO.PartyMembersList()));
return null;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.PartyDeclineInvite:bridge.PartyDeclineInvite().
Internal implementation code; this is not a standalone script.
case "partydeclineinvite": bridge.PartyDeclineInvite(); return InjectionValue.Unit;Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.PartyLeave();Requests the current character to leave the group.
There are no parameters.
void - no value. Call on a separate line; completion does not confirm the server's action.
- PartyLeave if there is a Player, calls GameActions.RequestPartyQuit(_world.Player); without Player it does not send anything.
- In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.PartyLeave");
UO.PartyLeave();Parameters and execution flow:
- Requests the current character to leave the group.
UO.PartyLeave();Parameters and execution flow:
- PartyLeave if there is a Player, calls GameActions.RequestPartyQuit(_world.Player); without Player it does not send anything.
return RunScenario();
object? RunScenario()
{
if (Truth(UO.InParty()))
{
UO.PartyLeave();
}
return null;
}
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;Parameters and execution flow:
- In the examples, UO.Wait specifies only a script pause; the end of the pause does not prove that the server has completed the request.
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.PartyLeave();
UO.Wait(500);
UO.Print(UO.InParty());
return null;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.PartyLeave:bridge.PartyLeave().
Internal implementation code; this is not a standalone script.
case "partyleave": bridge.PartyLeave(); return InjectionValue.Unit;Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
dynamic UO.PartyMembersList();Bridge filters out non-empty Party.Members entries and stores them serial in list order.
There are no parameters.
Array int serial participants from local Party.Members. Empty entries/Serial=0 are excluded. The array may be empty.
- Bridge filters out non-empty Party.Members entries and stores them serial in list order. The call does not update the group from the server and does not invite members.
- Reads the current local state. There is no package, target or automatic update; individual reads may see different states.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The result of one call is printed in the journal. A number is not converted to bool; an array is displayed as its element count.
object? result = UO.PartyMembersList();
UO.Print(result is Array values ? "Count: " + values.Length : Convert.ToString(result));Parameters and execution flow:
- Bridge filters out non-empty Party.Members entries and stores them serial in list order.
var members = UO.PartyMembersList();
UO.Print(UO.GetArrayLength(members));Parameters and execution flow:
- Bridge filters out non-empty Party.Members entries and stores them serial in list order. The call does not update the group from the server and does not invite members.
return RunScenario();
object? RunScenario()
{
var members = UO.PartyMembersList();
if (Truth(UO.GetArrayLength(members) > 0))
{
UO.Print(Hex(members[0]));
}
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;Parameters and execution flow:
- Reads the current local state. There is no package, target or automatic update; individual reads may see different states.
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 before = UO.PartyMembersList();
UO.Wait(500);
var after = UO.PartyMembersList();
UO.Print(before);
UO.Print(after);
return null;
}
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: No parameters.
Result: dynamic / Any.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.PartyMembersList:bridge.PartyMembersList().
Internal implementation code; this is not a standalone script.
case "partymemberslist":
return new InjectionValue(bridge.PartyMembersList().Select(serial => new InjectionValue(serial)).ToArray());Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.PartyPrivateMessageTo(object? objID, object? msg);Sends a private message to a group member.
-
objID— Serial/ID object: int, numeric/hex string or set alias, for example "lasttarget". This is not a graphic/type. Check the loaded object before taking action. -
msg— Text through ToString; saved as transmitted.
void - no value. Call on a separate line; completion does not confirm the server's action.
- PartySay gets Text(1) and Arg(0); GameActions.SayParty(text, serial) addresses the message to the transmitted serial. The order is ObjID first, then Msg.
- Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.PartyPrivateMessageTo");
UO.PartyPrivateMessageTo("lasttarget", "Ready");Parameters and execution flow:
- Sends a private message to a group member.
UO.PartyPrivateMessageTo("lasttarget", "Ready");Parameters and execution flow:
- PartySay gets Text(1) and Arg(0); GameActions.SayParty(text, serial) addresses the message to the transmitted serial. The order is ObjID first, then Msg.
return RunScenario();
object? RunScenario()
{
var id = UO.GetSerial("lasttarget");
if (Truth(UO.Exists(id)))
{
UO.PartyPrivateMessageTo(id, "Ready");
}
return null;
}
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;Parameters and execution flow:
- Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
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()
{
SendPartyMessage(UO.GetSerial("lasttarget"), "Ready");
return null;
}
void SendPartyMessage(dynamic id, dynamic message)
{
if (Truth(id != "0x00000000") && Truth(Len(message) > 0))
{
UO.PartyPrivateMessageTo(id, message);
}
}
int Len(object? value) => Convert.ToString(value)?.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# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: objID (Any), msg (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.PartySay:bridge.PartySay(Text(1), Arg(0)). -
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility::Text:Text(1). -
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility::Arg:Arg(0).
Internal implementation code; this is not a standalone script.
case "partyprivatemessageto": bridge.PartySay(Text(1), Arg(0)); return InjectionValue.Unit;Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.PartySay(object? msg);Sends a message to the entire group.
-
msg— Text through ToString; saved as transmitted.
void - no value. Call on a separate line; completion does not confirm the server's action.
- Calls GameActions.SayParty(text, 0). Zero serial means group message; group composition and delivery are determined by the server.
- Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.PartySay");
UO.PartySay("Ready");Parameters and execution flow:
- Sends a message to the entire group.
UO.PartySay("Ready");Parameters and execution flow:
- Calls GameActions.SayParty(text, 0). Zero serial means group message; group composition and delivery are determined by the server.
return RunScenario();
object? RunScenario()
{
var message = "Ready";
if (Truth(UO.IsOnline()))
{
UO.PartySay(message);
}
return null;
}
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;Parameters and execution flow:
- Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
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()
{
SendText("Ready");
return null;
}
void SendText(dynamic message)
{
if (Truth(Len(message) > 0))
{
UO.PartySay(message);
}
}
int Len(object? value) => Convert.ToString(value)?.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# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: msg (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.PartySay:bridge.PartySay(Text(0), 0). -
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility::Text:Text(0).
Internal implementation code; this is not a standalone script.
case "partysay": bridge.PartySay(Text(0), 0); return InjectionValue.Unit;Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
void UO.RemoveFromParty(object? objID);Requests the removal of a group member via serial.
-
objID— Serial/ID object: int, numeric/hex string or set alias, for example "lasttarget". This is not a graphic/type. Check the loaded object before taking action.
void - no value. Call on a separate line; completion does not confirm the server's action.
- PartyRemove calls RequestPartyRemoveMember. Resolution depends on the role of the current character and server; the list of participants is not changed synchronously by this command.
- Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
Each example can be saved as a separate file .csx and run in IDE. The UO object and wait functions provide the host of the current game session. Replace demo serial names, coordinates and addresses with your own.
Run this code as a separate .csx file. Arguments appear directly in the call; replace demonstration names, serials and addresses with your own.
The command is a separate statement. The message before it marks the start of the call; it does not confirm a server action.
UO.Print("Calling UO.RemoveFromParty");
UO.RemoveFromParty(UO.GetSerial("lasttarget"));Parameters and execution flow:
- Requests the removal of a group member via serial.
var id = UO.GetSerial("lasttarget");
if (Truth(UO.Exists(id)))
{
UO.RemoveFromParty(id);
}
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;Parameters and execution flow:
- PartyRemove calls RequestPartyRemoveMember. Resolution depends on the role of the current character and server; the list of participants is not changed synchronously by this command.
return RunScenario();
object? RunScenario()
{
var id = UO.GetSerial("self");
if (Truth(UO.Exists(id)))
{
UO.RemoveFromParty(id);
}
return null;
}
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;Parameters and execution flow:
- Bridge sends the request on the game thread. Server rules apply; There is no built-in waiting for confirmation.
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()
{
ApplyToLoaded(UO.GetSerial("lasttarget"));
return null;
}
void ApplyToLoaded(dynamic id)
{
if (Truth(UO.Exists(id)))
{
UO.RemoveFromParty(id);
}
}
bool Truth(object? value) => value is bool flag ? flag : value is string text ? !string.IsNullOrEmpty(text) : value != null && Convert.ToDouble(value) != 0;
}C# is case sensitive. Use the exact UO name. Compare numeric flags with 0; use bool only where the signature returns bool.
Parameters: objID (Any)
Result: void / Unit.
During a call:
-
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility. -
ClassicUO.Game.Managers.ClassicUOInjectionApiBridge.PartyRemove:bridge.PartyRemove(Arg(0)). -
InjectionScript.Runtime.InjectionApiUO.ExecuteClientApiCompatibility::Arg:Arg(0).
Internal implementation code; this is not a standalone script.
case "removefromparty": bridge.PartyRemove(Arg(0)); return InjectionValue.Unit;ClassicUO — Bad Newbie & C# Scripts IDE