ScriptUO
Scripting Resources & Utilities => Stealth Client => Stealth Snippets\Library => Topic started by: Blacklisted on June 11, 2016, 09:02:36 AM
-
I am trying to check if a target is dead or not. but the target value always return true.
Im not sure if I am using the TargetHelper class correctly or not.
namespace Test
{
public partial class MainWindow : Window
{
public PlayerMobile Player = PlayerMobile.GetPlayer();
public TargetHelper TargetHelper = TargetHelper.GetTarget();
private Thread TestThread;
public MainWindow()
{
InitializeComponent();
TestThread = new Thread(TestIfDead);
}
private void btnStart_Click(object sender, RoutedEventArgs e)
{
TestThread.Start();
}
public void TestIfDead()
{
var target = TargetHelper.VCursorToMobile();
do
{
if (target.Dead)
{
this.Dispatcher.Invoke((Action)(() =>
{
tbIsDead.Text = "TARGET DIED";
}));
}
else
{
this.Dispatcher.Invoke((Action)(() =>
{
tbIsDead.Text = "TARGET ALIVE";
}));
}
} while (!target.Dead);
}
}
}