-
Member
TTS on low health
Could someone please assist me with writing a simple plugin that will speak the word "Health", when my health drops below a certain threshold?
In case you are wondering, I play multiple accounts, and sometimes I leave one guy at the door in HC while carrying him in GRs on the other. Sometimes I miss a mob at the door, but don't notice that my other guy is losing health, and it would be nice to get an audible notification that he is taking damage.
Last edited by VitaKaninen; 11-15-2017 at 01:29 PM.
-
Contributor
Health information you can get from "IPlayerDefenseInfo"
e.g. health below 50%
PHP Code:
if (Hud.Game.Me.Defense.HealthPct < 0.5f ) //or 50f //not tested/used HealthPct before
{
//do something
Hud.Sound.Speak("Health");
}
don't foreget to start a watch (lastspeak), because you don't want to hear
HealthHealthHealthHealthHealthHealthHealthHealthHealthHealthHealthHealth....
greetz gjuz
-
Post Thanks / Like - 1 Thanks
VitaKaninen (1 members gave Thanks to gjuz for this useful post)
-
Member
Thanks for the help!
Could someone please look at this and tell me what I am missing? I don;t know how to make a CreateWatch.
PHP Code:
using Turbo.Plugins.Default;
using System.Collections.Generic;
using System.Linq;
using System;
namespace Turbo.Plugins.User
{
public class HealthSpeak : BasePlugin, IInGameWorldPainter
{
public bool EnableSpeak { get; set; }
public HealthSpeak()
{
Enabled = true;
EnableSpeak = true;
}
public void PaintWorld(WorldLayer layer)
{
{
if (EnableSpeak && (Hud.Game.Me.Defense.HealthPct < 90f ))
{
Hud.Sound.Speak("Health");
}
}
}
}
}
Last edited by VitaKaninen; 11-17-2017 at 06:36 AM.
-
Contributor
use this:
PHP Code:
if (EnableSpeak && (Hud.Game.Me.Defense.HealthPct < 90f ) && Hud.Sound.LastSpeak.TimerTest(3000))
this will remind you every 3s
and not "HealthHealthHealthHealthHealthHealthHealthHealthHealth"
greetz gjuz
-
Post Thanks / Like - 1 Thanks
VitaKaninen (1 members gave Thanks to gjuz for this useful post)