I encourage you to peruse through the C# script tutorial. It goes over this ... but here are two examples :
1. Bring up a local client target, get an object ID
Using ScriptAPI.cs
Item Result = Target.RequestTarget();
Using ScriptDotNet.DLL Normal API :
Stealth.Script_ClientRequestObjectTarget(); // This brings up a target cursor in Client.exe
while(Stealth.Script_ClientTargetResponsePresent() == false) // while Client.exe does NOT have a target
Stealth.Script_Wait(100); // Wait 100ms, then loop
var ChosenTarget = Stealth.Script_ClientTargetResponse(); // This function returns a TTargetInfo object with ID, Tile, X, Y, Z
Now, in those two examples this is bringing up a "Virtual Target" ... Meaning, we are requesting a target in Client.exe, but it will never send the result back to the game server. This is a local interaction between Stealth and the Client.exe
If, say, you wanted to cast a spell and wait for the server's target :
Stealth.Script_CastSpell("Greater Heal"); // same as Self.Cast()
Stealth.Script_WaitForTarget(10000); // Wait for target to appear, timeout after 10,000 milliseconds (10 seconds)
uint LastTarget = Stealth.Script_GetLastTarget();